<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/cgroup.c, branch v4.0</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.0</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.0'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2015-02-14T05:21:36Z</updated>
<entry>
<title>kernfs: remove KERNFS_STATIC_NAME</title>
<updated>2015-02-14T05:21:36Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2015-02-13T22:36:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dfeb0750b630b72b5d4fb2461bc7179eceb54666'/>
<id>urn:sha1:dfeb0750b630b72b5d4fb2461bc7179eceb54666</id>
<content type='text'>
When a new kernfs node is created, KERNFS_STATIC_NAME is used to avoid
making a separate copy of its name.  It's currently only used for sysfs
attributes whose filenames are required to stay accessible and unchanged.
There are rare exceptions where these names are allocated and formatted
dynamically but for the vast majority of cases they're consts in the
rodata section.

Now that kernfs is converted to use kstrdup_const() and kfree_const(),
there's little point in keeping KERNFS_STATIC_NAME around.  Remove it.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Andrzej Hajda &lt;a.hajda@samsung.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>cgroup: release css-&gt;id after css_free</title>
<updated>2015-02-13T02:54:09Z</updated>
<author>
<name>Vladimir Davydov</name>
<email>vdavydov@parallels.com</email>
</author>
<published>2015-02-12T22:59:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=01e586598b224d1a427acd8a7afa0b21e879d3a7'/>
<id>urn:sha1:01e586598b224d1a427acd8a7afa0b21e879d3a7</id>
<content type='text'>
Currently, we release css-&gt;id in css_release_work_fn, right before calling
css_free callback, so that when css_free is called, the id may have
already been reused for a new cgroup.

I am going to use css-&gt;id to create unique names for per memcg kmem
caches.  Since kmem caches are destroyed only on css_free, I need css-&gt;id
to be freed after css_free was called to avoid name clashes.  This patch
therefore moves css-&gt;id removal to css_free_work_fn.  To prevent
css_from_id from returning a pointer to a stale css, it makes
css_release_work_fn replace the css ptr at css_idr:css-&gt;id with NULL.

