<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/block, branch v3.3-rc4</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>block: fix lockdep warning on io_context release put_io_context()</title>
<updated>2012-02-11T11:37:25+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-02-11T11:37:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d8c66c5d59247e25a69428aced0b79d33b9c66d6'/>
<id>d8c66c5d59247e25a69428aced0b79d33b9c66d6</id>
<content type='text'>
11a3122f6c "block: strip out locking optimization in put_io_context()"
removed ioc_lock depth lockdep annoation along with locking
optimization; however, while recursing from put_io_context() is no
longer possible, ioc_release_fn() may still end up putting the last
reference of another ioc through elevator, which wlil grab ioc-&gt;lock
triggering spurious (as the ioc is always different one) A-A deadlock
warning.

As this can only happen one time from ioc_release_fn(), using non-zero
subclass from ioc_release_fn() is enough.  Use subclass 1.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
11a3122f6c "block: strip out locking optimization in put_io_context()"
removed ioc_lock depth lockdep annoation along with locking
optimization; however, while recursing from put_io_context() is no
longer possible, ioc_release_fn() may still end up putting the last
reference of another ioc through elevator, which wlil grab ioc-&gt;lock
triggering spurious (as the ioc is always different one) A-A deadlock
warning.

As this can only happen one time from ioc_release_fn(), using non-zero
subclass from ioc_release_fn() is enough.  Use subclass 1.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bsg: fix sysfs link remove warning</title>
<updated>2012-02-08T19:02:03+00:00</updated>
<author>
<name>Stanislaw Gruszka</name>
<email>sgruszka@redhat.com</email>
</author>
<published>2012-02-08T19:02:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=37b40adf2d1b4a5e51323be73ccf8ddcf3f15dd3'/>
<id>37b40adf2d1b4a5e51323be73ccf8ddcf3f15dd3</id>
<content type='text'>
We create "bsg" link if q-&gt;kobj.sd is not NULL, so remove it only
when the same condition is true.

Fixes:

WARNING: at fs/sysfs/inode.c:323 sysfs_hash_and_remove+0x2b/0x77()
sysfs: can not remove 'bsg', no directory
Call Trace:
  [&lt;c0429683&gt;] warn_slowpath_common+0x6a/0x7f
  [&lt;c0537a68&gt;] ? sysfs_hash_and_remove+0x2b/0x77
  [&lt;c042970b&gt;] warn_slowpath_fmt+0x2b/0x2f
  [&lt;c0537a68&gt;] sysfs_hash_and_remove+0x2b/0x77
  [&lt;c053969a&gt;] sysfs_remove_link+0x20/0x23
  [&lt;c05d88f1&gt;] bsg_unregister_queue+0x40/0x6d
  [&lt;c0692263&gt;] __scsi_remove_device+0x31/0x9d
  [&lt;c069149f&gt;] scsi_forget_host+0x41/0x52
  [&lt;c0689fa9&gt;] scsi_remove_host+0x71/0xe0
  [&lt;f7de5945&gt;] quiesce_and_remove_host+0x51/0x83 [usb_storage]
  [&lt;f7de5a1e&gt;] usb_stor_disconnect+0x18/0x22 [usb_storage]
  [&lt;c06c29de&gt;] usb_unbind_interface+0x4e/0x109
  [&lt;c067a80f&gt;] __device_release_driver+0x6b/0xa6
  [&lt;c067a861&gt;] device_release_driver+0x17/0x22
  [&lt;c067a46a&gt;] bus_remove_device+0xd6/0xe6
  [&lt;c06785e2&gt;] device_del+0xf2/0x137
  [&lt;c06c101f&gt;] usb_disable_device+0x94/0x1a0

Signed-off-by: Stanislaw Gruszka &lt;sgruszka@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>
We create "bsg" link if q-&gt;kobj.sd is not NULL, so remove it only
when the same condition is true.

Fixes:

WARNING: at fs/sysfs/inode.c:323 sysfs_hash_and_remove+0x2b/0x77()
sysfs: can not remove 'bsg', no directory
Call Trace:
  [&lt;c0429683&gt;] warn_slowpath_common+0x6a/0x7f
  [&lt;c0537a68&gt;] ? sysfs_hash_and_remove+0x2b/0x77
  [&lt;c042970b&gt;] warn_slowpath_fmt+0x2b/0x2f
  [&lt;c0537a68&gt;] sysfs_hash_and_remove+0x2b/0x77
  [&lt;c053969a&gt;] sysfs_remove_link+0x20/0x23
  [&lt;c05d88f1&gt;] bsg_unregister_queue+0x40/0x6d
  [&lt;c0692263&gt;] __scsi_remove_device+0x31/0x9d
  [&lt;c069149f&gt;] scsi_forget_host+0x41/0x52
  [&lt;c0689fa9&gt;] scsi_remove_host+0x71/0xe0
  [&lt;f7de5945&gt;] quiesce_and_remove_host+0x51/0x83 [usb_storage]
  [&lt;f7de5a1e&gt;] usb_stor_disconnect+0x18/0x22 [usb_storage]
  [&lt;c06c29de&gt;] usb_unbind_interface+0x4e/0x109
  [&lt;c067a80f&gt;] __device_release_driver+0x6b/0xa6
  [&lt;c067a861&gt;] device_release_driver+0x17/0x22
  [&lt;c067a46a&gt;] bus_remove_device+0xd6/0xe6
  [&lt;c06785e2&gt;] device_del+0xf2/0x137
  [&lt;c06c101f&gt;] usb_disable_device+0x94/0x1a0

Signed-off-by: Stanislaw Gruszka &lt;sgruszka@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>block: don't call elevator callbacks for plug merges</title>
<updated>2012-02-08T08:19:42+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-02-08T08:19:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=07c2bd37350c9b1af71b35d05f16e300a6602948'/>
<id>07c2bd37350c9b1af71b35d05f16e300a6602948</id>
<content type='text'>
Plug merge calls two elevator callbacks outside queue lock -
elevator_allow_merge_fn() and elevator_bio_merged_fn().  Although
attempt_plug_merge() suggests that elevator is guaranteed to be there
through the existing request on the plug list, nothing prevents plug
merge from calling into dying or initializing elevator.

