From: Lai Jiangshan Date: Fri, 18 Mar 2011 04:07:41 +0000 (+0800) Subject: perf,rcu: convert call_rcu(free_ctx) to kfree_rcu() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=cb796ff338db9f064f4ecb7d41898e8bedcad4d9;p=openwrt%2Fstaging%2Fblogic.git perf,rcu: convert call_rcu(free_ctx) to kfree_rcu() The rcu callback free_ctx() just calls a kfree(), so we use kfree_rcu() instead of the call_rcu(free_ctx). Signed-off-by: Lai Jiangshan Acked-by: Peter Zijlstra Signed-off-by: Paul E. McKenney Reviewed-by: Josh Triplett --- diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 8e81a9860a0d..17a176f7ef11 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c @@ -586,14 +586,6 @@ static void get_ctx(struct perf_event_context *ctx) WARN_ON(!atomic_inc_not_zero(&ctx->refcount)); } -static void free_ctx(struct rcu_head *head) -{ - struct perf_event_context *ctx; - - ctx = container_of(head, struct perf_event_context, rcu_head); - kfree(ctx); -} - static void put_ctx(struct perf_event_context *ctx) { if (atomic_dec_and_test(&ctx->refcount)) { @@ -601,7 +593,7 @@ static void put_ctx(struct perf_event_context *ctx) put_ctx(ctx->parent_ctx); if (ctx->task) put_task_struct(ctx->task); - call_rcu(&ctx->rcu_head, free_ctx); + kfree_rcu(ctx, rcu_head); } }