diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2011-03-18 00:07:41 -0400 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2011-05-08 01:51:08 -0400 |
commit | cb796ff338db9f064f4ecb7d41898e8bedcad4d9 (patch) | |
tree | 53ad56428dc26a4d59281e3862a347d083c3c5ec /kernel/perf_event.c | |
parent | 1f8d36a1869f5efae4fadf6baf01f02211040b97 (diff) |
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 <laijs@cn.fujitsu.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r-- | kernel/perf_event.c | 10 |
1 files changed, 1 insertions, 9 deletions
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) | |||
586 | WARN_ON(!atomic_inc_not_zero(&ctx->refcount)); | 586 | WARN_ON(!atomic_inc_not_zero(&ctx->refcount)); |
587 | } | 587 | } |
588 | 588 | ||
589 | static void free_ctx(struct rcu_head *head) | ||
590 | { | ||
591 | struct perf_event_context *ctx; | ||
592 | |||
593 | ctx = container_of(head, struct perf_event_context, rcu_head); | ||
594 | kfree(ctx); | ||
595 | } | ||
596 | |||
597 | static void put_ctx(struct perf_event_context *ctx) | 589 | static void put_ctx(struct perf_event_context *ctx) |
598 | { | 590 | { |
599 | if (atomic_dec_and_test(&ctx->refcount)) { | 591 | if (atomic_dec_and_test(&ctx->refcount)) { |
@@ -601,7 +593,7 @@ static void put_ctx(struct perf_event_context *ctx) | |||
601 | put_ctx(ctx->parent_ctx); | 593 | put_ctx(ctx->parent_ctx); |
602 | if (ctx->task) | 594 | if (ctx->task) |
603 | put_task_struct(ctx->task); | 595 | put_task_struct(ctx->task); |
604 | call_rcu(&ctx->rcu_head, free_ctx); | 596 | kfree_rcu(ctx, rcu_head); |
605 | } | 597 | } |
606 | } | 598 | } |
607 | 599 | ||