<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/block/blk-cgroup.c, branch v3.6.10</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>blkcg: Fix use-after-free of q-&gt;root_blkg and q-&gt;root_rl.blkg</title>
<updated>2012-11-05T08:56:48+00:00</updated>
<author>
<name>Jun'ichi Nomura</name>
<email>j-nomura@ce.jp.nec.com</email>
</author>
<published>2012-10-17T08:45:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=edf5181e0804d4d484b11b4d4e8150a80a39908b'/>
<id>edf5181e0804d4d484b11b4d4e8150a80a39908b</id>
<content type='text'>
commit 65635cbc37e011e71b208257a25e7c1078cd039b upstream.

blk_put_rl() does not call blkg_put() for q-&gt;root_rl because we
don't take request list reference on q-&gt;root_blkg.
However, if root_blkg is once attached then detached (freed),
blk_put_rl() is confused by the bogus pointer in q-&gt;root_blkg.

For example, with !CONFIG_BLK_DEV_THROTTLING &amp;&amp;
CONFIG_CFQ_GROUP_IOSCHED,
switching IO scheduler from cfq to deadline will cause system stall
after the following warning with 3.6:

&gt; WARNING: at /work/build/linux/block/blk-cgroup.h:250
&gt; blk_put_rl+0x4d/0x95()
&gt; Modules linked in: bridge stp llc sunrpc acpi_cpufreq freq_table mperf
&gt; ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4
&gt; Pid: 0, comm: swapper/0 Not tainted 3.6.0 #1
&gt; Call Trace:
&gt;  &lt;IRQ&gt;  [&lt;ffffffff810453bd&gt;] warn_slowpath_common+0x85/0x9d
&gt;  [&lt;ffffffff810453ef&gt;] warn_slowpath_null+0x1a/0x1c
&gt;  [&lt;ffffffff811d5f8d&gt;] blk_put_rl+0x4d/0x95
&gt;  [&lt;ffffffff811d614a&gt;] __blk_put_request+0xc3/0xcb
&gt;  [&lt;ffffffff811d71a3&gt;] blk_finish_request+0x232/0x23f
&gt;  [&lt;ffffffff811d76c3&gt;] ? blk_end_bidi_request+0x34/0x5d
&gt;  [&lt;ffffffff811d76d1&gt;] blk_end_bidi_request+0x42/0x5d
&gt;  [&lt;ffffffff811d7728&gt;] blk_end_request+0x10/0x12
&gt;  [&lt;ffffffff812cdf16&gt;] scsi_io_completion+0x207/0x4d5
&gt;  [&lt;ffffffff812c6fcf&gt;] scsi_finish_command+0xfa/0x103
&gt;  [&lt;ffffffff812ce2f8&gt;] scsi_softirq_done+0xff/0x108
&gt;  [&lt;ffffffff811dcea5&gt;] blk_done_softirq+0x8d/0xa1
&gt;  [&lt;ffffffff810915d5&gt;] ?
&gt;  generic_smp_call_function_single_interrupt+0x9f/0xd7
&gt;  [&lt;ffffffff8104cf5b&gt;] __do_softirq+0x102/0x213
&gt;  [&lt;ffffffff8108a5ec&gt;] ? lock_release_holdtime+0xb6/0xbb
&gt;  [&lt;ffffffff8104d2b4&gt;] ? raise_softirq_irqoff+0x9/0x3d
&gt;  [&lt;ffffffff81424dfc&gt;] call_softirq+0x1c/0x30
&gt;  [&lt;ffffffff81011beb&gt;] do_softirq+0x4b/0xa3
&gt;  [&lt;ffffffff8104cdb0&gt;] irq_exit+0x53/0xd5
&gt;  [&lt;ffffffff8102d865&gt;] smp_call_function_single_interrupt+0x34/0x36
&gt;  [&lt;ffffffff8142486f&gt;] call_function_single_interrupt+0x6f/0x80
&gt;  &lt;EOI&gt;  [&lt;ffffffff8101800b&gt;] ? mwait_idle+0x94/0xcd
&gt;  [&lt;ffffffff81018002&gt;] ? mwait_idle+0x8b/0xcd
&gt;  [&lt;ffffffff81017811&gt;] cpu_idle+0xbb/0x114
&gt;  [&lt;ffffffff81401fbd&gt;] rest_init+0xc1/0xc8
&gt;  [&lt;ffffffff81401efc&gt;] ? csum_partial_copy_generic+0x16c/0x16c
&gt;  [&lt;ffffffff81cdbd3d&gt;] start_kernel+0x3d4/0x3e1
&gt;  [&lt;ffffffff81cdb79e&gt;] ? kernel_init+0x1f7/0x1f7
&gt;  [&lt;ffffffff81cdb2dd&gt;] x86_64_start_reservations+0xb8/0xbd
&gt;  [&lt;ffffffff81cdb3e3&gt;] x86_64_start_kernel+0x101/0x110

