<feed xmlns='http://www.w3.org/2005/Atom'>
<title>xavi/android_kernel_m2note/kernel/cgroup.c, branch o-8.1</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<id>https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=o-8.1</id>
<link rel='self' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/atom?h=o-8.1'/>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/'/>
<updated>2017-09-30T13:28:00+00:00</updated>
<entry>
<title>CHROMIUM: remove Android's cgroup generic permissions checks</title>
<updated>2017-09-30T13:28:00+00:00</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dtor@chromium.org</email>
</author>
<published>2016-10-06T22:53:38+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=53613cf7af01222e5d462d71e26bdd5d570c712e'/>
<id>urn:sha1:53613cf7af01222e5d462d71e26bdd5d570c712e</id>
<content type='text'>
The implementation is utterly broken, resulting in all processes being
allows to move tasks between sets (as long as they have access to the
"tasks" attribute), and upstream is heading towards checking only
capability anyway, so let's get rid of this code.

BUG=b:31790445,chromium:647994
TEST=Boot android container, examine logcat

Change-Id: I2f780a5992c34e52a8f2d0b3557fc9d490da2779
Signed-off-by: Dmitry Torokhov &lt;dtor@chromium.org&gt;
Reviewed-on: https://chromium-review.googlesource.com/394967
Reviewed-by: Ricky Zhou &lt;rickyz@chromium.org&gt;
Reviewed-by: John Stultz &lt;john.stultz@linaro.org&gt;
(cherry picked from commit 6895149f8bf0719aa70487e285fa6a8ad3d2692d)
Reviewed-on: https://chromium-review.googlesource.com/399858
Reviewed-by: Guenter Roeck &lt;groeck@chromium.org&gt;
Signed-off-by: Mister Oyster &lt;oysterized@gmail.com&gt;
</content>
</entry>
<entry>
<title>cgroup: prefer %pK to %p</title>
<updated>2016-11-17T11:20:03+00:00</updated>
<author>
<name>Nick Desaulniers</name>
<email>ndesaulniers@google.com</email>
</author>
<published>2016-09-13T18:11:03+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=2c81b0d8b41b0fbeb974589eec5ed76d405106e0'/>
<id>urn:sha1:2c81b0d8b41b0fbeb974589eec5ed76d405106e0</id>
<content type='text'>
Prevents leaking kernel pointers when using kptr_restrict.

Bug: 30149174
Change-Id: I76d4132a0f47f4b0a9f042b8269e0f24edd111ed
</content>
</entry>
<entry>
<title>cgroup: make serial_nr_cursor available throughout cgroup.c</title>
<updated>2016-09-18T10:46:49+00:00</updated>
<author>
<name>Li Zefan</name>
<email>lizefan@huawei.com</email>
</author>
<published>2013-06-18T10:53:53+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=7302954c7277765ef5f72035fb0d36c8b93854b5'/>
<id>urn:sha1:7302954c7277765ef5f72035fb0d36c8b93854b5</id>
<content type='text'>
The next patch will use it to determine if a cgroup is newly created
while we're iterating the cgroup hierarchy.

tj: Rephrased the comment on top of cgroup_serial_nr_cursor.

Signed-off-by: Li Zefan &lt;lizefan@huawei.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>cgroup: fix memory leak in cgroup_rm_cftypes()</title>
<updated>2016-09-18T10:46:48+00:00</updated>
<author>
<name>Li Zefan</name>
<email>lizefan@huawei.com</email>
</author>
<published>2013-06-18T10:41:53+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=88a6363d64d0e972555d2bd619d9c79468cf788c'/>
<id>urn:sha1:88a6363d64d0e972555d2bd619d9c79468cf788c</id>
<content type='text'>
The memory allocated in cgroup_add_cftypes() should be freed. The
effect of this bug is we leak a bit memory everytime we unload
cfq-iosched module if blkio cgroup is enabled.

Signed-off-by: Li Zefan &lt;lizefan@huawei.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>cgroup: add cgroup-&gt;serial_nr and implement cgroup_next_sibling()</title>
<updated>2016-09-18T10:46:47+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2013-05-24T01:55:38+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=b784dfa9908a3e4c2841852b0641c64841c25b83'/>
<id>urn:sha1:b784dfa9908a3e4c2841852b0641c64841c25b83</id>
<content type='text'>
Currently, there's no easy way to find out the next sibling cgroup
unless it's known that the current cgroup is accessed from the
parent's children list in a single RCU critical section.  This in turn
forces all iterators to require whole iteration to be enclosed in a
single RCU critical section, which sometimes is too restrictive.  This
patch implements cgroup_next_sibling() which can reliably determine
the next sibling regardless of the state of the current cgroup as long
as it's accessible.

It currently is impossible to determine the next sibling after
dropping RCU read lock because the cgroup being iterated could be
removed anytime and if RCU read lock is dropped, nothing guarantess
its -&gt;sibling.next pointer is accessible.  A removed cgroup would
continue to point to its next sibling for RCU accesses but stop
receiving updates from the sibling.  IOW, the next sibling could be
removed and then complete its grace period while RCU read lock is
dropped, making it unsafe to dereference -&gt;sibling.next after dropping
and re-acquiring RCU read lock.

