From: YueHaibing yuehaibing@huawei.com
mainline inclusion from mainline-5.5-rc1 commit 364b05fd06e87e53dc03396f73afeac48d8e0998 category: feature bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=27 CVE: NA ---------------------------
The callback function of call_rcu() just calls kfree(), so we can use kfree_rcu() instead of call_rcu() + callback function.
Signed-off-by: YueHaibing yuehaibing@huawei.com Signed-off-by: Jens Axboe axboe@kernel.dk Signed-off-by: Zhihao Cheng chengzhihao1@huawei.com Signed-off-by: yangerkun yangerkun@huawei.com Reviewed-by: zhangyi (F) yi.zhang@huawei.com Signed-off-by: Cheng Jian cj.chengjian@huawei.com --- fs/io-wq.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/fs/io-wq.c b/fs/io-wq.c index 4fab4917938e..7f94fab46c22 100644 --- a/fs/io-wq.c +++ b/fs/io-wq.c @@ -103,13 +103,6 @@ struct io_wq { struct completion done; };
-static void io_wq_free_worker(struct rcu_head *head) -{ - struct io_worker *worker = container_of(head, struct io_worker, rcu); - - kfree(worker); -} - static bool io_worker_get(struct io_worker *worker) { return refcount_inc_not_zero(&worker->ref); @@ -195,7 +188,7 @@ static void io_worker_exit(struct io_worker *worker) if (all_done && refcount_dec_and_test(&wqe->wq->refs)) complete(&wqe->wq->done);
- call_rcu(&worker->rcu, io_wq_free_worker); + kfree_rcu(worker, rcu); }
static void io_worker_start(struct io_wqe *wqe, struct io_worker *worker)