This patch clears q-&gt;root_blkg and q-&gt;root_rl.blkg when root blkg
is destroyed.

Signed-off-by: Jun'ichi Nomura &lt;j-nomura@ce.jp.nec.com&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 65635cbc37e011e71b208257a25e7c1078cd039b upstream.

blk_put_rl() does not call blkg_put() for q-&gt;root_rl because we
don't take request list reference on q-&gt;root_blkg.
However, if root_blkg is once attached then detached (freed),
blk_put_rl() is confused by the bogus pointer in q-&gt;root_blkg.

For example, with !CONFIG_BLK_DEV_THROTTLING &amp;&amp;
CONFIG_CFQ_GROUP_IOSCHED,
switching IO scheduler from cfq to deadline will cause system stall
after the following warning with 3.6:

&gt; WARNING: at /work/build/linux/block/blk-cgroup.h:250
&gt; blk_put_rl+0x4d/0x95()
&gt; Modules linked in: bridge stp llc sunrpc acpi_cpufreq freq_table mperf
&gt; ipt_REJECT nf_conntrack_ipv4 nf_defrag_ipv4
&gt; Pid: 0, comm: swapper/0 Not tainted 3.6.0 #1
&gt; Call Trace:
&gt;  &lt;IRQ&gt;  [&lt;ffffffff810453bd&gt;] warn_slowpath_common+0x85/0x9d
&gt;  [&lt;ffffffff810453ef&gt;] warn_slowpath_null+0x1a/0x1c
&gt;  [&lt;ffffffff811d5f8d&gt;] blk_put_rl+0x4d/0x95
&gt;  [&lt;ffffffff811d614a&gt;] __blk_put_request+0xc3/0xcb
&gt;  [&lt;ffffffff811d71a3&gt;] blk_finish_request+0x232/0x23f
&gt;  [&lt;ffffffff811d76c3&gt;] ? blk_end_bidi_request+0x34/0x5d
&gt;  [&lt;ffffffff811d76d1&gt;] blk_end_bidi_request+0x42/0x5d
&gt;  [&lt;ffffffff811d7728&gt;] blk_end_request+0x10/0x12
&gt;  [&lt;ffffffff812cdf16&gt;] scsi_io_completion+0x207/0x4d5
&gt;  [&lt;ffffffff812c6fcf&gt;] scsi_finish_command+0xfa/0x103
&gt;  [&lt;ffffffff812ce2f8&gt;] scsi_softirq_done+0xff/0x108
&gt;  [&lt;ffffffff811dcea5&gt;] blk_done_softirq+0x8d/0xa1
&gt;  [&lt;ffffffff810915d5&gt;] ?
&gt;  generic_smp_call_function_single_interrupt+0x9f/0xd7
&gt;  [&lt;ffffffff8104cf5b&gt;] __do_softirq+0x102/0x213
&gt;  [&lt;ffffffff8108a5ec&gt;] ? lock_release_holdtime+0xb6/0xbb
&gt;  [&lt;ffffffff8104d2b4&gt;] ? raise_softirq_irqoff+0x9/0x3d
&gt;  [&lt;ffffffff81424dfc&gt;] call_softirq+0x1c/0x30
&gt;  [&lt;ffffffff81011beb&gt;] do_softirq+0x4b/0xa3
&gt;  [&lt;ffffffff8104cdb0&gt;] irq_exit+0x53/0xd5
&gt;  [&lt;ffffffff8102d865&gt;] smp_call_function_single_interrupt+0x34/0x36
&gt;  [&lt;ffffffff8142486f&gt;] call_function_single_interrupt+0x6f/0x80
&gt;  &lt;EOI&gt;  [&lt;ffffffff8101800b&gt;] ? mwait_idle+0x94/0xcd
&gt;  [&lt;ffffffff81018002&gt;] ? mwait_idle+0x8b/0xcd
&gt;  [&lt;ffffffff81017811&gt;] cpu_idle+0xbb/0x114
&gt;  [&lt;ffffffff81401fbd&gt;] rest_init+0xc1/0xc8
&gt;  [&lt;ffffffff81401efc&gt;] ? csum_partial_copy_generic+0x16c/0x16c
&gt;  [&lt;ffffffff81cdbd3d&gt;] start_kernel+0x3d4/0x3e1
&gt;  [&lt;ffffffff81cdb79e&gt;] ? kernel_init+0x1f7/0x1f7
&gt;  [&lt;ffffffff81cdb2dd&gt;] x86_64_start_reservations+0xb8/0xbd
&gt;  [&lt;ffffffff81cdb3e3&gt;] x86_64_start_kernel+0x101/0x110

