.. | .. |
---|
378 | 378 | static DEFINE_SPINLOCK(cgwb_lock); |
---|
379 | 379 | static struct workqueue_struct *cgwb_release_wq; |
---|
380 | 380 | |
---|
| 381 | +static void cgwb_free_rcu(struct rcu_head *rcu_head) |
---|
| 382 | +{ |
---|
| 383 | + struct bdi_writeback *wb = container_of(rcu_head, |
---|
| 384 | + struct bdi_writeback, rcu); |
---|
| 385 | + |
---|
| 386 | + percpu_ref_exit(&wb->refcnt); |
---|
| 387 | + kfree(wb); |
---|
| 388 | +} |
---|
| 389 | + |
---|
381 | 390 | static void cgwb_release_workfn(struct work_struct *work) |
---|
382 | 391 | { |
---|
383 | 392 | struct bdi_writeback *wb = container_of(work, struct bdi_writeback, |
---|
.. | .. |
---|
395 | 404 | blkcg_unpin_online(blkcg); |
---|
396 | 405 | |
---|
397 | 406 | fprop_local_destroy_percpu(&wb->memcg_completions); |
---|
398 | | - percpu_ref_exit(&wb->refcnt); |
---|
399 | 407 | wb_exit(wb); |
---|
400 | | - kfree_rcu(wb, rcu); |
---|
| 408 | + call_rcu(&wb->rcu, cgwb_free_rcu); |
---|
401 | 409 | } |
---|
402 | 410 | |
---|
403 | 411 | static void cgwb_release(struct percpu_ref *refcnt) |
---|