For regular merges, bypass ensures elvpriv count to reach zero, which
in turn prevents merges as all !ELVPRIV requests get REQ_SOFTBARRIER
from forced back insertion.  Plug merge doesn't check ELVPRIV, and, as
the requests haven't gone through elevator insertion yet, it doesn't
have SOFTBARRIER set allowing merges on a bypassed queue.

This, for example, leads to the following crash during elevator
switch.

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
 IP: [&lt;ffffffff813b34e9&gt;] cfq_allow_merge+0x49/0xa0
 PGD 112cbc067 PUD 115d5c067 PMD 0
 Oops: 0000 [#1] PREEMPT SMP
 CPU 1
 Modules linked in: deadline_iosched

 Pid: 819, comm: dd Not tainted 3.3.0-rc2-work+ #76 Bochs Bochs
 RIP: 0010:[&lt;ffffffff813b34e9&gt;]  [&lt;ffffffff813b34e9&gt;] cfq_allow_merge+0x49/0xa0
 RSP: 0018:ffff8801143a38f8  EFLAGS: 00010297
 RAX: 0000000000000000 RBX: ffff88011817ce28 RCX: ffff880116eb6cc0
 RDX: 0000000000000000 RSI: ffff880118056e20 RDI: ffff8801199512f8
 RBP: ffff8801143a3908 R08: 0000000000000000 R09: 0000000000000000
 R10: 0000000000000001 R11: 0000000000000000 R12: ffff880118195708
 R13: ffff880118052aa0 R14: ffff8801143a3d50 R15: ffff880118195708
 FS:  00007f19f82cb700(0000) GS:ffff88011fc80000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 0000000000000008 CR3: 0000000112c6a000 CR4: 00000000000006e0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process dd (pid: 819, threadinfo ffff8801143a2000, task ffff880116eb6cc0)
 Stack:
  ffff88011817ce28 ffff880118195708 ffff8801143a3928 ffffffff81391bba
  ffff88011817ce28 ffff880118195708 ffff8801143a3948 ffffffff81391bf1
  ffff88011817ce28 0000000000000000 ffff8801143a39a8 ffffffff81398e3e
 Call Trace:
  [&lt;ffffffff81391bba&gt;] elv_rq_merge_ok+0x4a/0x60
  [&lt;ffffffff81391bf1&gt;] elv_try_merge+0x21/0x40
  [&lt;ffffffff81398e3e&gt;] blk_queue_bio+0x8e/0x390
  [&lt;ffffffff81396a5a&gt;] generic_make_request+0xca/0x100
  [&lt;ffffffff81396b04&gt;] submit_bio+0x74/0x100
  [&lt;ffffffff811d45c2&gt;] __blockdev_direct_IO+0x1ce2/0x3450
  [&lt;ffffffff811d0dc7&gt;] blkdev_direct_IO+0x57/0x60
  [&lt;ffffffff811460b5&gt;] generic_file_aio_read+0x6d5/0x760
  [&lt;ffffffff811986b2&gt;] do_sync_read+0xe2/0x120
  [&lt;ffffffff81199345&gt;] vfs_read+0xc5/0x180
  [&lt;ffffffff81199501&gt;] sys_read+0x51/0x90
  [&lt;ffffffff81aeac12&gt;] system_call_fastpath+0x16/0x1b

There are multiple ways to fix this including making plug merge check
ELVPRIV; however,

* Calling into elevator outside queue lock is confusing and
  error-prone.

* Requests on plug list aren't known to the elevator.  They aren't on
  the elevator yet, so there's no elevator specific state to update.

* Given the nature of plug merges - collecting bio's for the same
  purpose from the same issuer - elevator specific restrictions aren't
  applicable.

So, simply don't call into elevator methods from plug merge by moving
elv_bio_merged() from bio_attempt_*_merge() to blk_queue_bio(), and
using blk_try_merge() in attempt_plug_merge().

This is based on Jens' patch to skip elevator_allow_merge_fn() from
plug merge.

Note that this makes per-cgroup merged stats skip plug merging.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
LKML-Reference: &lt;4F16F3CA.90904@kernel.dk&gt;
Original-patch-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Plug merge calls two elevator callbacks outside queue lock -
elevator_allow_merge_fn() and elevator_bio_merged_fn().  Although
attempt_plug_merge() suggests that elevator is guaranteed to be there
through the existing request on the plug list, nothing prevents plug
merge from calling into dying or initializing elevator.

For regular merges, bypass ensures elvpriv count to reach zero, which
in turn prevents merges as all !ELVPRIV requests get REQ_SOFTBARRIER
from forced back insertion.  Plug merge doesn't check ELVPRIV, and, as
the requests haven't gone through elevator insertion yet, it doesn't
have SOFTBARRIER set allowing merges on a bypassed queue.

This, for example, leads to the following crash during elevator
switch.

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
 IP: [&lt;ffffffff813b34e9&gt;] cfq_allow_merge+0x49/0xa0
 PGD 112cbc067 PUD 115d5c067 PMD 0
 Oops: 0000 [#1] PREEMPT SMP
 CPU 1
 Modules linked in: deadline_iosched

 Pid: 819, comm: dd Not tainted 3.3.0-rc2-work+ #76 Bochs Bochs
 RIP: 0010:[&lt;ffffffff813b34e9&gt;]  [&lt;ffffffff813b34e9&gt;] cfq_allow_merge+0x49/0xa0
 RSP: 0018:ffff8801143a38f8  EFLAGS: 00010297
 RAX: 0000000000000000 RBX: ffff88011817ce28 RCX: ffff880116eb6cc0
 RDX: 0000000000000000 RSI: ffff880118056e20 RDI: ffff8801199512f8
 RBP: ffff8801143a3908 R08: 0000000000000000 R09: 0000000000000000
 R10: 0000000000000001 R11: 0000000000000000 R12: ffff880118195708
 R13: ffff880118052aa0 R14: ffff8801143a3d50 R15: ffff880118195708
 FS:  00007f19f82cb700(0000) GS:ffff88011fc80000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 0000000000000008 CR3: 0000000112c6a000 CR4: 00000000000006e0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process dd (pid: 819, threadinfo ffff8801143a2000, task ffff880116eb6cc0)
 Stack:
  ffff88011817ce28 ffff880118195708 ffff8801143a3928 ffffffff81391bba
  ffff88011817ce28 ffff880118195708 ffff8801143a3948 ffffffff81391bf1
  ffff88011817ce28 0000000000000000 ffff8801143a39a8 ffffffff81398e3e
 Call Trace:
  [&lt;ffffffff81391bba&gt;] elv_rq_merge_ok+0x4a/0x60
  [&lt;ffffffff81391bf1&gt;] elv_try_merge+0x21/0x40
  [&lt;ffffffff81398e3e&gt;] blk_queue_bio+0x8e/0x390
  [&lt;ffffffff81396a5a&gt;] generic_make_request+0xca/0x100
  [&lt;ffffffff81396b04&gt;] submit_bio+0x74/0x100
  [&lt;ffffffff811d45c2&gt;] __blockdev_direct_IO+0x1ce2/0x3450
  [&lt;ffffffff811d0dc7&gt;] blkdev_direct_IO+0x57/0x60
  [&lt;ffffffff811460b5&gt;] generic_file_aio_read+0x6d5/0x760
  [&lt;ffffffff811986b2&gt;] do_sync_read+0xe2/0x120
  [&lt;ffffffff81199345&gt;] vfs_read+0xc5/0x180
  [&lt;ffffffff81199501&gt;] sys_read+0x51/0x90
  [&lt;ffffffff81aeac12&gt;] system_call_fastpath+0x16/0x1b

There are multiple ways to fix this including making plug merge check
ELVPRIV; however,

* Calling into elevator outside queue lock is confusing and
  error-prone.

* Requests on plug list aren't known to the elevator.  They aren't on
  the elevator yet, so there's no elevator specific state to update.

* Given the nature of plug merges - collecting bio's for the same
  purpose from the same issuer - elevator specific restrictions aren't
  applicable.

So, simply don't call into elevator methods from plug merge by moving
elv_bio_merged() from bio_attempt_*_merge() to blk_queue_bio(), and
using blk_try_merge() in attempt_plug_merge().

This is based on Jens' patch to skip elevator_allow_merge_fn() from
plug merge.

Note that this makes per-cgroup merged stats skip plug merging.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
LKML-Reference: &lt;4F16F3CA.90904@kernel.dk&gt;
Original-patch-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>block: separate out blk_rq_merge_ok() and blk_try_merge() from elevator functions</title>
<updated>2012-02-08T08:19:38+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-02-08T08:19:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=050c8ea80e3e90019d9e981c6a117ef614e882ed'/>
<id>050c8ea80e3e90019d9e981c6a117ef614e882ed</id>
<content type='text'>
blk_rq_merge_ok() is the elevator-neutral part of merge eligibility
test.  blk_try_merge() determines merge direction and expects the
caller to have tested elv_rq_merge_ok() previously.

elv_rq_merge_ok() now wraps blk_rq_merge_ok() and then calls
elv_iosched_allow_merge().  elv_try_merge() is removed and the two
callers are updated to call elv_rq_merge_ok() explicitly followed by
blk_try_merge().  While at it, make rq_merge_ok() functions return
bool.

This is to prepare for plug merge update and doesn't introduce any
behavior change.

This is based on Jens' patch to skip elevator_allow_merge_fn() from
plug merge.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
LKML-Reference: &lt;4F16F3CA.90904@kernel.dk&gt;
Original-patch-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
blk_rq_merge_ok() is the elevator-neutral part of merge eligibility
test.  blk_try_merge() determines merge direction and expects the
caller to have tested elv_rq_merge_ok() previously.

elv_rq_merge_ok() now wraps blk_rq_merge_ok() and then calls
elv_iosched_allow_merge().  elv_try_merge() is removed and the two
callers are updated to call elv_rq_merge_ok() explicitly followed by
blk_try_merge().  While at it, make rq_merge_ok() functions return
bool.

This is to prepare for plug merge update and doesn't introduce any
behavior change.

This is based on Jens' patch to skip elevator_allow_merge_fn() from
plug merge.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
LKML-Reference: &lt;4F16F3CA.90904@kernel.dk&gt;
Original-patch-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>block: strip out locking optimization in put_io_context()</title>
<updated>2012-02-07T06:51:30+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-02-07T06:51:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=11a3122f6cf2d988a77eb8883d0fc49cd013a6d5'/>
<id>11a3122f6cf2d988a77eb8883d0fc49cd013a6d5</id>
<content type='text'>
put_io_context() performed a complex trylock dancing to avoid
deferring ioc release to workqueue.  It was also broken on UP because
trylock was always assumed to succeed which resulted in unbalanced
preemption count.

While there are ways to fix the UP breakage, even the most
pathological microbench (forced ioc allocation and tight fork/exit
loop) fails to show any appreciable performance benefit of the
optimization.  Strip it out.  If there turns out to be workloads which
are affected by this change, simpler optimization from the discussion
thread can be applied later.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
LKML-Reference: &lt;1328514611.21268.66.camel@sli10-conroe&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
put_io_context() performed a complex trylock dancing to avoid
deferring ioc release to workqueue.  It was also broken on UP because
trylock was always assumed to succeed which resulted in unbalanced
preemption count.

While there are ways to fix the UP breakage, even the most
pathological microbench (forced ioc allocation and tight fork/exit
loop) fails to show any appreciable performance benefit of the
optimization.  Strip it out.  If there turns out to be workloads which
are affected by this change, simpler optimization from the discussion
thread can be applied later.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
LKML-Reference: &lt;1328514611.21268.66.camel@sli10-conroe&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>block: fix ioc locking warning</title>
<updated>2012-02-06T07:57:29+00:00</updated>
<author>
<name>Shaohua Li</name>
<email>shaohua.li@intel.com</email>
</author>
<published>2012-02-06T07:57:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9fa73472ddbcd3da87d35a7f4566eaaf345f798e'/>
<id>9fa73472ddbcd3da87d35a7f4566eaaf345f798e</id>
<content type='text'>
Meelis reported a warning:

WARNING: at kernel/timer.c:1122 run_timer_softirq+0x199/0x1ec()
Hardware name: 939Dual-SATA2
timer: cfq_idle_slice_timer+0x0/0xaa preempt leak: 00000102 -&gt; 00000103
Modules linked in: sr_mod cdrom videodev media drm_kms_helper ohci_hcd ehci_hcd v4l2_compat_ioctl32 usbcore i2c_ali15x3 snd_seq drm snd_timer snd_seq
Pid: 0, comm: swapper Not tainted 3.3.0-rc2-00110-gd125666 #176
Call Trace:
 &lt;IRQ&gt;  [&lt;ffffffff81022aaa&gt;] warn_slowpath_common+0x7e/0x96
 [&lt;ffffffff8114c485&gt;] ? cfq_slice_expired+0x1d/0x1d
 [&lt;ffffffff81022b56&gt;] warn_slowpath_fmt+0x41/0x43
 [&lt;ffffffff8114c526&gt;] ? cfq_idle_slice_timer+0xa1/0xaa
 [&lt;ffffffff8114c485&gt;] ? cfq_slice_expired+0x1d/0x1d
 [&lt;ffffffff8102c124&gt;] run_timer_softirq+0x199/0x1ec
 [&lt;ffffffff81047a53&gt;] ? timekeeping_get_ns+0x12/0x31
 [&lt;ffffffff810145fd&gt;] ? apic_write+0x11/0x13
 [&lt;ffffffff81027475&gt;] __do_softirq+0x74/0xfa
 [&lt;ffffffff812f337a&gt;] call_softirq+0x1a/0x30
 [&lt;ffffffff81002ff9&gt;] do_softirq+0x31/0x68
 [&lt;ffffffff810276cf&gt;] irq_exit+0x3d/0xa3
 [&lt;ffffffff81014aca&gt;] smp_apic_timer_interrupt+0x6b/0x77
 [&lt;ffffffff812f2de9&gt;] apic_timer_interrupt+0x69/0x70
 &lt;EOI&gt;  [&lt;ffffffff81040136&gt;] ? sched_clock_cpu+0x73/0x7d
 [&lt;ffffffff81040136&gt;] ? sched_clock_cpu+0x73/0x7d
 [&lt;ffffffff8100801f&gt;] ? default_idle+0x1e/0x32
 [&lt;ffffffff81008019&gt;] ? default_idle+0x18/0x32
 [&lt;ffffffff810008b1&gt;] cpu_idle+0x87/0xd1
 [&lt;ffffffff812de861&gt;] rest_init+0x85/0x89
 [&lt;ffffffff81659a4d&gt;] start_kernel+0x2eb/0x2f8
 [&lt;ffffffff8165926e&gt;] x86_64_start_reservations+0x7e/0x82
 [&lt;ffffffff81659362&gt;] x86_64_start_kernel+0xf0/0xf7

this_q == locked_q is possible. There are two problems here:
1. In UP case, there is preemption counter issue as spin_trylock always
successes.
2. In SMP case, the loop breaks too earlier.

Signed-off-by: Shaohua Li &lt;shaohua.li@intel.com&gt;
Reported-by: Meelis Roos &lt;mroos@linux.ee&gt;
Reported-by: Knut Petersen &lt;Knut_Petersen@t-online.de&gt;
Tested-by: Knut Petersen &lt;Knut_Petersen@t-online.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Meelis reported a warning:

WARNING: at kernel/timer.c:1122 run_timer_softirq+0x199/0x1ec()
Hardware name: 939Dual-SATA2
timer: cfq_idle_slice_timer+0x0/0xaa preempt leak: 00000102 -&gt; 00000103
Modules linked in: sr_mod cdrom videodev media drm_kms_helper ohci_hcd ehci_hcd v4l2_compat_ioctl32 usbcore i2c_ali15x3 snd_seq drm snd_timer snd_seq
Pid: 0, comm: swapper Not tainted 3.3.0-rc2-00110-gd125666 #176
Call Trace:
 &lt;IRQ&gt;  [&lt;ffffffff81022aaa&gt;] warn_slowpath_common+0x7e/0x96
 [&lt;ffffffff8114c485&gt;] ? cfq_slice_expired+0x1d/0x1d
 [&lt;ffffffff81022b56&gt;] warn_slowpath_fmt+0x41/0x43
 [&lt;ffffffff8114c526&gt;] ? cfq_idle_slice_timer+0xa1/0xaa
 [&lt;ffffffff8114c485&gt;] ? cfq_slice_expired+0x1d/0x1d
 [&lt;ffffffff8102c124&gt;] run_timer_softirq+0x199/0x1ec
 [&lt;ffffffff81047a53&gt;] ? timekeeping_get_ns+0x12/0x31
 [&lt;ffffffff810145fd&gt;] ? apic_write+0x11/0x13
 [&lt;ffffffff81027475&gt;] __do_softirq+0x74/0xfa
 [&lt;ffffffff812f337a&gt;] call_softirq+0x1a/0x30
 [&lt;ffffffff81002ff9&gt;] do_softirq+0x31/0x68
 [&lt;ffffffff810276cf&gt;] irq_exit+0x3d/0xa3
 [&lt;ffffffff81014aca&gt;] smp_apic_timer_interrupt+0x6b/0x77
 [&lt;ffffffff812f2de9&gt;] apic_timer_interrupt+0x69/0x70
 &lt;EOI&gt;  [&lt;ffffffff81040136&gt;] ? sched_clock_cpu+0x73/0x7d
 [&lt;ffffffff81040136&gt;] ? sched_clock_cpu+0x73/0x7d
 [&lt;ffffffff8100801f&gt;] ? default_idle+0x1e/0x32
 [&lt;ffffffff81008019&gt;] ? default_idle+0x18/0x32
 [&lt;ffffffff810008b1&gt;] cpu_idle+0x87/0xd1
 [&lt;ffffffff812de861&gt;] rest_init+0x85/0x89
 [&lt;ffffffff81659a4d&gt;] start_kernel+0x2eb/0x2f8
 [&lt;ffffffff8165926e&gt;] x86_64_start_reservations+0x7e/0x82
 [&lt;ffffffff81659362&gt;] x86_64_start_kernel+0xf0/0xf7

this_q == locked_q is possible. There are two problems here:
1. In UP case, there is preemption counter issue as spin_trylock always
successes.
2. In SMP case, the loop breaks too earlier.

Signed-off-by: Shaohua Li &lt;shaohua.li@intel.com&gt;
Reported-by: Meelis Roos &lt;mroos@linux.ee&gt;
Reported-by: Knut Petersen &lt;Knut_Petersen@t-online.de&gt;
Tested-by: Knut Petersen &lt;Knut_Petersen@t-online.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>block: fix NULL icq_cache reference</title>
<updated>2012-01-19T08:20:10+00:00</updated>
<author>
<name>Shaohua Li</name>
<email>shaohua.li@intel.com</email>
</author>
<published>2012-01-19T08:20:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=05c30b9551f1904d9950ad0d28e65fc4ff3c8a8e'/>
<id>05c30b9551f1904d9950ad0d28e65fc4ff3c8a8e</id>
<content type='text'>
Vivek reported a kernel crash:
[   94.217015] BUG: unable to handle kernel NULL pointer dereference at 000000000000001c
[   94.218004] IP: [&lt;ffffffff81142fae&gt;] kmem_cache_free+0x5e/0x200
[   94.218004] PGD 13abda067 PUD 137d52067 PMD 0
[   94.218004] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
[   94.218004] CPU 0
[   94.218004] Modules linked in: [last unloaded: scsi_wait_scan]
[   94.218004]
[   94.218004] Pid: 0, comm: swapper/0 Not tainted 3.2.0+ #16 Hewlett-Packard HP xw6600 Workstation/0A9Ch
[   94.218004] RIP: 0010:[&lt;ffffffff81142fae&gt;]  [&lt;ffffffff81142fae&gt;] kmem_cache_free+0x5e/0x200
[   94.218004] RSP: 0018:ffff88013fc03de0  EFLAGS: 00010006
[   94.218004] RAX: ffffffff81e0d020 RBX: ffff880138b3c680 RCX: 00000001801c001b
[   94.218004] RDX: 00000000003aac1d RSI: ffff880138b3c680 RDI: ffffffff81142fae
[   94.218004] RBP: ffff88013fc03e10 R08: ffff880137830238 R09: 0000000000000001
[   94.218004] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
[   94.218004] R13: ffffea0004e2cf00 R14: ffffffff812f6eb6 R15: 0000000000000246
[   94.218004] FS:  0000000000000000(0000) GS:ffff88013fc00000(0000) knlGS:0000000000000000
[   94.218004] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   94.218004] CR2: 000000000000001c CR3: 00000001395ab000 CR4: 00000000000006f0
[   94.218004] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   94.218004] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[   94.218004] Process swapper/0 (pid: 0, threadinfo ffffffff81e00000, task ffffffff81e0d020)
[   94.218004] Stack:
[   94.218004]  0000000000000102 ffff88013fc0db20 ffffffff81e22700 ffff880139500f00
[   94.218004]  0000000000000001 000000000000000a ffff88013fc03e20 ffffffff812f6eb6
[   94.218004]  ffff88013fc03e90 ffffffff810c8da2 ffffffff81e01fd8 ffff880137830240
[   94.218004] Call Trace:
[   94.218004]  &lt;IRQ&gt;
[   94.218004]  [&lt;ffffffff812f6eb6&gt;] icq_free_icq_rcu+0x16/0x20
[   94.218004]  [&lt;ffffffff810c8da2&gt;] __rcu_process_callbacks+0x1c2/0x420
[   94.218004]  [&lt;ffffffff810c9038&gt;] rcu_process_callbacks+0x38/0x250
[   94.218004]  [&lt;ffffffff810405ee&gt;] __do_softirq+0xce/0x3e0
[   94.218004]  [&lt;ffffffff8108ed04&gt;] ? clockevents_program_event+0x74/0x100
[   94.218004]  [&lt;ffffffff81090104&gt;] ? tick_program_event+0x24/0x30
[   94.218004]  [&lt;ffffffff8183ed1c&gt;] call_softirq+0x1c/0x30
[   94.218004]  [&lt;ffffffff8100422d&gt;] do_softirq+0x8d/0xc0
[   94.218004]  [&lt;ffffffff81040c3e&gt;] irq_exit+0xae/0xe0
[   94.218004]  [&lt;ffffffff8183f4be&gt;] smp_apic_timer_interrupt+0x6e/0x99
[   94.218004]  [&lt;ffffffff8183e330&gt;] apic_timer_interrupt+0x70/0x80

