Re: RFC: Allow block drivers to poll for I/O instead of sleeping

2013-06-23 Thread Ingo Molnar
* Matthew Wilcox wrote: > > A paper at FAST2012 > (http://static.usenix.org/events/fast12/tech/full_papers/Yang.pdf) pointed > out the performance overhead of taking interrupts for low-latency block > I/Os. The solution the author investigated was to spin waiting for each > I/O to complete. T

[PATCH 1/1] scsi: qla2xxx: change some variables to hexadecimal string via %*phC or %*phN format

2013-06-23 Thread Oleksandr Khoshaba
The patch modifies some variables using the format '%*ph[CN]' and prints them as a hexadecimal string with the separator ':' or ''. Signed-off-by: Oleksandr Khoshaba --- drivers/scsi/qla2xxx/qla_bsg.c |8 +--- drivers/scsi/qla2xxx/qla_gs.c | 82 ++-

[PATCH v3 0/4] introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-23 Thread Akinobu Mita
This patch set introduces sg_pcopy_from_buffer() and sg_pcopy_to_buffer(), which copy data between a linear buffer and an SG list. The only difference between sg_pcopy_{from,to}_buffer() and sg_copy_{from,to}_buffer() is an additional argument that specifies the number of bytes to skip the SG list

[PATCH v3 2/4] lib/scatterlist: introduce sg_pcopy_from_buffer() and sg_pcopy_to_buffer()

2013-06-23 Thread Akinobu Mita
The only difference between sg_pcopy_{from,to}_buffer() and sg_copy_{from,to}_buffer() is an additional argument that specifies the number of bytes to skip the SG list before copying. Signed-off-by: Akinobu Mita Cc: Tejun Heo Cc: Imre Deak Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-cry...

[PATCH v3 4/4] scsi_debug: fix do_device_access() with wrap around range

2013-06-23 Thread Akinobu Mita
do_device_access() is a function that abstracts copying SG list from/to ramdisk storage (fake_storep). It must deal with the ranges exceeding actual fake_storep size, because such ranges are valid if virtual_gb is set greater than zero, and they should be treated as fake_storep is repeatedly mirro

[PATCH v3 1/4] lib/scatterlist: factor out sg_miter_get_next_page() from sg_miter_next()

2013-06-23 Thread Akinobu Mita
This function is used to proceed page iterator to the next page if necessary, and will be used to implement the variants of sg_copy_{from,to}_buffer() later. Signed-off-by: Akinobu Mita Acked-by: Tejun Heo Cc: Tejun Heo Cc: Imre Deak Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-cry...@vger

[PATCH 24/45] [SCSI] fcoe: Use get/put_online_cpus_atomic() to prevent CPU offline

2013-06-23 Thread Srivatsa S. Bhat
Once stop_machine() is gone from the CPU offline path, we won't be able to depend on disabling preemption to prevent CPUs from going offline from under us. Use the get/put_online_cpus_atomic() APIs to prevent CPUs from going offline, while invoking from atomic context. Cc: Robert Love Cc: "James

Re: JMicron JMB363 PCI SATA/IDE Card Support

2013-06-23 Thread Matthias Prager
I did some more digging and came up with a partial workaround: After adding the line: > { PCI_VDEVICE(JMICRON, 0x236f), board_ahci_ign_iferr }, (at line 301 of drivers/ata/ahci.c) The the sata ports of my two cards get detected and lspci -k shows they are using the ahci driver. My guess is t

Re: JMicron JMB363 PCI SATA/IDE Card Support

2013-06-23 Thread Matthias Prager
Looks like the RAID Mode is the default one and quirk_jmicron_ata() in drivers/pci/quirks.c is supposed to deal with it by changing the PCI device configuration ... this does not happen or does not have the desired result (maybe this is caused by working in a pass-trough environment?). - Matthias

Re: RFC: Allow block drivers to poll for I/O instead of sleeping

2013-06-23 Thread Linus Torvalds
On Sun, Jun 23, 2013 at 12:09 AM, Ingo Molnar wrote: > > The spinning approach you add has the disadvantage of actively wasting CPU > time, which could be used to run other tasks. In general it's much better > to make sure the completion IRQs are rate-limited and just schedule. This > (combined wi

Re: [trivial] treewide: Add __GFP_NOWARN to k.alloc calls with v.alloc fallbacks

2013-06-23 Thread Theodore Ts'o
On Wed, Jun 19, 2013 at 12:15:53PM -0700, Joe Perches wrote: > Don't emit OOM warnings when k.alloc calls fail when > there there is a v.alloc immediately afterwards. > > Signed-off-by: Joe Perches For fs/ext4/super.c: Acked-by: "Theodore Ts'o" - Ted --

Re: eh_abort_handler implementations

2013-06-23 Thread Mike Christie
On 06/12/2013 05:28 AM, Hannes Reinecke wrote: > Hi all, > > as you might know, I'm trying to revamp the eh_abort_handler > implementation by sending command aborts directly whenever > the timeout triggers, without entering SCSI EH. > > So, during testing where the remote port is disabled I've se

Re: [PATCH 07/14] scsi_transport_srp: Add transport layer error handling

2013-06-23 Thread Mike Christie
On 06/12/2013 08:28 AM, Bart Van Assche wrote: > + /* > + * It can occur that after fast_io_fail_tmo expired and before > + * dev_loss_tmo expired that the SCSI error handler has > + * offlined one or more devices. scsi_target_unblock() doesn't > +

Re: [PATCH v11 3/9] Avoid calling __scsi_remove_device() twice

2013-06-23 Thread Mike Christie
On 06/12/2013 07:52 AM, Bart Van Assche wrote: > SCSI devices are added to the shost->__devices list from inside > scsi_alloc_sdev(). If something goes wrong during LUN scanning, > e.g. a transport layer failure occurs, then __scsi_remove_device() > can get invoked by the LUN scanning code for a SC

Re: RFC: Allow block drivers to poll for I/O instead of sleeping

2013-06-23 Thread David Ahern
On 6/23/13 3:09 AM, Ingo Molnar wrote: If an IO driver is implemented properly then it will batch up requests for the controller, and gets IRQ-notified on a (sub-)batch of buffers completed. If there's any spinning done then it should be NAPI-alike polling: a single "is stuff completed" polling

Re: [PATCH v11 4/9] Disallow changing the device state via sysfs into "deleted"

2013-06-23 Thread Mike Christie
On 6/12/13 7:53 AM, Bart Van Assche wrote: Changing the state of a SCSI device via sysfs into "cancel" or "deleted" prevents removal of these devices by scsi_remove_host(). Hence do not allow this. Also, introduce the symbolic name INVALID_SDEV_STATE, representing a value different from any valid

Re: [PATCH v11 5/9] Avoid saving/restoring interrupt state inside scsi_remove_host()

2013-06-23 Thread Mike Christie
On 6/12/13 7:54 AM, Bart Van Assche wrote: Since it is not allowed to invoke scsi_remove_host() with interrupts disabled, avoid saving and restoring the interrupt state inside scsi_remove_host(). This patch does not change the functionality of the function scsi_remove_host(). Signed-off-by: Bart

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-23 Thread Mike Christie
On 6/12/13 7:55 AM, Bart Van Assche wrote: A SCSI LLD may start cleaning up host resources as soon as scsi_remove_host() returns. These host resources may be needed by the LLD in an implementation of one of the eh_* functions. So if one of the eh_* functions is in progress when scsi_remove_host()

Re: [PATCH v11 8/9] Save and restore host_scribble during error handling

2013-06-23 Thread Mike Christie
On 6/12/13 7:57 AM, Bart Van Assche wrote: A SCSI LLD may overwrite host_scribble in its queuecommand() implementation. Several drivers need that field to process requests and aborts correctly. Hence this field must be saved by scsi_eh_prep_cmnd() and must be restored by scsi_eh_restore_cmnd().

Re: [PATCH v11 2/9] Remove get_device() / put_device() pair from scsi_request_fn()

2013-06-23 Thread Mike Christie
On 6/12/13 7:51 AM, Bart Van Assche wrote: Now that all scsi_request_fn() callers hold a reference on the SCSI device that function is invoked for and since blk_cleanup_queue() waits until scsi_request_fn() has finished it is safe to remove the get_device() / put_device() pair from scsi_request_f

Re: [PATCH v11 8/9] Save and restore host_scribble during error handling

2013-06-23 Thread James Bottomley
On Sun, 2013-06-23 at 20:21 -0500, Mike Christie wrote: > On 6/12/13 7:57 AM, Bart Van Assche wrote: > > A SCSI LLD may overwrite host_scribble in its queuecommand() > > implementation. Several drivers need that field to process > > requests and aborts correctly. Hence this field must be saved > >

Re: [PATCH v11 2/9] Remove get_device() / put_device() pair from scsi_request_fn()

2013-06-23 Thread James Bottomley
On Wed, 2013-06-12 at 14:51 +0200, Bart Van Assche wrote: > Now that all scsi_request_fn() callers hold a reference on the > SCSI device that function is invoked for What makes you think that this is a true statement? The usual caller is the block layer, which doesn't really know anything about t

Re: [PATCH v11 3/9] Avoid calling __scsi_remove_device() twice

2013-06-23 Thread Bart Van Assche
On 06/23/13 23:35, Mike Christie wrote: On 06/12/2013 07:52 AM, Bart Van Assche wrote: SCSI devices are added to the shost->__devices list from inside scsi_alloc_sdev(). If something goes wrong during LUN scanning, e.g. a transport layer failure occurs, then __scsi_remove_device() can get invoke

Re: [PATCH v11 4/9] Disallow changing the device state via sysfs into "deleted"

2013-06-23 Thread Bart Van Assche
On 06/24/13 03:05, Mike Christie wrote: On 6/12/13 7:53 AM, Bart Van Assche wrote: Changing the state of a SCSI device via sysfs into "cancel" or "deleted" prevents removal of these devices by scsi_remove_host(). Hence do not allow this. Also, introduce the symbolic name INVALID_SDEV_STATE, repr

Re: [PATCH v11 6/9] Make scsi_remove_host() wait until error handling finished

2013-06-23 Thread Bart Van Assche
On 06/24/13 03:15, Mike Christie wrote: > On 6/12/13 7:55 AM, Bart Van Assche wrote: >> A SCSI LLD may start cleaning up host resources as soon as >> scsi_remove_host() returns. These host resources may be needed by >> the LLD in an implementation of one of the eh_* functions. So if >> one of the e