This patch clears q-&gt;root_blkg and q-&gt;root_rl.blkg when root blkg
is destroyed.

Signed-off-by: Jun'ichi Nomura &lt;j-nomura@ce.jp.nec.com&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>blkcg: implement per-blkg request allocation</title>
<updated>2012-06-26T22:42:49+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-06-26T22:05:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a051661ca6d134c18599498b185b667859d4339b'/>
<id>a051661ca6d134c18599498b185b667859d4339b</id>
<content type='text'>
Currently, request_queue has one request_list to allocate requests
from regardless of blkcg of the IO being issued.  When the unified
request pool is used up, cfq proportional IO limits become meaningless
- whoever grabs the next request being freed wins the race regardless
of the configured weights.

This can be easily demonstrated by creating a blkio cgroup w/ very low
weight, put a program which can issue a lot of random direct IOs there
and running a sequential IO from a different cgroup.  As soon as the
request pool is used up, the sequential IO bandwidth crashes.

This patch implements per-blkg request_list.  Each blkg has its own
request_list and any IO allocates its request from the matching blkg
making blkcgs completely isolated in terms of request allocation.

* Root blkcg uses the request_list embedded in each request_queue,
  which was renamed to @q-&gt;root_rl from @q-&gt;rq.  While making blkcg rl
  handling a bit harier, this enables avoiding most overhead for root
  blkcg.

* Queue fullness is properly per request_list but bdi isn't blkcg
  aware yet, so congestion state currently just follows the root
  blkcg.  As writeback isn't aware of blkcg yet, this works okay for
  async congestion but readahead may get the wrong signals.  It's
  better than blkcg completely collapsing with shared request_list but
  needs to be improved with future changes.

* After this change, each block cgroup gets a full request pool making
  resource consumption of each cgroup higher.  This makes allowing
  non-root users to create cgroups less desirable; however, note that
  allowing non-root users to directly manage cgroups is already
  severely broken regardless of this patch - each block cgroup
  consumes kernel memory and skews IO weight (IO weights are not
  hierarchical).

v2: queue-sysfs.txt updated and patch description udpated as suggested
    by Vivek.

v3: blk_get_rl() wasn't checking error return from
    blkg_lookup_create() and may cause oops on lookup failure.  Fix it
    by falling back to root_rl on blkg lookup failures.  This problem
    was spotted by Rakesh Iyer &lt;rni@google.com&gt;.

v4: Updated to accomodate 458f27a982 "block: Avoid missed wakeup in
    request waitqueue".  blk_drain_queue() now wakes up waiters on all
    blkg-&gt;rl on the target queue.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Cc: Wu Fengguang &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, request_queue has one request_list to allocate requests
from regardless of blkcg of the IO being issued.  When the unified
request pool is used up, cfq proportional IO limits become meaningless
- whoever grabs the next request being freed wins the race regardless
of the configured weights.

This can be easily demonstrated by creating a blkio cgroup w/ very low
weight, put a program which can issue a lot of random direct IOs there
and running a sequential IO from a different cgroup.  As soon as the
request pool is used up, the sequential IO bandwidth crashes.

This patch implements per-blkg request_list.  Each blkg has its own
request_list and any IO allocates its request from the matching blkg
making blkcgs completely isolated in terms of request allocation.

* Root blkcg uses the request_list embedded in each request_queue,
  which was renamed to @q-&gt;root_rl from @q-&gt;rq.  While making blkcg rl
  handling a bit harier, this enables avoiding most overhead for root
  blkcg.