Once a queue is quiesced, it's not supposed to have any elvpriv data or
icq's, and elevator switching depends on that.  Request alloc path
followed the rule for elvpriv data but forgot apply it to icq's
leading to the following crash during elevator switch. Fix it by not
allocating icq's if ELVPRIV is not set for the request.

Reported-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Tested-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Shaohua Li &lt;shaohua.li@intel.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Vivek reported a kernel crash:
[   94.217015] BUG: unable to handle kernel NULL pointer dereference at 000000000000001c
[   94.218004] IP: [&lt;ffffffff81142fae&gt;] kmem_cache_free+0x5e/0x200
[   94.218004] PGD 13abda067 PUD 137d52067 PMD 0
[   94.218004] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
[   94.218004] CPU 0
[   94.218004] Modules linked in: [last unloaded: scsi_wait_scan]
[   94.218004]
[   94.218004] Pid: 0, comm: swapper/0 Not tainted 3.2.0+ #16 Hewlett-Packard HP xw6600 Workstation/0A9Ch
[   94.218004] RIP: 0010:[&lt;ffffffff81142fae&gt;]  [&lt;ffffffff81142fae&gt;] kmem_cache_free+0x5e/0x200
[   94.218004] RSP: 0018:ffff88013fc03de0  EFLAGS: 00010006
[   94.218004] RAX: ffffffff81e0d020 RBX: ffff880138b3c680 RCX: 00000001801c001b
[   94.218004] RDX: 00000000003aac1d RSI: ffff880138b3c680 RDI: ffffffff81142fae
[   94.218004] RBP: ffff88013fc03e10 R08: ffff880137830238 R09: 0000000000000001
[   94.218004] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
[   94.218004] R13: ffffea0004e2cf00 R14: ffffffff812f6eb6 R15: 0000000000000246
[   94.218004] FS:  0000000000000000(0000) GS:ffff88013fc00000(0000) knlGS:0000000000000000
[   94.218004] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[   94.218004] CR2: 000000000000001c CR3: 00000001395ab000 CR4: 00000000000006f0
[   94.218004] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   94.218004] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[   94.218004] Process swapper/0 (pid: 0, threadinfo ffffffff81e00000, task ffffffff81e0d020)
[   94.218004] Stack:
[   94.218004]  0000000000000102 ffff88013fc0db20 ffffffff81e22700 ffff880139500f00
[   94.218004]  0000000000000001 000000000000000a ffff88013fc03e20 ffffffff812f6eb6
[   94.218004]  ffff88013fc03e90 ffffffff810c8da2 ffffffff81e01fd8 ffff880137830240
[   94.218004] Call Trace:
[   94.218004]  &lt;IRQ&gt;
[   94.218004]  [&lt;ffffffff812f6eb6&gt;] icq_free_icq_rcu+0x16/0x20
[   94.218004]  [&lt;ffffffff810c8da2&gt;] __rcu_process_callbacks+0x1c2/0x420
[   94.218004]  [&lt;ffffffff810c9038&gt;] rcu_process_callbacks+0x38/0x250
[   94.218004]  [&lt;ffffffff810405ee&gt;] __do_softirq+0xce/0x3e0
[   94.218004]  [&lt;ffffffff8108ed04&gt;] ? clockevents_program_event+0x74/0x100
[   94.218004]  [&lt;ffffffff81090104&gt;] ? tick_program_event+0x24/0x30
[   94.218004]  [&lt;ffffffff8183ed1c&gt;] call_softirq+0x1c/0x30
[   94.218004]  [&lt;ffffffff8100422d&gt;] do_softirq+0x8d/0xc0
[   94.218004]  [&lt;ffffffff81040c3e&gt;] irq_exit+0xae/0xe0
[   94.218004]  [&lt;ffffffff8183f4be&gt;] smp_apic_timer_interrupt+0x6e/0x99
[   94.218004]  [&lt;ffffffff8183e330&gt;] apic_timer_interrupt+0x70/0x80