Signed-off-by: Vladimir Davydov &lt;vdavydov@parallels.com&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: Michal Hocko &lt;mhocko@suse.cz&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Christoph Lameter &lt;cl@linux.com&gt;
Cc: Pekka Enberg &lt;penberg@kernel.org&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Joonsoo Kim &lt;iamjoonsoo.kim@lge.com&gt;
Cc: Dave Chinner &lt;david@fromorbit.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>cgroup: prevent mount hang due to memory controller lifetime</title>
<updated>2015-01-22T15:26:43Z</updated>
<author>
<name>Johannes Weiner</name>
<email>hannes@cmpxchg.org</email>
</author>
<published>2015-01-22T15:19:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3c606d35fe9766ede86a45273a628b320be13b45'/>
<id>urn:sha1:3c606d35fe9766ede86a45273a628b320be13b45</id>
<content type='text'>
Since b2052564e66d ("mm: memcontrol: continue cache reclaim from
offlined groups"), re-mounting the memory controller after using it is
very likely to hang.

The cgroup core assumes that any remaining references after deleting a
cgroup are temporary in nature, and synchroneously waits for them, but
the above-mentioned commit has left-over page cache pin its css until
it is reclaimed naturally.  That being said, swap entries and charged
kernel memory have been doing the same indefinite pinning forever, the
bug is just more likely to trigger with left-over page cache.

Reparenting kernel memory is highly impractical, which leaves changing
the cgroup assumptions to reflect this: once a controller has been
mounted and used, it has internal state that is independent from mount
and cgroup lifetime.  It can be unmounted and remounted, but it can't
be reconfigured during subsequent mounts.

Don't offline the controller root as long as there are any children,
dead or alive.  A remount will no longer wait for these old references
to drain, it will simply mount the persistent controller state again.

Reported-by: "Suzuki K. Poulose" &lt;Suzuki.Poulose@arm.com&gt;
Reported-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>cgroup: implement cgroup_get_e_css()</title>
<updated>2014-11-18T07:49:52Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-11-18T07:49:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eeecbd1971517103e06f11750dd1a9a1dc37e4e6'/>
<id>urn:sha1:eeecbd1971517103e06f11750dd1a9a1dc37e4e6</id>
<content type='text'>
Implement cgroup_get_e_css() which finds and gets the effective css
for the specified cgroup and subsystem combination.  This function
always returns a valid pinned css.  This will be used by cgroup
writeback support.

While at it, add comment to cgroup_e_css() to explain why that
function is different from cgroup_get_e_css() and has to test
cgrp-&gt;child_subsys_mask instead of cgroup_css(cgrp, ss).

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Zefan Li &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>cgroup: add cgroup_subsys-&gt;css_e_css_changed()</title>
<updated>2014-11-18T07:49:51Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-11-18T07:49:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=56c807ba4e91f0980567b6a69de239677879b17f'/>
<id>urn:sha1:56c807ba4e91f0980567b6a69de239677879b17f</id>
<content type='text'>
Add a new cgroup_subsys operatoin -&gt;css_e_css_changed().  This is
invoked if any of the effective csses seen from the css's cgroup may
have changed.  This will be used to implement cgroup writeback
support.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Zefan Li &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>cgroup: add cgroup_subsys-&gt;css_released()</title>
<updated>2014-11-18T07:49:51Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-11-18T07:49:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7d172cc89b8589e4173d0c73a1ddaae408f29c9d'/>
<id>urn:sha1:7d172cc89b8589e4173d0c73a1ddaae408f29c9d</id>
<content type='text'>
Add a new cgroup subsys callback css_released().  This is called when
the reference count of the css (cgroup_subsys_state) reaches zero
before RCU scheduling free.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Zefan Li &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>cgroup: fix the async css offline wait logic in cgroup_subtree_control_write()</title>
<updated>2014-11-18T07:49:51Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-11-18T07:49:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=db6e3053456800f0a7220b30355bece64764efe7'/>
<id>urn:sha1:db6e3053456800f0a7220b30355bece64764efe7</id>
<content type='text'>
When a subsystem is offlined, its entry on @cgrp-&gt;subsys[] is cleared
asynchronously.  If cgroup_subtree_control_write() is requested to
enable the subsystem again before the entry is cleared, it has to wait
for the previous offlining to finish and clear the @cgrp-&gt;subsys[]
entry before trying to enable the subsystem again.

This is currently done while verifying the input enable / disable
parameters.  This used to be correct but f63070d350e3 ("cgroup: make
interface files visible iff enabled on cgroup-&gt;subtree_control")
breaks it.  The commit is one of the commits implementing subsystem
dependency.

Through subsystem dependency, some subsystems may be enabled and
disabled implicitly in addition to the explicitly requested ones.  The
actual subsystems to be enabled and disabled are determined during
@css_enable/disable calculation.  The current offline wait logic skips
the ones which are already implicitly enabled and then waits for
subsystems in @enable; however, this misses the subsystems which may
be implicitly enabled through dependency from @enable.  If such
implicitly subsystem hasn't yet finished offlining yet, the function
ends up trying to create a css when its @cgrp-&gt;subsys[] slot is
already occupied triggering BUG_ON() in init_and_link_css().

Fix it by moving the wait logic after @css_enable is calculated and
waiting for all the subsystems in @css_enable.  This fixes the above
bug as the mask contains all subsystems which are to be enabled
including the ones enabled through dependencies.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Fixes: f63070d350e3 ("cgroup: make interface files visible iff enabled on cgroup-&gt;subtree_control")
Acked-by: Zefan Li &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>cgroup: restructure child_subsys_mask handling in cgroup_subtree_control_write()</title>
<updated>2014-11-18T07:49:50Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-11-18T07:49:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=755bf5ee8633b97d8fd0ffbb4221662056dda22b'/>
<id>urn:sha1:755bf5ee8633b97d8fd0ffbb4221662056dda22b</id>
<content type='text'>
Make cgroup_subtree_control_write() first calculate new
subtree_control (new_sc), child_subsys_mask (new_ss) and
css_enable/disable masks before applying them to the cgroup.  Also,
store the original subtree_control (old_sc) and child_subsys_mask
(old_ss) and use them to restore the orignal state after failure.

This patch shouldn't cause any behavior changes.  This prepares for a
fix for a bug in the async css offline wait logic.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Zefan Li &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>cgroup: separate out cgroup_calc_child_subsys_mask() from cgroup_refresh_child_subsys_mask()</title>
<updated>2014-11-18T07:49:50Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-11-18T07:49:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0f060deb5c5107486c5dadd5c715b3693d381e0a'/>
<id>urn:sha1:0f060deb5c5107486c5dadd5c715b3693d381e0a</id>
<content type='text'>
cgroup_refresh_child_subsys_mask() calculates and updates the
effective @cgrp-&gt;child_subsys_maks according to the current
@cgrp-&gt;subtree_control.  Separate out the calculation part into
cgroup_calc_child_subsys_mask().  This will be used to fix a bug in
the async css offline wait logic.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Zefan Li &lt;lizefan@huawei.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu</title>
<updated>2014-10-10T11:26:02Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-10-10T11:26:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c798360cd1438090d51eeaa8e67985da11362eba'/>
<id>urn:sha1:c798360cd1438090d51eeaa8e67985da11362eba</id>
<content type='text'>
Pull percpu updates from Tejun Heo:
 "A lot of activities on percpu front.  Notable changes are...

   - percpu allocator now can take @gfp.  If @gfp doesn't contain
     GFP_KERNEL, it tries to allocate from what's already available to
     the allocator and a work item tries to keep the reserve around
     certain level so that these atomic allocations usually succeed.

     This will replace the ad-hoc percpu memory pool used by
     blk-throttle and also be used by the planned blkcg support for
     writeback IOs.

     Please note that I noticed a bug in how @gfp is interpreted while
     preparing this pull request and applied the fix 6ae833c7fe0c
     ("percpu: fix how @gfp is interpreted by the percpu allocator")
     just now.

   - percpu_ref now uses longs for percpu and global counters instead of
     ints.  It leads to more sparse packing of the percpu counters on
     64bit machines but the overhead should be negligible and this
     allows using percpu_ref for refcnting pages and in-memory objects
     directly.

   - The switching between percpu and single counter modes of a
     percpu_ref is made independent of putting the base ref and a
     percpu_ref can now optionally be initialized in single or killed
     mode.  This allows avoiding percpu shutdown latency for cases where
     the refcounted objects may be synchronously created and destroyed
     in rapid succession with only a fraction of them reaching fully
     operational status (SCSI probing does this when combined with
     blk-mq support).  It's also planned to be used to implement forced
     single mode to detect underflow more timely for debugging.

  There's a separate branch percpu/for-3.18-consistent-ops which cleans
  up the duplicate percpu accessors.  That branch causes a number of
  conflicts with s390 and other trees.  I'll send a separate pull
  request w/ resolutions once other branches are merged"

* 'for-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (33 commits)
  percpu: fix how @gfp is interpreted by the percpu allocator
  blk-mq, percpu_ref: start q-&gt;mq_usage_counter in atomic mode
  percpu_ref: make INIT_ATOMIC and switch_to_atomic() sticky
  percpu_ref: add PERCPU_REF_INIT_* flags
  percpu_ref: decouple switching to percpu mode and reinit
  percpu_ref: decouple switching to atomic mode and killing
  percpu_ref: add PCPU_REF_DEAD
  percpu_ref: rename things to prepare for decoupling percpu/atomic mode switch
  percpu_ref: replace pcpu_ prefix with percpu_
  percpu_ref: minor code and comment updates
  percpu_ref: relocate percpu_ref_reinit()
  Revert "blk-mq, percpu_ref: implement a kludge for SCSI blk-mq stall during probe"
  Revert "percpu: free percpu allocation info for uniprocessor system"
  percpu-refcount: make percpu_ref based on longs instead of ints
  percpu-refcount: improve WARN messages
  percpu: fix locking regression in the failure path of pcpu_alloc()
  percpu-refcount: add @gfp to percpu_ref_init()
  proportions: add @gfp to init functions
  percpu_counter: add @gfp to percpu_counter_init()
  percpu_counter: make percpu_counters_lock irq-safe
  ...
</content>
</entry>
</feed>