* Queue fullness is properly per request_list but bdi isn't blkcg
  aware yet, so congestion state currently just follows the root
  blkcg.  As writeback isn't aware of blkcg yet, this works okay for
  async congestion but readahead may get the wrong signals.  It's
  better than blkcg completely collapsing with shared request_list but
  needs to be improved with future changes.

* After this change, each block cgroup gets a full request pool making
  resource consumption of each cgroup higher.  This makes allowing
  non-root users to create cgroups less desirable; however, note that
  allowing non-root users to directly manage cgroups is already
  severely broken regardless of this patch - each block cgroup
  consumes kernel memory and skews IO weight (IO weights are not
  hierarchical).

v2: queue-sysfs.txt updated and patch description udpated as suggested
    by Vivek.

v3: blk_get_rl() wasn't checking error return from
    blkg_lookup_create() and may cause oops on lookup failure.  Fix it
    by falling back to root_rl on blkg lookup failures.  This problem
    was spotted by Rakesh Iyer &lt;rni@google.com&gt;.

v4: Updated to accomodate 458f27a982 "block: Avoid missed wakeup in
    request waitqueue".  blk_drain_queue() now wakes up waiters on all
    blkg-&gt;rl on the target queue.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Cc: Wu Fengguang &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>blkcg: inline bio_blkcg() and friends</title>
<updated>2012-06-25T09:53:50+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-06-05T03:40:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b1208b56f31408f7d8381ff5d08e970aa5ee761c'/>
<id>b1208b56f31408f7d8381ff5d08e970aa5ee761c</id>
<content type='text'>
Make bio_blkcg() and friends inline.  They all are very simple and
used only in few places.

This patch is to prepare for further updates to request allocation
path.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make bio_blkcg() and friends inline.  They all are very simple and
used only in few places.

This patch is to prepare for further updates to request allocation
path.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>blkcg: make root blkcg allocation use %GFP_KERNEL</title>
<updated>2012-06-25T09:53:46+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-06-05T03:40:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=159749937a3e1605068a454b1607cdc5714f16e6'/>
<id>159749937a3e1605068a454b1607cdc5714f16e6</id>
<content type='text'>
Currently, blkcg_activate_policy() depends on %GFP_ATOMIC allocation
from __blkg_lookup_create() for root blkcg creation.  This could make
policy fail unnecessarily.

Make blkg_alloc() take @gfp_mask, __blkg_lookup_create() take an
optional @new_blkg for preallocated blkg, and blkcg_activate_policy()
preload radix tree and preallocate blkg with %GFP_KERNEL before trying
to create the root blkg.

v2: __blkg_lookup_create() was returning %NULL on blkg alloc failure
   instead of ERR_PTR() value.  Fixed.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, blkcg_activate_policy() depends on %GFP_ATOMIC allocation
from __blkg_lookup_create() for root blkcg creation.  This could make
policy fail unnecessarily.

Make blkg_alloc() take @gfp_mask, __blkg_lookup_create() take an
optional @new_blkg for preallocated blkg, and blkcg_activate_policy()
preload radix tree and preallocate blkg with %GFP_KERNEL before trying
to create the root blkg.

v2: __blkg_lookup_create() was returning %NULL on blkg alloc failure
   instead of ERR_PTR() value.  Fixed.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>blkcg: __blkg_lookup_create() doesn't need radix preload</title>
<updated>2012-06-25T09:53:45+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-06-05T03:40:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=13589864be74736ca4e6def7376742eb1d2099bf'/>
<id>13589864be74736ca4e6def7376742eb1d2099bf</id>
<content type='text'>
There's no point in calling radix_tree_preload() if preloading doesn't
use more permissible GFP mask.  Drop preloading from
__blkg_lookup_create().

While at it, drop sparse locking annotation which no longer applies.

v2: Vivek pointed out the odd preload usage.  Instead of updating,
    just drop it.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's no point in calling radix_tree_preload() if preloading doesn't
use more permissible GFP mask.  Drop preloading from
__blkg_lookup_create().

While at it, drop sparse locking annotation which no longer applies.

v2: Vivek pointed out the odd preload usage.  Instead of updating,
    just drop it.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>blkcg: drop local variable @q from blkg_destroy()</title>
