<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/scsi, branch v2.6.25</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>scsi: fix sense_slab/bio swapping livelock</title>
<updated>2008-04-06T23:10:08+00:00</updated>
<author>
<name>Hugh Dickins</name>
<email>hugh@veritas.com</email>
</author>
<published>2008-04-06T22:56:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=164fc5dcd6a1026fc713f5c63fad899aa484888c'/>
<id>164fc5dcd6a1026fc713f5c63fad899aa484888c</id>
<content type='text'>
Since 2.6.25-rc7, I've been seeing an occasional livelock on one x86_64
machine, copying kernel trees to tmpfs, paging out to swap.

Signature: 6000 pages under writeback but never getting written; most
tasks of interest trying to reclaim, but each get_swap_bio waiting for a
bio in mempool_alloc's io_schedule_timeout(5*HZ); every five seconds an
atomic page allocation failure report from kblockd failing to allocate a
sense_buffer in __scsi_get_command.

__scsi_get_command has a (one item) free_list to protect against this,
but rc1's [SCSI] use dynamically allocated sense buffer
de25deb18016f66dcdede165d07654559bb332bc upset that slightly.  When it
fails to allocate from the separate sense_slab, instead of giving up, it
must fall back to the command free_list, which is sure to have a
sense_buffer attached.

Either my earlier -rc testing missed this, or there's some recent
contributory factor.  One very significant factor is SLUB, which merges
slab caches when it can, and on 64-bit happens to merge both bio cache
and sense_slab cache into kmalloc's 128-byte cache: so that under this
swapping load, bios above are liable to gobble up all the slots needed
for scsi_cmnd sense_buffers below.

That's disturbing behaviour, and I tried a few things to fix it.  Adding
a no-op constructor to the sense_slab inhibits SLUB from merging it, and
stops all the allocation failures I was seeing; but it's rather a hack,
and perhaps in different configurations we have other caches on the
swapout path which are ill-merged.

Another alternative is to revert the separate sense_slab, using
cache-line-aligned sense_buffer allocated beyond scsi_cmnd from the one
kmem_cache; but that might waste more memory, and is only a way of
diverting around the known problem.

While I don't like seeing the allocation failures, and hate the idea of
all those bios piled up above a scsi host working one by one, it does
seem to emerge fairly soon with the livelock fix.  So lacking better
ideas, stick with that one clear fix for now.

Signed-off-by: Hugh Dickins &lt;hugh@veritas.com&gt;
Cc: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Cc: Jens Axboe &lt;jens.axboe@oracle.com&gt;
Cc: Christoph Lameter &lt;clameter@sgi.com&gt;
Cc: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Cc: Peter Zijlstra &lt;a.p.ziljstra@chello.nl&gt;
Cc: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Since 2.6.25-rc7, I've been seeing an occasional livelock on one x86_64
machine, copying kernel trees to tmpfs, paging out to swap.

Signature: 6000 pages under writeback but never getting written; most
tasks of interest trying to reclaim, but each get_swap_bio waiting for a
bio in mempool_alloc's io_schedule_timeout(5*HZ); every five seconds an
atomic page allocation failure report from kblockd failing to allocate a
sense_buffer in __scsi_get_command.

__scsi_get_command has a (one item) free_list to protect against this,
but rc1's [SCSI] use dynamically allocated sense buffer
de25deb18016f66dcdede165d07654559bb332bc upset that slightly.  When it
fails to allocate from the separate sense_slab, instead of giving up, it
must fall back to the command free_list, which is sure to have a
sense_buffer attached.

Either my earlier -rc testing missed this, or there's some recent
contributory factor.  One very significant factor is SLUB, which merges
slab caches when it can, and on 64-bit happens to merge both bio cache
and sense_slab cache into kmalloc's 128-byte cache: so that under this
swapping load, bios above are liable to gobble up all the slots needed
for scsi_cmnd sense_buffers below.

That's disturbing behaviour, and I tried a few things to fix it.  Adding
a no-op constructor to the sense_slab inhibits SLUB from merging it, and
stops all the allocation failures I was seeing; but it's rather a hack,
and perhaps in different configurations we have other caches on the
swapout path which are ill-merged.

Another alternative is to revert the separate sense_slab, using
cache-line-aligned sense_buffer allocated beyond scsi_cmnd from the one
kmem_cache; but that might waste more memory, and is only a way of
diverting around the known problem.

While I don't like seeing the allocation failures, and hate the idea of
all those bios piled up above a scsi host working one by one, it does
seem to emerge fairly soon with the livelock fix.  So lacking better
ideas, stick with that one clear fix for now.

