Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1495195
| From | John Stultz <john.stultz@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [RFC][PATCH 0/2] Another pass at Android style loosening of cgroup attach permissions |
| Date | 2016-10-04 06:50 +0200 |
| Message-ID | <sopPX-648-1@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
As a heads up, this is just a first RFC and not a submission. I wanted to send this out again, as the last time I submitted this (https://marc.info/?l=linux-kernel&m=143217972215192&w=2) the discussion got out into the separate issue of how Android at one time abused memcg (but I believe now memcg is no longer used). So for this revision, I've removed any memcg usage so we can try to focus on just the actively used cpuset and cpuctrl cgroups. Android currently loosens the cgroup attchment permissions, allowing tasks with CAP_SYS_NICE to be able to allow tasks to move arbitrary tasks across cgroups. Android currently uses cgroups to bound tasks in various states (ie: foreground applications, background applications, audio application, system audio, and system tasks), to specific cpus as well as to limit cpu time. This allows for things like audio applications to be SCHED_FIFO but not run-away hogging infinite cpu, and background task cpu usage to be similarly cputime limited, and kept to only low-power cpus. The migration of a task from the foreground to background, or to elevate a task to audio priority, may be done by system service that does not run as root. So this patch allows processes with CAP_SYS_NICE to be able to migrate tasks between cgroups. I suspect if there was a specific cap (CAP_SYS_CHANGE_CGROUP) for this, it would be usable here, but in its absence, they've overloaded CAP_SYS_NICE for this use. At first glance, overloading CAP_SYS_NICE seems a bit hackish, but this shows that there is a active and widely deployed use for different cgroup attachment rules then what is currently available. I've tried to rework the patches so this attachment policy is build time configurable, and wanted to send them out for review so folks might give their thoughts on this implementation and what they might see as a better way to go about achieving the same goal. Thoughts and feedback would be appriciated! thanks -john Cc: Tejun Heo <tj@kernel.org> Cc: Li Zefan <lizefan@huawei.com> Cc: Jonathan Corbet <corbet@lwn.net> Cc: cgroups@vger.kernel.org Cc: Android Kernel Team <kernel-team@android.com> Cc: Rom Lemarchand <romlem@android.com> Cc: Colin Cross <ccross@android.com> Cc: Dmitry Shmidt <dimitrysh@google.com> Cc: Todd Kjos <tkjos@google.com> Cc: Christian Poetzsch <christian.potzsch@imgtec.com> Cc: Amit Pundir <amit.pundir@linaro.org> Colin Cross (1): cgroup: Add generic cgroup subsystem permission checks Rom Lemarchand (1): cgroup: Add a allow_attach policy for Android Documentation/cgroup-v1/cgroups.txt | 9 ++++++ include/linux/cgroup-defs.h | 1 + include/linux/cgroup.h | 16 ++++++++++ init/Kconfig | 7 +++++ kernel/cgroup.c | 61 +++++++++++++++++++++++++++++++++++-- kernel/cpuset.c | 3 ++ kernel/sched/core.c | 3 ++ 7 files changed, 98 insertions(+), 2 deletions(-) -- 1.9.1
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[RFC][PATCH 0/2] Another pass at Android style loosening of cgroup attach permissions John Stultz <john.stultz@linaro.org> - 2016-10-04 06:50 +0200
[PATCH 2/2] cgroup: Add a allow_attach policy for Android John Stultz <john.stultz@linaro.org> - 2016-10-04 06:50 +0200
Re: [PATCH 2/2] cgroup: Add a allow_attach policy for Android John Stultz <john.stultz@linaro.org> - 2016-10-05 21:20 +0200
Re: [PATCH 2/2] cgroup: Add a allow_attach policy for Android Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-10-07 00:50 +0200
Re: [PATCH 2/2] cgroup: Add a allow_attach policy for Android Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-10-07 01:00 +0200
Re: [PATCH 2/2] cgroup: Add a allow_attach policy for Android Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-10-05 21:20 +0200
[PATCH 1/2] cgroup: Add generic cgroup subsystem permission checks John Stultz <john.stultz@linaro.org> - 2016-10-04 06:50 +0200
Re: [PATCH 1/2] cgroup: Add generic cgroup subsystem permission checks Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-10-05 21:10 +0200
Re: [PATCH 1/2] cgroup: Add generic cgroup subsystem permission checks John Stultz <john.stultz@linaro.org> - 2016-10-05 21:20 +0200
Re: [PATCH 1/2] cgroup: Add generic cgroup subsystem permission checks Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2016-10-05 21:30 +0200
Re: [RFC][PATCH 0/2] Another pass at Android style loosening of cgroup attach permissions Tejun Heo <tj@kernel.org> - 2016-10-04 18:20 +0200
Re: [RFC][PATCH 0/2] Another pass at Android style loosening of cgroup attach permissions John Stultz <john.stultz@linaro.org> - 2016-10-04 20:10 +0200
Re: [RFC][PATCH 0/2] Another pass at Android style loosening of cgroup attach permissions John Stultz <john.stultz@linaro.org> - 2016-10-04 20:10 +0200
Re: [RFC][PATCH 0/2] Another pass at Android style loosening of cgroup attach permissions Tejun Heo <tj@kernel.org> - 2016-10-04 21:40 +0200
Re: [RFC][PATCH 0/2] Another pass at Android style loosening of cgroup attach permissions Tejun Heo <tj@kernel.org> - 2016-10-04 21:50 +0200
Re: [RFC][PATCH 0/2] Another pass at Android style loosening of cgroup attach permissions John Stultz <john.stultz@linaro.org> - 2016-10-04 21:50 +0200
Re: [RFC][PATCH 0/2] Another pass at Android style loosening of cgroup attach permissions "Serge E. Hallyn" <serge@hallyn.com> - 2016-10-04 22:20 +0200
Re: [RFC][PATCH 0/2] Another pass at Android style loosening of cgroup attach permissions Tejun Heo <tj@kernel.org> - 2016-10-04 22:40 +0200
Re: [RFC][PATCH 0/2] Another pass at Android style loosening of cgroup attach permissions "Serge E. Hallyn" <serge@hallyn.com> - 2016-10-04 23:30 +0200
Re: [RFC][PATCH 0/2] Another pass at Android style loosening of cgroup attach permissions Tejun Heo <tj@kernel.org> - 2016-10-04 23:40 +0200
csiph-web