<updated>2012-06-06T06:35:31+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-06-05T11:36:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=27e1f9d1cc87be4e53c6eb7158cafc21c4b85a14'/>
<id>27e1f9d1cc87be4e53c6eb7158cafc21c4b85a14</id>
<content type='text'>
blkg_destroy() caches @blkg-&gt;q in local variable @q.  While there are
two places which needs @blkg-&gt;q, only lockdep_assert_held() used the
local variable leading to unused local variable warning if lockdep is
configured out.  Drop the local variable and just use @blkg-&gt;q
directly.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Rakesh Iyer &lt;rni@google.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
blkg_destroy() caches @blkg-&gt;q in local variable @q.  While there are
two places which needs @blkg-&gt;q, only lockdep_assert_held() used the
local variable leading to unused local variable warning if lockdep is
configured out.  Drop the local variable and just use @blkg-&gt;q
directly.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Rakesh Iyer &lt;rni@google.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>blkcg: fix blkg_alloc() failure path</title>
<updated>2012-06-04T08:03:21+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-06-04T06:21:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9b2ea86bc9e940950a088e9795ab28f006e73276'/>
<id>9b2ea86bc9e940950a088e9795ab28f006e73276</id>
<content type='text'>
When policy data allocation fails in the middle, blkg_alloc() invokes
blkg_free() to destroy the half constructed blkg.  This ends up
calling pd_exit_fn() on policy datas which didn't go through
pd_init_fn().  Fix it by making blkg_alloc() call pd_init_fn()
immediately after each policy data allocation.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When policy data allocation fails in the middle, blkg_alloc() invokes
blkg_free() to destroy the half constructed blkg.  This ends up
calling pd_exit_fn() on policy datas which didn't go through
pd_init_fn().  Fix it by making blkg_alloc() call pd_init_fn()
immediately after each policy data allocation.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>blkcg: use radix tree to index blkgs from blkcg</title>
<updated>2012-04-20T08:06:40+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-04-19T23:29:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a637120e49021d197e9578cba545bbaa459cbb51'/>
<id>a637120e49021d197e9578cba545bbaa459cbb51</id>
<content type='text'>
blkg lookup is currently performed by traversing linked list anchored
at blkcg-&gt;blkg_list.  This is very unscalable and with blk-throttle
enabled and enough request queues on the system, this can get very
ugly quickly (blk-throttle performs look up on every bio submission).

This patch makes blkcg use radix tree to index blkgs combined with
simple last-looked-up hint.  This is mostly identical to how icqs are
indexed from ioc.

Note that because __blkg_lookup() may be invoked without holding queue
lock, hint is only updated from __blkg_lookup_create().  Due to cfq's
cfqq caching, this makes hint updates overly lazy.  This will be
improved with scheduled blkcg aware request allocation.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
blkg lookup is currently performed by traversing linked list anchored
at blkcg-&gt;blkg_list.  This is very unscalable and with blk-throttle
enabled and enough request queues on the system, this can get very
ugly quickly (blk-throttle performs look up on every bio submission).

This patch makes blkcg use radix tree to index blkgs combined with
simple last-looked-up hint.  This is mostly identical to how icqs are
indexed from ioc.

Note that because __blkg_lookup() may be invoked without holding queue
lock, hint is only updated from __blkg_lookup_create().  Due to cfq's
cfqq caching, this makes hint updates overly lazy.  This will be
improved with scheduled blkcg aware request allocation.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>blkcg: fix blkcg-&gt;css ref leak in __blkg_lookup_create()</title>
<updated>2012-04-20T08:06:40+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-04-19T23:29:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=496fb7806d616185a46865a4f3a20ef19dc6c7e3'/>
<id>496fb7806d616185a46865a4f3a20ef19dc6c7e3</id>
<content type='text'>
__blkg_lookup_create() leaked blkcg-&gt;css ref if blkg allocation
failed.  Fix it.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
__blkg_lookup_create() leaked blkcg-&gt;css ref if blkg allocation
failed.  Fix it.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>blkcg: collapse blkcg_policy_ops into blkcg_policy</title>
<updated>2012-04-20T08:06:17+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-04-16T20:57:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f9fcc2d3919b8eb575b3cee9274feefafb641bca'/>
<id>f9fcc2d3919b8eb575b3cee9274feefafb641bca</id>
<content type='text'>
There's no reason to keep blkcg_policy_ops separate.  Collapse it into
blkcg_policy.

This patch doesn't introduce any functional change.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There's no reason to keep blkcg_policy_ops separate.  Collapse it into
blkcg_policy.

This patch doesn't introduce any functional change.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
</feed>