Once a queue is quiesced, it's not supposed to have any elvpriv data or
icq's, and elevator switching depends on that.  Request alloc path
followed the rule for elvpriv data but forgot apply it to icq's
leading to the following crash during elevator switch. Fix it by not
allocating icq's if ELVPRIV is not set for the request.

Reported-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Tested-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Shaohua Li &lt;shaohua.li@intel.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>block,cfq: change code order</title>
<updated>2012-01-19T08:20:09+00:00</updated>
<author>
<name>Shaohua Li</name>
<email>shaohua.li@intel.com</email>
</author>
<published>2012-01-19T08:20:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=df0793abb929e66606fa25f3875ff1b89de5ad32'/>
<id>df0793abb929e66606fa25f3875ff1b89de5ad32</id>
<content type='text'>
cfq_slice_expired will change saved_workload_slice. It should be called
first so saved_workload_slice is correctly set to 0 after workload type
is changed.
This fixes the code order changed by 54b466e44b1c7.

Tested-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Signed-off-by: Shaohua Li &lt;shaohua.li@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>
cfq_slice_expired will change saved_workload_slice. It should be called
first so saved_workload_slice is correctly set to 0 after workload type
is changed.
This fixes the code order changed by 54b466e44b1c7.

Tested-by: Tetsuo Handa &lt;penguin-kernel@I-love.SAKURA.ne.jp&gt;
Signed-off-by: Shaohua Li &lt;shaohua.li@intel.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cfq-iosched: fix use-after-free of cfqq</title>
<updated>2012-01-17T20:26:11+00:00</updated>
<author>
<name>Jens Axboe</name>
<email>axboe@kernel.dk</email>
</author>
<published>2012-01-17T20:26:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=54b466e44b1c7809144bbd8cd6be3f85877ca46f'/>
<id>54b466e44b1c7809144bbd8cd6be3f85877ca46f</id>
<content type='text'>
With the changes in life time management between the cfq IO contexts
and the cfq queues, we now risk having cfqd-&gt;active_queue being
freed when cfq_slice_expired() is being called. cfq_preempt_queue()
caches this queue and uses it after calling said function, causing
a use-after-free condition. This triggers the following oops,
when cfqq_type() attempts to dereference it:

BUG: unable to handle kernel paging request at ffff8800746c4f0c
IP: [&lt;ffffffff81266d59&gt;] cfqq_type+0xb/0x20
PGD 18d4063 PUD 1fe15067 PMD 1ffb9067 PTE 80000000746c4160
Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
CPU 3
Modules linked in:

Pid: 1, comm: init Not tainted 3.2.0-josef+ #367 Bochs Bochs
RIP: 0010:[&lt;ffffffff81266d59&gt;]  [&lt;ffffffff81266d59&gt;] cfqq_type+0xb/0x20
RSP: 0018:ffff880079c11778  EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff880076f3df08 RCX: 0000000000000000
RDX: 0000000000000006 RSI: ffff880074271888 RDI: ffff8800746c4f08
RBP: ffff880079c11778 R08: 0000000000000078 R09: 0000000000000001
R10: 09f911029d74e35b R11: 09f911029d74e35b R12: ffff880076f337f0
R13: ffff8800746c4f08 R14: ffff8800746c4f08 R15: 0000000000000002
FS:  00007f62fd44f700(0000) GS:ffff88007cd80000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff8800746c4f0c CR3: 0000000076c21000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process init (pid: 1, threadinfo ffff880079c10000, task ffff880079c0a040)
Stack:
 ffff880079c117c8 ffffffff812683d8 ffff880079c117a8 ffffffff8125de43
 ffff8800744fcf48 ffff880074b43e98 ffff8800770c8828 ffff880074b43e98
 0000000000000003 0000000000000000 ffff880079c117f8 ffffffff81254149