Signed-off-by: Hugh Dickins &lt;hugh@veritas.com&gt;
Cc: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Cc: Jens Axboe &lt;jens.axboe@oracle.com&gt;
Cc: Christoph Lameter &lt;clameter@sgi.com&gt;
Cc: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Cc: Peter Zijlstra &lt;a.p.ziljstra@chello.nl&gt;
Cc: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] mvsas: check subsystem id</title>
<updated>2008-03-28T17:32:22+00:00</updated>
<author>
<name>Ke Wei</name>
<email>kewei@marvell.com</email>
</author>
<published>2008-03-27T06:55:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0b977608e6c8ba2d40445999bbcac8b411bf3f6a'/>
<id>0b977608e6c8ba2d40445999bbcac8b411bf3f6a</id>
<content type='text'>
add support for mv6480 chip which subsystem id is 6480 in spite of device id is 6440.

Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
add support for mv6480 chip which subsystem id is 6480 in spite of device id is 6440.

Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] mvsas: get phy info.</title>
<updated>2008-03-28T17:32:09+00:00</updated>
<author>
<name>Ke Wei</name>
<email>kewei@marvell.com</email>
</author>
<published>2008-03-27T06:55:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=e9ff91b6927079307b5d481a93beac4134e923eb'/>
<id>e9ff91b6927079307b5d481a93beac4134e923eb</id>
<content type='text'>
removed unused code and attached SATA address makes use of port id.
enable HBA interrupt after calling sas_register_ha();

Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
removed unused code and attached SATA address makes use of port id.
enable HBA interrupt after calling sas_register_ha();

Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] mvsas: fix the buffer of rx DMA overflow bug</title>
<updated>2008-03-28T17:31:54+00:00</updated>
<author>
<name>Ke Wei</name>
<email>kewei@marvell.com</email>
</author>
<published>2008-03-27T06:55:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=963829e650516d140e1f2ddaa6c9ba7cce4c2c6a'/>
<id>963829e650516d140e1f2ddaa6c9ba7cce4c2c6a</id>
<content type='text'>
fix the buffer of rx DMA overflow bug.
fix default queue depth.

Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fix the buffer of rx DMA overflow bug.
fix default queue depth.

Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] mvsas: retry aborting task.</title>
<updated>2008-03-28T17:31:40+00:00</updated>
<author>
<name>Ke Wei</name>
<email>kewei@marvell.com</email>
</author>
<published>2008-03-27T06:55:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=8121ed420285885654af133a6ca1919590f98917'/>
<id>8121ed420285885654af133a6ca1919590f98917</id>
<content type='text'>
Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] mvsas: check hd whether unplugged</title>
<updated>2008-03-28T17:31:25+00:00</updated>
<author>
<name>Ke Wei</name>
<email>kewei@marvell.com</email>
</author>
<published>2008-03-27T06:54:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4e52fc0a0a2ec2158691efba3f149f6416481255'/>
<id>4e52fc0a0a2ec2158691efba3f149f6416481255</id>
<content type='text'>
if unplugged, driver's queuecommand function will return SAS_PHY_DOWN.
task-&gt;lldd_task is used for saving its slot info.

Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
if unplugged, driver's queuecommand function will return SAS_PHY_DOWN.
task-&gt;lldd_task is used for saving its slot info.

Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] mvsas : interrupt handling</title>
<updated>2008-03-28T17:31:03+00:00</updated>
<author>
<name>Ke Wei</name>
<email>kewei@marvell.com</email>
</author>
<published>2008-03-27T06:54:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=1fce5e5da03b18505179882be27cc697f24d6b58'/>
<id>1fce5e5da03b18505179882be27cc697f24d6b58</id>
<content type='text'>
When a slot is busy, we will not free this slot until slot reset is
completed.  When unplugged the disk, we should release all command
tasks with unplugged port that have been sent.

If MVS_USE_TASKLET is defined, we can enable tasklet. Default is off.

Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a slot is busy, we will not free this slot until slot reset is
completed.  When unplugged the disk, we should release all command
tasks with unplugged port that have been sent.

If MVS_USE_TASKLET is defined, we can enable tasklet. Default is off.

Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] mvsas: a tag handler implementation</title>
<updated>2008-03-28T17:27:54+00:00</updated>
<author>
<name>Ke Wei</name>
<email>kewei@marvell.com</email>
</author>
<published>2008-03-27T06:53:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=ee1f1c2ef95258351e1ecb89a2dbd2763cb3a6ed'/>
<id>ee1f1c2ef95258351e1ecb89a2dbd2763cb3a6ed</id>
<content type='text'>
add a new tag handler to create slot num. When a slot num is busy, new
task can't hit this bit which was already used.  plumb in phy speeds.

Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
add a new tag handler to create slot num. When a slot num is busy, new
task can't hit this bit which was already used.  plumb in phy speeds.

Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] mvsas: fill in error info record and phy mode6 bits.</title>
<updated>2008-03-28T17:27:16+00:00</updated>
<author>
<name>Ke Wei</name>
<email>kewei@marvell.com</email>
</author>
<published>2008-03-27T06:53:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0eb9ddd82a5cb08f3622345e723d236eefa0039f'/>
<id>0eb9ddd82a5cb08f3622345e723d236eefa0039f</id>
<content type='text'>
and remove some unused members from struct.

Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
and remove some unused members from struct.

Signed-off-by: Ke Wei &lt;kewei@marvell.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] libsas: Warn if ATA device detected but CONFIG_SCSI_SAS_ATA not set</title>
<updated>2008-03-27T22:12:16+00:00</updated>
<author>
<name>James Bottomley</name>
<email>James.Bottomley@HansenPartnership.com</email>
</author>
<published>2008-03-26T16:26:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=15c73d5afd9f7489ca6a71cd0bef60f94c0c85a8'/>
<id>15c73d5afd9f7489ca6a71cd0bef60f94c0c85a8</id>
<content type='text'>
We give a very cryptic error if an ATA device is seen on a SAS port
but libsas isn't compiled to include libata to handle them.  Add an
extra warning to explain specifically what the problem is.

Acked-by: Darrick J. Wong &lt;djwong@us.ibm.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We give a very cryptic error if an ATA device is seen on a SAS port
but libsas isn't compiled to include libata to handle them.  Add an
extra warning to explain specifically what the problem is.

Acked-by: Darrick J. Wong &lt;djwong@us.ibm.com&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
