Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[firefly-linux-kernel-4.4.55.git] / kernel / events / core.c
index 0fc34a370ba41be068f160e07875abd0bf1bdbdc..c09767f7db3e20e4a510c7a51fba7d662e967659 100644 (file)
@@ -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);
        }
 }
 
@@ -5331,14 +5323,6 @@ swevent_hlist_deref(struct swevent_htable *swhash)
                                         lockdep_is_held(&swhash->hlist_mutex));
 }
 
-static void swevent_hlist_release_rcu(struct rcu_head *rcu_head)
-{
-       struct swevent_hlist *hlist;
-
-       hlist = container_of(rcu_head, struct swevent_hlist, rcu_head);
-       kfree(hlist);
-}
-
 static void swevent_hlist_release(struct swevent_htable *swhash)
 {
        struct swevent_hlist *hlist = swevent_hlist_deref(swhash);
@@ -5347,7 +5331,7 @@ static void swevent_hlist_release(struct swevent_htable *swhash)
                return;
 
        rcu_assign_pointer(swhash->swevent_hlist, NULL);
-       call_rcu(&hlist->rcu_head, swevent_hlist_release_rcu);
+       kfree_rcu(hlist, rcu_head);
 }
 
 static void swevent_hlist_put_cpu(struct perf_event *event, int cpu)