This can be solved by adding a way to traverse to the next sibling
without dereferencing -&gt;sibling.next.  This patch adds a monotonically
increasing cgroup serial number, cgroup-&gt;serial_nr, which guarantees
that all cgroup-&gt;children lists are kept in increasing serial_nr
order.  A new function, cgroup_next_sibling(), is implemented, which,
if CGRP_REMOVED is not set on the current cgroup, follows
-&gt;sibling.next; otherwise, traverses the parent's -&gt;children list
until it sees a sibling with higher -&gt;serial_nr.

This allows the function to always return the next sibling regardless
of the state of the current cgroup without adding overhead in the fast
path.

Further patches will update the iterators to use cgroup_next_sibling()
so that they allow dropping RCU read lock and blocking while iteration
is in progress which in turn will be used to simplify controllers.

v2: Typo fix as per Serge.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Serge E. Hallyn &lt;serge.hallyn@ubuntu.com&gt;
</content>
</entry>
<entry>
<title>cgroup: make cgroup_is_removed() static</title>
<updated>2016-09-18T10:46:46+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2013-05-24T01:55:38+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=c4d83de0a6d212a57ef1763a7a0f948b09f1b8c5'/>
<id>urn:sha1:c4d83de0a6d212a57ef1763a7a0f948b09f1b8c5</id>
<content type='text'>
cgroup_is_removed() no longer has external users and it shouldn't grow
any - controllers should deal with cgroup_subsys_state on/offline
state instead of cgroup removal state.  Make it static.

While at it, make it return bool.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>cgroup: implement task_cgroup_path_from_hierarchy()</title>
<updated>2016-09-18T10:46:45+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2013-04-15T03:50:08+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=cf9e2e4d06188bd730796988249f4eef46da6fa7'/>
<id>urn:sha1:cf9e2e4d06188bd730796988249f4eef46da6fa7</id>
<content type='text'>
kdbus folks want a sane way to determine the cgroup path that a given
task belongs to on a given hierarchy, which is a reasonble thing to
expect from cgroup core.

Implement task_cgroup_path_from_hierarchy().

v2: Dropped unnecessary NULL check on the return value of
    task_cgroup_from_root() as suggested by Li Zefan.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Greg Kroah-Hartman &lt;greg@kroah.com&gt;
Acked-by: Li Zefan &lt;lizefan@huawei.com&gt;
Cc: Kay Sievers &lt;kay@vrfy.org&gt;
Cc: Lennart Poettering &lt;lennart@poettering.net&gt;
Cc: Daniel Mack &lt;daniel@zonque.org&gt;
</content>
</entry>
<entry>
<title>cgroup: make hierarchy_id use cyclic idr</title>
<updated>2016-09-18T10:46:44+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2013-04-14T18:36:58+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=8c6846e6ed1d240c9b91f2339af802dc58edf1f7'/>
<id>urn:sha1:8c6846e6ed1d240c9b91f2339af802dc58edf1f7</id>
<content type='text'>
We want to be able to lookup a hierarchy from its id and cyclic
allocation is a whole lot simpler with idr.  Convert to idr and use
idr_alloc_cyclc().

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Li Zefan &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>cgroup: drop hierarchy_id_lock</title>
<updated>2016-09-18T10:46:44+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2013-04-14T18:36:57+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=e706e435949fc7bfa2e38dedf04690154afd615b'/>
<id>urn:sha1:e706e435949fc7bfa2e38dedf04690154afd615b</id>
<content type='text'>
Now that hierarchy_id alloc / free are protected by the cgroup
mutexes, there's no need for this separate lock.  Drop it.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Li Zefan &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>cgroup: refactor hierarchy_id handling</title>
<updated>2016-09-18T10:46:43+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2013-04-14T18:36:56+00:00</published>
<link rel='alternate' type='text/html' href='https://gitea.privatedns.org/xavi/android_kernel_m2note/commit/?id=c928c80d2f7378e6f9050a26f809da9b26519394'/>
<id>urn:sha1:c928c80d2f7378e6f9050a26f809da9b26519394</id>
<content type='text'>
We're planning to converting hierarchy_ida to an idr and use it to
look up hierarchy from its id.  As we want the mapping to happen
atomically with cgroupfs_root registration, this patch refactors
hierarchy_id init / exit so that ida operations happen inside
cgroup_[root_]mutex.

* s/init_root_id()/cgroup_init_root_id()/ and make it return 0 or
  -errno like a normal function.

* Move hierarchy_id initialization from cgroup_root_from_opts() into
  cgroup_mount() block where the root is confirmed to be used and
  being registered while holding both mutexes.

* Split cgroup_drop_id() into cgroup_exit_root_id() and
  cgroup_free_root(), so that ID release can happen before dropping
  the mutexes in cgroup_kill_sb().  The latter expects hierarchy_id to
  be exited before being invoked.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Li Zefan &lt;lizefan@huawei.com&gt;
</content>
</entry>
</feed>
