OSDN Git Service

Merge remote-tracking branch 'common/android-4.4' into android-4.4.y
authorDmitry Shmidt <dimitrysh@google.com>
Fri, 21 Oct 2016 20:44:21 +0000 (13:44 -0700)
committerDmitry Shmidt <dimitrysh@google.com>
Fri, 21 Oct 2016 20:50:06 +0000 (13:50 -0700)
Change-Id: I8c5ec371d8b612f6880b2428893bec89d7da71f6

1  2 
arch/arm64/Kconfig
include/linux/cgroup-defs.h
kernel/cgroup.c
kernel/cpuset.c
kernel/sched/core.c
mm/memcontrol.c

Simple merge
Simple merge
diff --cc kernel/cgroup.c
Simple merge
diff --cc kernel/cpuset.c
@@@ -2095,49 -2061,15 +2095,31 @@@ static void cpuset_bind(struct cgroup_s
        mutex_unlock(&cpuset_mutex);
  }
  
- static int cpuset_allow_attach(struct cgroup_taskset *tset)
- {
-       const struct cred *cred = current_cred(), *tcred;
-       struct task_struct *task;
-       struct cgroup_subsys_state *css;
-       cgroup_taskset_for_each(task, css, tset) {
-               tcred = __task_cred(task);
-               if ((current != task) && !capable(CAP_SYS_ADMIN) &&
-                    cred->euid.val != tcred->uid.val && cred->euid.val != tcred->suid.val)
-                       return -EACCES;
-       }
-       return 0;
- }
 +/*
 + * Make sure the new task conform to the current state of its parent,
 + * which could have been changed by cpuset just after it inherits the
 + * state from the parent and before it sits on the cgroup's task list.
 + */
 +void cpuset_fork(struct task_struct *task, void *priv)
 +{
 +      if (task_css_is_root(task, cpuset_cgrp_id))
 +              return;
 +
 +      set_cpus_allowed_ptr(task, &current->cpus_allowed);
 +      task->mems_allowed = current->mems_allowed;
 +}
 +
  struct cgroup_subsys cpuset_cgrp_subsys = {
        .css_alloc      = cpuset_css_alloc,
        .css_online     = cpuset_css_online,
        .css_offline    = cpuset_css_offline,
        .css_free       = cpuset_css_free,
        .can_attach     = cpuset_can_attach,
-       .allow_attach   = cpuset_allow_attach,
        .cancel_attach  = cpuset_cancel_attach,
        .attach         = cpuset_attach,
 +      .post_attach    = cpuset_post_attach,
        .bind           = cpuset_bind,
 +      .fork           = cpuset_fork,
        .legacy_cftypes = files,
        .early_init     = 1,
  };
Simple merge
diff --cc mm/memcontrol.c
@@@ -5352,8 -5222,7 +5343,7 @@@ struct cgroup_subsys memory_cgrp_subsy
        .css_reset = mem_cgroup_css_reset,
        .can_attach = mem_cgroup_can_attach,
        .cancel_attach = mem_cgroup_cancel_attach,
 -      .attach = mem_cgroup_move_task,
 +      .post_attach = mem_cgroup_move_task,
-       .allow_attach = mem_cgroup_allow_attach,
        .bind = mem_cgroup_bind,
        .dfl_cftypes = memory_files,
        .legacy_cftypes = mem_cgroup_legacy_files,