Call Trace:
 [&lt;ffffffff812683d8&gt;] cfq_insert_request+0x3f5/0x47c
 [&lt;ffffffff8125de43&gt;] ? blk_recount_segments+0x20/0x31
 [&lt;ffffffff81254149&gt;] __elv_add_request+0x1ca/0x200
 [&lt;ffffffff8125aa99&gt;] blk_queue_bio+0x2ef/0x312
 [&lt;ffffffff81258f7b&gt;] generic_make_request+0x9f/0xe0
 [&lt;ffffffff8125907b&gt;] submit_bio+0xbf/0xca
 [&lt;ffffffff81136ec7&gt;] submit_bh+0xdf/0xfe
 [&lt;ffffffff81176d04&gt;] ext3_bread+0x50/0x99
 [&lt;ffffffff811785b3&gt;] dx_probe+0x38/0x291
 [&lt;ffffffff81178864&gt;] ext3_dx_find_entry+0x58/0x219
 [&lt;ffffffff81178ad5&gt;] ext3_find_entry+0xb0/0x406
 [&lt;ffffffff8110c4d5&gt;] ? cache_alloc_debugcheck_after.isra.46+0x14d/0x1a0
 [&lt;ffffffff8110cfbd&gt;] ? kmem_cache_alloc+0xef/0x191
 [&lt;ffffffff8117a330&gt;] ext3_lookup+0x39/0xe1
 [&lt;ffffffff81119461&gt;] d_alloc_and_lookup+0x45/0x6c
 [&lt;ffffffff8111ac41&gt;] do_lookup+0x1e4/0x2f5
 [&lt;ffffffff8111aef6&gt;] link_path_walk+0x1a4/0x6ef
 [&lt;ffffffff8111b557&gt;] path_lookupat+0x59/0x5ea
 [&lt;ffffffff8127406c&gt;] ? __strncpy_from_user+0x30/0x5a
 [&lt;ffffffff8111bce0&gt;] do_path_lookup+0x23/0x59
 [&lt;ffffffff8111cfd6&gt;] user_path_at_empty+0x53/0x99
 [&lt;ffffffff8107b37b&gt;] ? remove_wait_queue+0x51/0x56
 [&lt;ffffffff8111d02d&gt;] user_path_at+0x11/0x13
 [&lt;ffffffff811141f5&gt;] vfs_fstatat+0x3a/0x64
 [&lt;ffffffff8111425a&gt;] vfs_stat+0x1b/0x1d
 [&lt;ffffffff81114359&gt;] sys_newstat+0x1a/0x33
 [&lt;ffffffff81060e12&gt;] ? task_stopped_code+0x42/0x42
 [&lt;ffffffff815d6712&gt;] system_call_fastpath+0x16/0x1b
