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>
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);
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)