OSDN Git Service

Merge branches 'perf-urgent-for-linus' and 'perf-core-for-linus' of git://git.kernel...
[uclinux-h8/linux.git] / kernel / events / core.c
index c7ee497..2207efc 100644 (file)
@@ -341,8 +341,8 @@ struct perf_cgroup {
 static inline struct perf_cgroup *
 perf_cgroup_from_task(struct task_struct *task)
 {
-       return container_of(task_subsys_state(task, perf_subsys_id),
-                       struct perf_cgroup, css);
+       return container_of(task_css(task, perf_subsys_id),
+                           struct perf_cgroup, css);
 }
 
 static inline bool
@@ -592,7 +592,9 @@ static inline int perf_cgroup_connect(int fd, struct perf_event *event,
        if (!f.file)
                return -EBADF;
 
-       css = cgroup_css_from_dir(f.file, perf_subsys_id);
+       rcu_read_lock();
+
+       css = css_from_dir(f.file->f_dentry, &perf_subsys);
        if (IS_ERR(css)) {
                ret = PTR_ERR(css);
                goto out;
@@ -618,6 +620,7 @@ static inline int perf_cgroup_connect(int fd, struct perf_event *event,
                ret = -EINVAL;
        }
 out:
+       rcu_read_unlock();
        fdput(f);
        return ret;
 }
@@ -2712,7 +2715,7 @@ static void perf_adjust_freq_unthr_context(struct perf_event_context *ctx,
 
                hwc = &event->hw;
 
-               if (needs_unthr && hwc->interrupts == MAX_INTERRUPTS) {
+               if (hwc->interrupts == MAX_INTERRUPTS) {
                        hwc->interrupts = 0;
                        perf_log_throttle(event, 1);
                        event->pmu->start(event, 0);
@@ -7901,7 +7904,8 @@ unlock:
 device_initcall(perf_event_sysfs_init);
 
 #ifdef CONFIG_CGROUP_PERF
-static struct cgroup_subsys_state *perf_cgroup_css_alloc(struct cgroup *cont)
+static struct cgroup_subsys_state *
+perf_cgroup_css_alloc(struct cgroup_subsys_state *parent_css)
 {
        struct perf_cgroup *jc;
 
@@ -7918,11 +7922,10 @@ static struct cgroup_subsys_state *perf_cgroup_css_alloc(struct cgroup *cont)
        return &jc->css;
 }
 
-static void perf_cgroup_css_free(struct cgroup *cont)
+static void perf_cgroup_css_free(struct cgroup_subsys_state *css)
 {
-       struct perf_cgroup *jc;
-       jc = container_of(cgroup_subsys_state(cont, perf_subsys_id),
-                         struct perf_cgroup, css);
+       struct perf_cgroup *jc = container_of(css, struct perf_cgroup, css);
+
        free_percpu(jc->info);
        kfree(jc);
 }
@@ -7934,15 +7937,17 @@ static int __perf_cgroup_move(void *info)
        return 0;
 }
 
-static void perf_cgroup_attach(struct cgroup *cgrp, struct cgroup_taskset *tset)
+static void perf_cgroup_attach(struct cgroup_subsys_state *css,
+                              struct cgroup_taskset *tset)
 {
        struct task_struct *task;
 
-       cgroup_taskset_for_each(task, cgrp, tset)
+       cgroup_taskset_for_each(task, css, tset)
                task_function_call(task, __perf_cgroup_move, task);
 }
 
-static void perf_cgroup_exit(struct cgroup *cgrp, struct cgroup *old_cgrp,
+static void perf_cgroup_exit(struct cgroup_subsys_state *css,
+                            struct cgroup_subsys_state *old_css,
                             struct task_struct *task)
 {
        /*