Code: 89 e6 48 89 c7 e8 fa ca fe ff 85 c0 74 06 4c 89 2b 41 b6 01 5b 44 89 f0 41 5c 41 5d 41 5e 5d c3 55 48 89 e5 66 66 66 66 90 31 c0 &lt;8b&gt; 57 04 f6 c6 01 74 0b 83 e2 20 83 fa 01 19 c0 83 c0 02 5d c3
RIP  [&lt;ffffffff81266d59&gt;] cfqq_type+0xb/0x20
 RSP &lt;ffff880079c11778&gt;
CR2: ffff8800746c4f0c

Get rid of the caching of cfqd-&gt;active_queue, and reorder the
check so that it happens before we expire the active queue.

Thanks to Tejun for pin pointing the error location.

Reported-by: Chris Mason &lt;chris.mason@oracle.com&gt;
Tested-by: Chris Mason &lt;chris.mason@oracle.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>
With the changes in life time management between the cfq IO contexts
and the cfq queues, we now risk having cfqd-&gt;active_queue being
freed when cfq_slice_expired() is being called. cfq_preempt_queue()
caches this queue and uses it after calling said function, causing
a use-after-free condition. This triggers the following oops,
when cfqq_type() attempts to dereference it:

BUG: unable to handle kernel paging request at ffff8800746c4f0c
IP: [&lt;ffffffff81266d59&gt;] cfqq_type+0xb/0x20
PGD 18d4063 PUD 1fe15067 PMD 1ffb9067 PTE 80000000746c4160
Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
CPU 3
Modules linked in:

Pid: 1, comm: init Not tainted 3.2.0-josef+ #367 Bochs Bochs
RIP: 0010:[&lt;ffffffff81266d59&gt;]  [&lt;ffffffff81266d59&gt;] cfqq_type+0xb/0x20
RSP: 0018:ffff880079c11778  EFLAGS: 00010046
RAX: 0000000000000000 RBX: ffff880076f3df08 RCX: 0000000000000000
RDX: 0000000000000006 RSI: ffff880074271888 RDI: ffff8800746c4f08
RBP: ffff880079c11778 R08: 0000000000000078 R09: 0000000000000001
R10: 09f911029d74e35b R11: 09f911029d74e35b R12: ffff880076f337f0
R13: ffff8800746c4f08 R14: ffff8800746c4f08 R15: 0000000000000002
FS:  00007f62fd44f700(0000) GS:ffff88007cd80000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff8800746c4f0c CR3: 0000000076c21000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process init (pid: 1, threadinfo ffff880079c10000, task ffff880079c0a040)
Stack:
 ffff880079c117c8 ffffffff812683d8 ffff880079c117a8 ffffffff8125de43
 ffff8800744fcf48 ffff880074b43e98 ffff8800770c8828 ffff880074b43e98
 0000000000000003 0000000000000000 ffff880079c117f8 ffffffff81254149
