{"push_id":690843629,"size":14,"distinct_size":14,"ref":"refs/heads/cgroup-implement-pids-cgroup","head":"0c71f5df1ec1e77634d2cd7907a6e8417a8fcf58","before":"3615f85987e9a738c8bf72eb94b364cbeb647adb","commits":[{"sha":"d0f702e648dc365070f1868ec291264ad27e65d8","author":{"email":"818f8a165c25fa146ecad28e2ef3e3fb996fa364@cn.fujitsu.com","name":"Chen Hanxiao"},"message":"cgroup: fix some comment typos\n\ns/effctive/effective\ns/hierarhcy/hierarchy\ns/shoulid/should\n\nSigned-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>\nSigned-off-by: Tejun Heo <tj@kernel.org>","distinct":true,"url":"https://api.github.com/repos/cyphar/linux/commits/d0f702e648dc365070f1868ec291264ad27e65d8"},{"sha":"b4a04ab7a37b490cad48e69abfe14288cacb669c","author":{"email":"546b05909706652891a87f7bfe385ae147f61f91@kernel.org","name":"Tejun Heo"},"message":"cgroup: separate out include/linux/cgroup-defs.h\n\nFrom 2d728f74bfc071df06773e2fd7577dd5dab6425d Mon Sep 17 00:00:00 2001\nFrom: Tejun Heo <tj@kernel.org>\nDate: Wed, 13 May 2015 15:37:01 -0400\n\nThis patch separates out cgroup-defs.h from cgroup.h which has grown a\nlot of dependencies.  cgroup-defs.h currently only contains constant\nand type definitions and can be used to break circular include\ndependency.  While moving, definitions are reordered so that\ncgroup-defs.h has consistent logical structure.\n\nThis patch is pure reorganization.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>","distinct":true,"url":"https://api.github.com/repos/cyphar/linux/commits/b4a04ab7a37b490cad48e69abfe14288cacb669c"},{"sha":"c326aa2bb2209e10df4a381801bb34ca0f923038","author":{"email":"546b05909706652891a87f7bfe385ae147f61f91@kernel.org","name":"Tejun Heo"},"message":"cgroup: reorganize include/linux/cgroup.h\n\nFrom c4d440938b5e2015c70594fe6666a099c844f929 Mon Sep 17 00:00:00 2001\nFrom: Tejun Heo <tj@kernel.org>\nDate: Wed, 13 May 2015 16:21:40 -0400\n\nOver time, cgroup.h grew organically and doesn't have much logical\nstructure at this point.  Separation of cgroup-defs.h in the previous\npatch gives us a good chance for reorganizing cgroup.h as changes to\nthe header are likely to cause conflicts anyway.\n\nThis patch reorganizes cgroup.h so that it has consistent logical\ngrouping.\n\nThis is pure reorganization.\n\nv2: Relocating #ifdef CONFIG_CGROUPS caused build failure when cgroup\n    is disabled.  Dropped.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>","distinct":true,"url":"https://api.github.com/repos/cyphar/linux/commits/c326aa2bb2209e10df4a381801bb34ca0f923038"},{"sha":"8ab456ac3697dbd1d3eae5d5817dba941faf89ee","author":{"email":"b305c9b0212d6145eea67bbffd24e29cb79c759c@cyphar.com","name":"Aleksa Sarai"},"message":"cgroup: switch to unsigned long for bitmasks\n\nSwitch the type of all internal cgroup masks to (unsigned long), which\nis the correct type for bitmasks. This is in preparation for the\nfor_each_subsys_which patch.\n\nSigned-off-by: Aleksa Sarai <cyphar@cyphar.com>\nSigned-off-by: Tejun Heo <tj@kernel.org>","distinct":true,"url":"https://api.github.com/repos/cyphar/linux/commits/8ab456ac3697dbd1d3eae5d5817dba941faf89ee"},{"sha":"7d7efec368d537226142cbe559f45797f18672f9","author":{"email":"546b05909706652891a87f7bfe385ae147f61f91@kernel.org","name":"Tejun Heo"},"message":"sched, cgroup: reorganize threadgroup locking\n\nthreadgroup_change_begin/end() are used to mark the beginning and end\nof threadgroup modifying operations to allow code paths which require\na threadgroup to stay stable across blocking operations to synchronize\nagainst those sections using threadgroup_lock/unlock().\n\nIt's currently implemented as a general mechanism in sched.h using\nper-signal_struct rwsem; however, this never grew non-cgroup use cases\nand becomes noop if !CONFIG_CGROUPS.  It turns out that cgroups is\ngonna be better served with a different sycnrhonization scheme and is\na bit silly to keep cgroups specific details as a general mechanism.\n\nWhat's general here is identifying the places where threadgroups are\nmodified.  This patch restructures threadgroup locking so that\nthreadgroup_change_begin/end() become a place where subsystems which\nneed to sycnhronize against threadgroup changes can hook into.\n\ncgroup_threadgroup_change_begin/end() which operate on the\nper-signal_struct rwsem are created and threadgroup_lock/unlock() are\nmoved to cgroup.c and made static.\n\nThis is pure reorganization which doesn't cause any functional\nchanges.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>\nCc: Ingo Molnar <mingo@redhat.com>\nCc: Peter Zijlstra <peterz@infradead.org>","distinct":true,"url":"https://api.github.com/repos/cyphar/linux/commits/7d7efec368d537226142cbe559f45797f18672f9"},{"sha":"d59cfc09c32a2ae31f1c3bc2983a0cd79afb3f14","author":{"email":"546b05909706652891a87f7bfe385ae147f61f91@kernel.org","name":"Tejun Heo"},"message":"sched, cgroup: replace signal_struct->group_rwsem with a global percpu_rwsem\n\nThe cgroup side of threadgroup locking uses signal_struct->group_rwsem\nto synchronize against threadgroup changes.  This per-process rwsem\nadds small overhead to thread creation, exit and exec paths, forces\ncgroup code paths to do lock-verify-unlock-retry dance in a couple\nplaces and makes it impossible to atomically perform operations across\nmultiple processes.\n\nThis patch replaces signal_struct->group_rwsem with a global\npercpu_rwsem cgroup_threadgroup_rwsem which is cheaper on the reader\nside and contained in cgroups proper.  This patch converts one-to-one.\n\nThis does make writer side heavier and lower the granularity; however,\ncgroup process migration is a fairly cold path, we do want to optimize\nthread operations over it and cgroup migration operations don't take\nenough time for the lower granularity to matter.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>\nCc: Ingo Molnar <mingo@redhat.com>\nCc: Peter Zijlstra <peterz@infradead.org>","distinct":true,"url":"https://api.github.com/repos/cyphar/linux/commits/d59cfc09c32a2ae31f1c3bc2983a0cd79afb3f14"},{"sha":"b5ba75b5fc0e8404e2c50cb68f39bb6a53fc916f","author":{"email":"546b05909706652891a87f7bfe385ae147f61f91@kernel.org","name":"Tejun Heo"},"message":"cgroup: simplify threadgroup locking\n\nNow that threadgroup locking is made global, code paths around it can\nbe simplified.\n\n* lock-verify-unlock-retry dancing removed from __cgroup_procs_write().\n\n* Race protection against de_thread() removed from\n  cgroup_update_dfl_csses().\n\nSigned-off-by: Tejun Heo <tj@kernel.org>","distinct":true,"url":"https://api.github.com/repos/cyphar/linux/commits/b5ba75b5fc0e8404e2c50cb68f39bb6a53fc916f"},{"sha":"c80ef9e0c021ff86771fdd72583c75d8f7b6a720","author":{"email":"f2c659f01951776204a6c5b902787d9019fbeebd@arndb.de","name":"Arnd Bergmann"},"message":"cgroup: add seq_file forward declaration for struct cftype\n\nRecent header file changes for cgroup caused lots of warnings\nabout a missing struct seq_file form declaration for every\ninclusion of include/linux/cgroup-defs.h.\n\nAs some files are built with -Werror, this leads to build\nfailure like:\n\n                 from /git/arm-soc/drivers/gpu/drm/tilcdc/tilcdc_crtc.c:18:\n/git/arm-soc/include/linux/cgroup-defs.h:354:25: error: 'struct seq_file' declared inside parameter list [-Werror]\ncc1: all warnings being treated as errors\nmake[6]: *** [drivers/gpu/drm/tilcdc/tilcdc_crtc.o] Error 1\n\nThis patch adds the declaration, which resolves both the\nwarnings and the drm failure.\n\ntj: Moved it where other type declarations are.\n\nSigned-off-by: Arnd Bergmann <arnd@arndb.de>\nFixes: b4a04ab7a37b (\"cgroup: separate out include/linux/cgroup-defs.h\")\nSigned-off-by: Tejun Heo <tj@kernel.org>","distinct":true,"url":"https://api.github.com/repos/cyphar/linux/commits/c80ef9e0c021ff86771fdd72583c75d8f7b6a720"},{"sha":"cb4a316752709be4a644f070440a8be470d92b7d","author":{"email":"b305c9b0212d6145eea67bbffd24e29cb79c759c@cyphar.com","name":"Aleksa Sarai"},"message":"cgroup: use bitmask to filter for_each_subsys\n\nAdd a new macro for_each_subsys_which that allows all enabled cgroup\nsubsystems to be filtered by a bitmask, such that mask & (1 << ssid)\ndetermines if the subsystem is to be processed in the loop body (where\nssid is the unique id of the subsystem).\n\nAlso replace the need_forkexit_callback with two separate bitmasks for\neach callback to make (ss->{fork,exit}) checks unnecessary.\n\ntj: add a short comment for \"if (!CGROUP_SUBSYS_COUNT)\".\n\nSigned-off-by: Aleksa Sarai <cyphar@cyphar.com>","distinct":true,"url":"https://api.github.com/repos/cyphar/linux/commits/cb4a316752709be4a644f070440a8be470d92b7d"},{"sha":"a966a4edf8d557a37446393439cd0db6612d4db8","author":{"email":"b305c9b0212d6145eea67bbffd24e29cb79c759c@cyphar.com","name":"Aleksa Sarai"},"message":"cgroup: replace explicit ss_mask checking with for_each_subsys_which\n\nReplace the explicit checking against ss_masks inside a for_each_subsys\nblock with for_each_subsys_which(..., ss_mask), to take advantage of the\nmore readable (and more efficient) macro.\n\nSigned-off-by: Aleksa Sarai <cyphar@cyphar.com>","distinct":true,"url":"https://api.github.com/repos/cyphar/linux/commits/a966a4edf8d557a37446393439cd0db6612d4db8"},{"sha":"f57b72df937e3b9f854820cb8bb4acf512afc05c","author":{"email":"b305c9b0212d6145eea67bbffd24e29cb79c759c@cyphar.com","name":"Aleksa Sarai"},"message":"cgroup: fix uninitialised iterator in for_each_subsys_which\n\nFix the fact that @ssid is uninitialised in the case where\nCGROUP_SUBSYS_COUNT = 0 by setting ssid to 0.\n\nFixes: cb4a31675270 (\"cgroup: use bitmask to filter for_each_subsys\")\nSigned-off-by: Aleksa Sarai <cyphar@cyphar.com>","distinct":true,"url":"https://api.github.com/repos/cyphar/linux/commits/f57b72df937e3b9f854820cb8bb4acf512afc05c"},{"sha":"472065e24023306062efcab699144abaf575535d","author":{"email":"546b05909706652891a87f7bfe385ae147f61f91@kernel.org","name":"Tejun Heo"},"message":"cgroup, block: implement task_get_css()\n\nImplement task_get_css() which find and pins the css for the specified\ntask and subsys.  As a task is always associated with an online css\nfor every subsystem except while the css_set update is propagating,\ntask_get_css() retries till css_tryget_online() succeeds.\n\nSigned-off-by: Tejun Heo <tj@kernel.org>\nCc: Li Zefan <lizefan@huawei.com>","distinct":true,"url":"https://api.github.com/repos/cyphar/linux/commits/472065e24023306062efcab699144abaf575535d"},{"sha":"0278023c33a8ac05109f25acbe538d224eefd340","author":{"email":"b305c9b0212d6145eea67bbffd24e29cb79c759c@cyphar.com","name":"Aleksa Sarai"},"message":"cgroup: allow a cgroup subsystem to reject a fork\n\nAdd a new cgroup subsystem callback can_fork that conditionally\nstates whether or not the fork is accepted or rejected by a cgroup\npolicy. In addition, add a cancel_fork callback so that if an error\noccurs later in the forking process, any state modified by can_fork can\nbe reverted.\n\nAllow for a private opaque pointer to be passed from cgroup_can_fork to\ncgroup_post_fork, allowing for the fork state to be stored by each\nsubsystem separately.\n\nAlso add a tagging system for cgroup_subsys.h to allow for CGROUP_<TAG>\nenumerations to be be defined and used. In addition, explicitly add a\nCGROUP_CANFORK_COUNT macro to make arrays easier to define.\n\nThis is in preparation for implementing the pids cgroup subsystem.\n\nSigned-off-by: Aleksa Sarai <cyphar@cyphar.com>","distinct":true,"url":"https://api.github.com/repos/cyphar/linux/commits/0278023c33a8ac05109f25acbe538d224eefd340"},{"sha":"0c71f5df1ec1e77634d2cd7907a6e8417a8fcf58","author":{"email":"b305c9b0212d6145eea67bbffd24e29cb79c759c@cyphar.com","name":"Aleksa Sarai"},"message":"cgroup: implement the PIDs subsystem\n\nAdds a new single-purpose PIDs subsystem to limit the number of\ntasks that can be forked inside a cgroup. Essentially this is an\nimplementation of RLIMIT_NPROC that applies to a cgroup rather than a\nprocess tree.\n\nHowever, it should be noted that organisational operations (adding and\nremoving tasks from a PIDs hierarchy) will *not* be prevented. Rather,\nthe number of tasks in the hierarchy cannot exceed the limit through\nforking. This is due to the fact that, in the unified hierarchy, attach\ncannot fail (and it is not possible for a task to overcome its PIDs\ncgroup policy limit by attaching to a child cgroup -- even if migrating\nmid-fork it must be able to fork in the parent first).\n\nPIDs are fundamentally a global resource, and it is possible to reach\nPID exhaustion inside a cgroup without hitting any reasonable kmemcg\npolicy. Once you've hit PID exhaustion, you're only in a marginally\nbetter state than OOM. This subsystem allows PID exhaustion inside a\ncgroup to be prevented.\n\nSigned-off-by: Aleksa Sarai <cyphar@cyphar.com>","distinct":true,"url":"https://api.github.com/repos/cyphar/linux/commits/0c71f5df1ec1e77634d2cd7907a6e8417a8fcf58"}]}