revert android-tegra-2.6.36-honeycomb-mr1-9001adc to v2.6.36
[firefly-linux-kernel-4.4.55.git] / kernel / perf_event.c
index 65b09a836cc3bdaed508cb1e050a174170241a8a..b98bed3d8182685ffff2b840c0ff4809b4f65cb8 100644 (file)
@@ -1620,12 +1620,8 @@ static void rotate_ctx(struct perf_event_context *ctx)
 {
        raw_spin_lock(&ctx->lock);
 
-       /*
-        * Rotate the first entry last of non-pinned groups. Rotation might be
-        * disabled by the inheritance code.
-        */
-       if (!ctx->rotate_disable)
-               list_rotate_left(&ctx->flexible_groups);
+       /* Rotate the first entry last of non-pinned groups */
+       list_rotate_left(&ctx->flexible_groups);
 
        raw_spin_unlock(&ctx->lock);
 }
@@ -1777,13 +1773,7 @@ static u64 perf_event_read(struct perf_event *event)
                unsigned long flags;
 
                raw_spin_lock_irqsave(&ctx->lock, flags);
-               /*
-                * may read while context is not active
-                * (e.g., thread is blocked), in that case
-                * we cannot update context time
-                */
-               if (ctx->is_active)
-                       update_context_time(ctx);
+               update_context_time(ctx);
                update_event_times(event);
                raw_spin_unlock_irqrestore(&ctx->lock, flags);
        }
@@ -5626,7 +5616,6 @@ int perf_event_init_task(struct task_struct *child)
        struct perf_event *event;
        struct task_struct *parent = current;
        int inherited_all = 1;
-       unsigned long flags;
        int ret = 0;
 
        child->perf_event_ctxp = NULL;
@@ -5667,15 +5656,6 @@ int perf_event_init_task(struct task_struct *child)
                        break;
        }
 
-       /*
-        * We can't hold ctx->lock when iterating the ->flexible_group list due
-        * to allocations, but we need to prevent rotation because
-        * rotate_ctx() will change the list from interrupt context.
-        */
-       raw_spin_lock_irqsave(&parent_ctx->lock, flags);
-       parent_ctx->rotate_disable = 1;
-       raw_spin_unlock_irqrestore(&parent_ctx->lock, flags);
-
        list_for_each_entry(event, &parent_ctx->flexible_groups, group_entry) {
                ret = inherit_task_group(event, parent, parent_ctx, child,
                                         &inherited_all);
@@ -5683,10 +5663,6 @@ int perf_event_init_task(struct task_struct *child)
                        break;
        }
 
-       raw_spin_lock_irqsave(&parent_ctx->lock, flags);
-       parent_ctx->rotate_disable = 0;
-       raw_spin_unlock_irqrestore(&parent_ctx->lock, flags);
-
        child_ctx = child->perf_event_ctxp;
 
        if (child_ctx && inherited_all) {