Call Trace:
 [&lt;ffffffff812683d8&gt;] cfq_insert_request+0x3f5/0x47c
 [&lt;ffffffff8125de43&gt;] ? blk_recount_segments+0x20/0x31
 [&lt;ffffffff81254149&gt;] __elv_add_request+0x1ca/0x200
 [&lt;ffffffff8125aa99&gt;] blk_queue_bio+0x2ef/0x312
 [&lt;ffffffff81258f7b&gt;] generic_make_request+0x9f/0xe0
 [&lt;ffffffff8125907b&gt;] submit_bio+0xbf/0xca
 [&lt;ffffffff81136ec7&gt;] submit_bh+0xdf/0xfe
 [&lt;ffffffff81176d04&gt;] ext3_bread+0x50/0x99
 [&lt;ffffffff811785b3&gt;] dx_probe+0x38/0x291
 [&lt;ffffffff81178864&gt;] ext3_dx_find_entry+0x58/0x219
 [&lt;ffffffff81178ad5&gt;] ext3_find_entry+0xb0/0x406
 [&lt;ffffffff8110c4d5&gt;] ? cache_alloc_debugcheck_after.isra.46+0x14d/0x1a0
 [&lt;ffffffff8110cfbd&gt;] ? kmem_cache_alloc+0xef/0x191
 [&lt;ffffffff8117a330&gt;] ext3_lookup+0x39/0xe1
 [&lt;ffffffff81119461&gt;] d_alloc_and_lookup+0x45/0x6c
 [&lt;ffffffff8111ac41&gt;] do_lookup+0x1e4/0x2f5
 [&lt;ffffffff8111aef6&gt;] link_path_walk+0x1a4/0x6ef
 [&lt;ffffffff8111b557&gt;] path_lookupat+0x59/0x5ea
 [&lt;ffffffff8127406c&gt;] ? __strncpy_from_user+0x30/0x5a
 [&lt;ffffffff8111bce0&gt;] do_path_lookup+0x23/0x59
 [&lt;ffffffff8111cfd6&gt;] user_path_at_empty+0x53/0x99
 [&lt;ffffffff8107b37b&gt;] ? remove_wait_queue+0x51/0x56
 [&lt;ffffffff8111d02d&gt;] user_path_at+0x11/0x13
 [&lt;ffffffff811141f5&gt;] vfs_fstatat+0x3a/0x64
 [&lt;ffffffff8111425a&gt;] vfs_stat+0x1b/0x1d
 [&lt;ffffffff81114359&gt;] sys_newstat+0x1a/0x33
 [&lt;ffffffff81060e12&gt;] ? task_stopped_code+0x42/0x42
 [&lt;ffffffff815d6712&gt;] system_call_fastpath+0x16/0x1b
Code: 89 e6 48 89 c7 e8 fa ca fe ff 85 c0 74 06 4c 89 2b 41 b6 01 5b 44 89 f0 41 5c 41 5d 41 5e 5d c3 55 48 89 e5 66 66 66 66 90 31 c0 &lt;8b&gt; 57 04 f6 c6 01 74 0b 83 e2 20 83 fa 01 19 c0 83 c0 02 5d c3
RIP  [&lt;ffffffff81266d59&gt;] cfqq_type+0xb/0x20
 RSP &lt;ffff880079c11778&gt;
CR2: ffff8800746c4f0c

Get rid of the caching of cfqd-&gt;active_queue, and reorder the
check so that it happens before we expire the active queue.

Thanks to Tejun for pin pointing the error location.

Reported-by: Chris Mason &lt;chris.mason@oracle.com&gt;
Tested-by: Chris Mason &lt;chris.mason@oracle.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge branch 'for-3.3/core' of git://git.kernel.dk/linux-block</title>
<updated>2012-01-15T20:24:45+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-01-15T20:24:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b3c9dd182ed3bdcdaf0e42625a35924b0497afdc'/>
<id>b3c9dd182ed3bdcdaf0e42625a35924b0497afdc</id>
<content type='text'>
* 'for-3.3/core' of git://git.kernel.dk/linux-block: (37 commits)
  Revert "block: recursive merge requests"
  block: Stop using macro stubs for the bio data integrity calls
  blockdev: convert some macros to static inlines
  fs: remove unneeded plug in mpage_readpages()
  block: Add BLKROTATIONAL ioctl
  block: Introduce blk_set_stacking_limits function
  block: remove WARN_ON_ONCE() in exit_io_context()
  block: an exiting task should be allowed to create io_context
  block: ioc_cgroup_changed() needs to be exported
  block: recursive merge requests
  block, cfq: fix empty queue crash caused by request merge
  block, cfq: move icq creation and rq-&gt;elv.icq association to block core
  block, cfq: restructure io_cq creation path for io_context interface cleanup
  block, cfq: move io_cq exit/release to blk-ioc.c
  block, cfq: move icq cache management to block core
  block, cfq: move io_cq lookup to blk-ioc.c
  block, cfq: move cfqd-&gt;icq_list to request_queue and add request-&gt;elv.icq
  block, cfq: reorganize cfq_io_context into generic and cfq specific parts
  block: remove elevator_queue-&gt;ops
  block: reorder elevator switch sequence
  ...

Fix up conflicts in:
 - block/blk-cgroup.c
	Switch from can_attach_task to can_attach
 - block/cfq-iosched.c
	conflict with now removed cic index changes (we now use q-&gt;id instead)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* 'for-3.3/core' of git://git.kernel.dk/linux-block: (37 commits)
  Revert "block: recursive merge requests"
  block: Stop using macro stubs for the bio data integrity calls
  blockdev: convert some macros to static inlines
  fs: remove unneeded plug in mpage_readpages()
  block: Add BLKROTATIONAL ioctl
  block: Introduce blk_set_stacking_limits function
  block: remove WARN_ON_ONCE() in exit_io_context()
  block: an exiting task should be allowed to create io_context
  block: ioc_cgroup_changed() needs to be exported
  block: recursive merge requests
  block, cfq: fix empty queue crash caused by request merge
  block, cfq: move icq creation and rq-&gt;elv.icq association to block core
  block, cfq: restructure io_cq creation path for io_context interface cleanup
  block, cfq: move io_cq exit/release to blk-ioc.c
  block, cfq: move icq cache management to block core
  block, cfq: move io_cq lookup to blk-ioc.c
  block, cfq: move cfqd-&gt;icq_list to request_queue and add request-&gt;elv.icq
  block, cfq: reorganize cfq_io_context into generic and cfq specific parts
  block: remove elevator_queue-&gt;ops
  block: reorder elevator switch sequence
  ...

Fix up conflicts in:
 - block/blk-cgroup.c
	Switch from can_attach_task to can_attach
 - block/cfq-iosched.c
	conflict with now removed cic index changes (we now use q-&gt;id instead)
</pre>
</div>
</content>
</entry>
</feed>
