X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=mm%2Fbacking-dev.c;h=bf5525c2e561a018f2ba056b0d803edb00f0e548;hb=refs%2Fheads%2Fsandbox%2Flstelmach%2Fvirgl;hp=c30419a5e1197dbc9700cc8d22d5a07ed185a3cb;hpb=098179413d07392ad8c52c7c7605d3d3886ef569;p=platform%2Fkernel%2Flinux-starfive.git diff --git a/mm/backing-dev.c b/mm/backing-dev.c index c30419a..bf5525c 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -380,6 +380,15 @@ static LIST_HEAD(offline_cgwbs); static void cleanup_offline_cgwbs_workfn(struct work_struct *work); static DECLARE_WORK(cleanup_offline_cgwbs_work, cleanup_offline_cgwbs_workfn); +static void cgwb_free_rcu(struct rcu_head *rcu_head) +{ + struct bdi_writeback *wb = container_of(rcu_head, + struct bdi_writeback, rcu); + + percpu_ref_exit(&wb->refcnt); + kfree(wb); +} + static void cgwb_release_workfn(struct work_struct *work) { struct bdi_writeback *wb = container_of(work, struct bdi_writeback, @@ -402,11 +411,10 @@ static void cgwb_release_workfn(struct work_struct *work) list_del(&wb->offline_node); spin_unlock_irq(&cgwb_lock); - percpu_ref_exit(&wb->refcnt); wb_exit(wb); bdi_put(bdi); WARN_ON_ONCE(!list_empty(&wb->b_attached)); - kfree_rcu(wb, rcu); + call_rcu(&wb->rcu, cgwb_free_rcu); } static void cgwb_release(struct percpu_ref *refcnt)