]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 9 Jun 2014 21:56:07 +0000 (14:56 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 9 Jun 2014 21:56:07 +0000 (14:56 -0700)
Pull percpu updates from Tejun Heo:
 "Nothing too exciting.  percpu_ref is going through some interface
  changes and getting new features with more changes in the pipeline but
  given its young age and few users, it's very low impact"

* 'for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu:
  percpu-refcount: implement percpu_ref_tryget()
  percpu-refcount: rename percpu_ref_tryget() to percpu_ref_tryget_live()
  percpu: Replace __get_cpu_var with this_cpu_ptr

1  2 
include/linux/cgroup.h
include/linux/percpu.h

diff --combined include/linux/cgroup.h
index d60904b9e50532410af2956c3546fa5072cae08e,549aed8de32b8f526e496c97b1f4c70b1ff392ae..bddebc5cf8e7501d779f3e59b3027d482b37e7d1
@@@ -101,7 -101,7 +101,7 @@@ static inline bool css_tryget(struct cg
  {
        if (css->flags & CSS_ROOT)
                return true;
-       return percpu_ref_tryget(&css->refcnt);
+       return percpu_ref_tryget_live(&css->refcnt);
  }
  
  /**
@@@ -473,7 -473,6 +473,7 @@@ struct cftype 
  };
  
  extern struct cgroup_root cgrp_dfl_root;
 +extern struct css_set init_css_set;
  
  static inline bool cgroup_on_dfl(const struct cgroup *cgrp)
  {
@@@ -701,20 -700,6 +701,20 @@@ static inline struct cgroup_subsys_stat
        return task_css_check(task, subsys_id, false);
  }
  
 +/**
 + * task_css_is_root - test whether a task belongs to the root css
 + * @task: the target task
 + * @subsys_id: the target subsystem ID
 + *
 + * Test whether @task belongs to the root css on the specified subsystem.
 + * May be invoked in any context.
 + */
 +static inline bool task_css_is_root(struct task_struct *task, int subsys_id)
 +{
 +      return task_css_check(task, subsys_id, true) ==
 +              init_css_set.subsys[subsys_id];
 +}
 +
  static inline struct cgroup *task_cgroup(struct task_struct *task,
                                         int subsys_id)
  {
diff --combined include/linux/percpu.h
index 495c6543a8f2e8a880eaa54c49ed267413abf8f5,539b3caa57486a2a5168f50a2a2dd07bfda35750..8419053d0f2e886949b8699b2fee383910c79356
@@@ -29,7 -29,7 +29,7 @@@
   */
  #define get_cpu_var(var) (*({                         \
        preempt_disable();                              \
-       &__get_cpu_var(var); }))
+       this_cpu_ptr(&var); }))
  
  /*
   * The weird & is necessary because sparse considers (void)(var) to be
@@@ -639,7 -639,7 +639,7 @@@ do {                                                                       
  #  define raw_cpu_add_return_8(pcp, val)      raw_cpu_generic_add_return(pcp, val)
  # endif
  # define raw_cpu_add_return(pcp, val) \
 -      __pcpu_size_call_return2(raw_add_return_, pcp, val)
 +      __pcpu_size_call_return2(raw_cpu_add_return_, pcp, val)
  #endif
  
  #define raw_cpu_sub_return(pcp, val)  raw_cpu_add_return(pcp, -(typeof(pcp))(val))