Re: [v6 PATCH 0/8] csiostor: Chelsio FCoE offload driver submission

2012-11-02 Thread Naresh Kumar Inna
Hi James,

Could you please let me know where we are with the review of this driver?

Thanks,
Naresh.

On 10/25/2012 3:20 PM, Naresh Kumar Inna wrote:
 This is the initial submission of the Chelsio FCoE offload driver (csiostor)
 to the upstream kernel. This driver currently supports FCoE offload
 functionality over Chelsio T4-based 10Gb Converged Network Adapters.
 
 The following patches contain the driver sources for csiostor driver and
 updates to firmware/hardware header files shared between csiostor,
 cxgb4 (Chelsio T4-based NIC driver) and cxgb4vf (Chelsio T4-based Virtual
 Function NIC driver). The csiostor driver is dependent on these
 header updates. These patches have been generated against scsi 'misc' branch.
 
 csiostor is a low level SCSI driver that interfaces with PCI, SCSI midlayer 
 and
 FC transport subsystems. This driver claims the FCoE PCIe function on
 Chelsio Converged Network Adapters. It relies on firmware events for slow path
 operations like discovery, thereby offloading session management. The driver
 programs firmware via Work Request interfaces for fast path I/O offload
 features.
 
 v6 has changes to make csiostor work with cxgb4 header files post 3.6 merge, 
 as
 well as a few bug fixes in csiostor.
 
 Here is the brief description of patches:
 [v6 PATCH 1/8]: Updates to header files shared between cxgb4, cxgb4vf and
 csiostor.
 [v6 PATCH 2/8]: Header files part 1.
 [v6 PATCH 3/8]: Header files part 2.
 [v6 PATCH 4/8]: Driver initialization and Work Request services.
 [v6 PATCH 5/8]: FC transport interfaces and mailbox services.
 [v6 PATCH 6/8]: Local and remote port state tracking functionality.
 [v6 PATCH 7/8]: Interrupt handling and fast path I/O functionality.
 [v6 PATCH 8/8]: Hardware interface, Makefile and Kconfig changes.
 
 Naresh Kumar Inna (8):
   cxgb4/cxgb4vf: Chelsio FCoE offload driver submission (common header
 updates).
   csiostor: Chelsio FCoE offload driver submission (headers part 1).
   csiostor: Chelsio FCoE offload driver submission (headers part 2).
   csiostor: Chelsio FCoE offload driver submission (sources part 1).
   csiostor: Chelsio FCoE offload driver submission (sources part 2).
   csiostor: Chelsio FCoE offload driver submission (sources part 3).
   csiostor: Chelsio FCoE offload driver submission (sources part 4).
   csiostor: Chelsio FCoE offload driver submission (sources part 5).
 
  drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |8 +-
  drivers/net/ethernet/chelsio/cxgb4/sge.c|6 +-
  drivers/net/ethernet/chelsio/cxgb4/t4_hw.c  |   20 +-
  drivers/net/ethernet/chelsio/cxgb4/t4_msg.h |1 +
  drivers/net/ethernet/chelsio/cxgb4/t4_regs.h|   36 +-
  drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h   |   41 +-
  drivers/net/ethernet/chelsio/cxgb4vf/sge.c  |8 +-
  drivers/scsi/Kconfig|1 +
  drivers/scsi/Makefile   |1 +
  drivers/scsi/csiostor/Kconfig   |   19 +
  drivers/scsi/csiostor/Makefile  |   11 +
  drivers/scsi/csiostor/csio_attr.c   |  796 
  drivers/scsi/csiostor/csio_defs.h   |  121 +
  drivers/scsi/csiostor/csio_hw.c | 4395 
 +++
  drivers/scsi/csiostor/csio_hw.h |  667 
  drivers/scsi/csiostor/csio_init.c   | 1274 +++
  drivers/scsi/csiostor/csio_init.h   |  158 +
  drivers/scsi/csiostor/csio_isr.c|  624 
  drivers/scsi/csiostor/csio_lnode.c  | 2133 +++
  drivers/scsi/csiostor/csio_lnode.h  |  255 ++
  drivers/scsi/csiostor/csio_mb.c | 1770 +
  drivers/scsi/csiostor/csio_mb.h |  278 ++
  drivers/scsi/csiostor/csio_rnode.c  |  912 +
  drivers/scsi/csiostor/csio_rnode.h  |  141 +
  drivers/scsi/csiostor/csio_scsi.c   | 2555 +
  drivers/scsi/csiostor/csio_scsi.h   |  342 ++
  drivers/scsi/csiostor/csio_wr.c | 1632 +
  drivers/scsi/csiostor/csio_wr.h |  512 +++
  drivers/scsi/csiostor/t4fw_api_stor.h   |  578 +++
  29 files changed, 19267 insertions(+), 28 deletions(-)
  create mode 100644 drivers/scsi/csiostor/Kconfig
  create mode 100644 drivers/scsi/csiostor/Makefile
  create mode 100644 drivers/scsi/csiostor/csio_attr.c
  create mode 100644 drivers/scsi/csiostor/csio_defs.h
  create mode 100644 drivers/scsi/csiostor/csio_hw.c
  create mode 100644 drivers/scsi/csiostor/csio_hw.h
  create mode 100644 drivers/scsi/csiostor/csio_init.c
  create mode 100644 drivers/scsi/csiostor/csio_init.h
  create mode 100644 drivers/scsi/csiostor/csio_isr.c
  create mode 100644 drivers/scsi/csiostor/csio_lnode.c
  create mode 100644 drivers/scsi/csiostor/csio_lnode.h
  create mode 100644 drivers/scsi/csiostor/csio_mb.c
  create mode 100644 drivers/scsi/csiostor/csio_mb.h
  create mode 100644 

Re: [PATCH 6/7] Fix race between starved list processing and device removal

2012-11-02 Thread Bart Van Assche
On 10/30/12 06:40, Zhuang, Jin Can wrote:
 Yes. Here's the warning.
 For the trace below, I used scsi_device_get/scsi_device_put() in 
 scsi_run_queue(). (A little different from your patch). But I think it's the 
 same.
 
 10-23 18:15:53.309 8 8 I KERNEL  : [  268.994556] BUG: sleeping 
 function called from invalid context at linux-2.6/kernel/workqueue.c:2500
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.006898] in_atomic(): 0, 
 irqs_disabled(): 1, pid: 8, name: kworker/0:1
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.013689] Pid: 8, comm: 
 kworker/0:1 Tainted: GWC  3.0.34-140359-g85a6d67-dirty #43
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.022113] Call Trace:
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.028828]  [c123464a] 
 __might_sleep+0x10a/0x110
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.033695]  [c12628a3] 
 wait_on_work+0x23/0x1a0
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.054913]  [c126472a] 
 __cancel_work_timer+0x6a/0x110
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.060217]  [c12647ff] 
 cancel_work_sync+0xf/0x20
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.065087]  [c1548d5d] 
 scsi_device_dev_release_usercontext+0x6d/0x100
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.071785]  [c12626a2] 
 execute_in_process_context+0x42/0x50
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.077609]  [c1548cc8] 
 scsi_device_dev_release+0x18/0x20
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.083174]  [c15234a0] 
 device_release+0x20/0x80
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.092479]  [c148d1b4] 
 kobject_release+0x84/0x1f0
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.107430]  [c148e8ec] 
 kref_put+0x2c/0x60
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.111688]  [c148d06d] 
 kobject_put+0x1d/0x50
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.116209]  [c15232a4] 
 put_device+0x14/0x20
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.120646]  [c153daa7] 
 scsi_device_put+0x37/0x60
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.125515]  [c1543cc7] 
 scsi_run_queue+0x247/0x320
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.130470]  [c1545903] 
 scsi_requeue_run_queue+0x13/0x20
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.135941]  [c1263efe] 
 process_one_work+0xfe/0x3f0
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.146384]  [c12644f1] 
 worker_thread+0x121/0x2f0
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.156383]  [c1267ffd] 
 kthread+0x6d/0x80
 10-23 18:15:53.309 8 8 I KERNEL  : [  269.166124]  [c186a27a] 
 kernel_thread_helper+0x6/0x10

Thanks for the feedback. Something that kept me busy since I posted
the patch at the start of this thread is how to avoid adding two
atomic operations in a hot path (the get_device() and put_device()
calls in scsi_run_queue()). The patch below should realize that.
However, since I haven't been able so far to trigger the above call
trace that means that the test I ran wasn't sufficient to trigger
all code paths. So it would be appreciated if anyone could help
testing the patch below.

[PATCH] Fix race between starved list processing and device removal

---
 block/blk-core.c  |9 +
 drivers/scsi/scsi_lib.c   |   20 ++--
 drivers/scsi/scsi_sysfs.c |9 -
 3 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index e4f4e06..565484f 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -407,10 +407,11 @@ static void __blk_drain_queue(struct request_queue *q, 
bool drain_all)
 
/*
 * This function might be called on a queue which failed
-* driver init after queue creation or is not yet fully
-* active yet.  Some drivers (e.g. fd and loop) get unhappy
-* in such cases.  Kick queue iff dispatch queue has
-* something on it and @q has request_fn set.
+* driver init after queue creation, is not yet fully active
+* or is being cleaned up and doesn't make progress anymore
+* (e.g. a SCSI device in state SDEV_DEL). Kick queue iff
+* dispatch queue has something on it and @q has request_fn
+* set.
 */
if (!list_empty(q-queue_head)  q-request_fn)
__blk_run_queue(q);
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 488035b..1763181 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -447,8 +447,9 @@ static void scsi_run_queue(struct request_queue *q)
  struct scsi_device, starved_entry);
list_del_init(sdev-starved_entry);
if (scsi_target_is_busy(scsi_target(sdev))) {
-   list_move_tail(sdev-starved_entry,
-  shost-starved_list);
+   if (sdev-sdev_state != 

Re: [patch 01/10] scsi: make __scsi_alloc_queue numa-aware

2012-11-02 Thread Bart Van Assche

On 10/30/12 21:14, Jeff Moyer wrote:

Pass the numa node id set in the Scsi_Host on to blk_init_queue_node
in order to keep all allocations local to the numa node the device is
closest to.

Signed-off-by: Jeff Moyer jmo...@redhat.com
---
  drivers/scsi/scsi_lib.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index da36a3a..8662a09 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1664,7 +1664,7 @@ struct request_queue *__scsi_alloc_queue(struct Scsi_Host 
*shost,
struct request_queue *q;
struct device *dev = shost-dma_dev;

-   q = blk_init_queue(request_fn, NULL);
+   q = blk_init_queue_node(request_fn, NULL, shost-numa_node);
if (!q)
return NULL;


Hello Jeff,

I haven't seen the patch that introduces numa_node in struct Scsi_Host 
nor the cover letter of this patch series ? Have these been posted on 
the linux-scsi mailing list ?


Bart.



--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 01/10] scsi: make __scsi_alloc_queue numa-aware

2012-11-02 Thread Jeff Moyer
Bart Van Assche bvanass...@acm.org writes:

 On 10/30/12 21:14, Jeff Moyer wrote:
 Pass the numa node id set in the Scsi_Host on to blk_init_queue_node
 in order to keep all allocations local to the numa node the device is
 closest to.

 Signed-off-by: Jeff Moyer jmo...@redhat.com
 ---
   drivers/scsi/scsi_lib.c |2 +-
   1 files changed, 1 insertions(+), 1 deletions(-)

 diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
 index da36a3a..8662a09 100644
 --- a/drivers/scsi/scsi_lib.c
 +++ b/drivers/scsi/scsi_lib.c
 @@ -1664,7 +1664,7 @@ struct request_queue *__scsi_alloc_queue(struct 
 Scsi_Host *shost,
  struct request_queue *q;
  struct device *dev = shost-dma_dev;

 -q = blk_init_queue(request_fn, NULL);
 +q = blk_init_queue_node(request_fn, NULL, shost-numa_node);
  if (!q)
  return NULL;

 Hello Jeff,

 I haven't seen the patch that introduces numa_node in struct Scsi_Host
 nor the cover letter of this patch series ? Have these been posted on
 the linux-scsi mailing list ?

Hi, Bart,

Wow, looks like I left out the first patch!  The cover letter I think
only went to lkml.  I have to do a repost, so I'll be sure to send the
cover to linux-scsi as well, and CC you (and credit you for the idea,
which I totally forgot to do).  I'll send a repost out today.

Cheers,
Jeff
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch,v2 09/10] lpfc: use scsi_host_alloc_node

2012-11-02 Thread Jeff Moyer
Acked-By: James Smart  james.sm...@emulex.com
Signed-off-by: Jeff Moyer jmo...@redhat.com
---
 drivers/scsi/lpfc/lpfc_init.c |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 7dc4218..65956d3 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -3051,11 +3051,13 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, 
struct device *dev)
int error = 0;
 
if (dev != phba-pcidev-dev)
-   shost = scsi_host_alloc(lpfc_vport_template,
-   sizeof(struct lpfc_vport));
+   shost = scsi_host_alloc_node(lpfc_vport_template,
+sizeof(struct lpfc_vport),
+dev_to_node(phba-pcidev-dev));
else
-   shost = scsi_host_alloc(lpfc_template,
-   sizeof(struct lpfc_vport));
+   shost = scsi_host_alloc_node(lpfc_template,
+sizeof(struct lpfc_vport),
+dev_to_node(phba-pcidev-dev));
if (!shost)
goto out;
 
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch,v2 07/10] megaraid_sas: use scsi_host_alloc_node

2012-11-02 Thread Jeff Moyer

Signed-off-by: Jeff Moyer jmo...@redhat.com
---
 drivers/scsi/megaraid/megaraid_sas_base.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c 
b/drivers/scsi/megaraid/megaraid_sas_base.c
index d2c5366..707a6cd 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -4020,8 +4020,9 @@ megasas_probe_one(struct pci_dev *pdev, const struct 
pci_device_id *id)
if (megasas_set_dma_mask(pdev))
goto fail_set_dma_mask;
 
-   host = scsi_host_alloc(megasas_template,
-  sizeof(struct megasas_instance));
+   host = scsi_host_alloc_node(megasas_template,
+   sizeof(struct megasas_instance),
+   dev_to_node(pdev-dev));
 
if (!host) {
printk(KERN_DEBUG megasas: scsi_host_alloc failed\n);
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch,v2 06/10] ata: use scsi_host_alloc_node

2012-11-02 Thread Jeff Moyer

Signed-off-by: Jeff Moyer jmo...@redhat.com
---
 drivers/ata/libata-scsi.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index e3bda07..9d5dd09 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3586,7 +3586,8 @@ int ata_scsi_add_hosts(struct ata_host *host, struct 
scsi_host_template *sht)
struct Scsi_Host *shost;
 
rc = -ENOMEM;
-   shost = scsi_host_alloc(sht, sizeof(struct ata_port *));
+   shost = scsi_host_alloc_node(sht, sizeof(struct ata_port *),
+dev_to_node(host-dev));
if (!shost)
goto err_alloc;
 
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch,v2 01/10] scsi: add scsi_host_alloc_node

2012-11-02 Thread Jeff Moyer
Allow an LLD to specify on which numa node to allocate scsi data
structures.  Thanks to Bart Van Assche for the suggestion.

Signed-off-by: Jeff Moyer jmo...@redhat.com
---
 drivers/scsi/hosts.c |   13 +++--
 include/scsi/scsi_host.h |8 
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 593085a..7d7ad8b 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -336,16 +336,25 @@ static struct device_type scsi_host_type = {
  **/
 struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
 {
+   return scsi_host_alloc_node(sht, privsize, -1);
+}
+EXPORT_SYMBOL(scsi_host_alloc);
+
+struct Scsi_Host *scsi_host_alloc_node(struct scsi_host_template *sht,
+  int privsize, int node)
+{
struct Scsi_Host *shost;
gfp_t gfp_mask = GFP_KERNEL;
 
if (sht-unchecked_isa_dma  privsize)
gfp_mask |= __GFP_DMA;
 
-   shost = kzalloc(sizeof(struct Scsi_Host) + privsize, gfp_mask);
+   shost = kzalloc_node(sizeof(struct Scsi_Host) + privsize,
+gfp_mask, node);
if (!shost)
return NULL;
 
+   shost-numa_node = node;
shost-host_lock = shost-default_lock;
spin_lock_init(shost-host_lock);
shost-shost_state = SHOST_CREATED;
@@ -443,7 +452,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template 
*sht, int privsize)
kfree(shost);
return NULL;
 }
-EXPORT_SYMBOL(scsi_host_alloc);
+EXPORT_SYMBOL(scsi_host_alloc_node);
 
 struct Scsi_Host *scsi_register(struct scsi_host_template *sht, int privsize)
 {
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 4908480..a1b5c8e 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -733,6 +733,12 @@ struct Scsi_Host {
struct device *dma_dev;
 
/*
+* Numa node this device is closest to, used for allocating
+* data structures locally.
+*/
+   int numa_node;
+
+   /*
 * We should ensure that this is aligned, both for better performance
 * and also because some compilers (m68k) don't automatically force
 * alignment to a long boundary.
@@ -776,6 +782,8 @@ extern int scsi_queue_work(struct Scsi_Host *, struct 
work_struct *);
 extern void scsi_flush_work(struct Scsi_Host *);
 
 extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *, int);
+extern struct Scsi_Host *scsi_host_alloc_node(struct scsi_host_template *,
+ int, int);
 extern int __must_check scsi_add_host_with_dma(struct Scsi_Host *,
   struct device *,
   struct device *);
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch,v2 02/10] scsi: make __scsi_alloc_queue numa-aware

2012-11-02 Thread Jeff Moyer
Pass the numa node id set in the Scsi_Host on to blk_init_queue_node
in order to keep all allocations local to the numa node the device is
closest to.

Signed-off-by: Jeff Moyer jmo...@redhat.com
---
 drivers/scsi/scsi_lib.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index da36a3a..8662a09 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1664,7 +1664,7 @@ struct request_queue *__scsi_alloc_queue(struct Scsi_Host 
*shost,
struct request_queue *q;
struct device *dev = shost-dma_dev;
 
-   q = blk_init_queue(request_fn, NULL);
+   q = blk_init_queue_node(request_fn, NULL, shost-numa_node);
if (!q)
return NULL;
 
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch,v2 05/10] sd: use alloc_disk_node

2012-11-02 Thread Jeff Moyer

Signed-off-by: Jeff Moyer jmo...@redhat.com
---
 drivers/scsi/sd.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 12f6fdf..8deb915 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2714,7 +2714,7 @@ static int sd_probe(struct device *dev)
if (!sdkp)
goto out;
 
-   gd = alloc_disk(SD_MINORS);
+   gd = alloc_disk_node(SD_MINORS, dev_to_node(dev));
if (!gd)
goto out_free;
 
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch,v2 08/10] mpt2sas: use scsi_host_alloc_node

2012-11-02 Thread Jeff Moyer

Signed-off-by: Jeff Moyer jmo...@redhat.com
---
 drivers/scsi/mpt2sas/mpt2sas_scsih.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c 
b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index af4e6c4..a4d6b36 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -8011,8 +8011,8 @@ _scsih_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
struct MPT2SAS_ADAPTER *ioc;
struct Scsi_Host *shost;
 
-   shost = scsi_host_alloc(scsih_driver_template,
-   sizeof(struct MPT2SAS_ADAPTER));
+   shost = scsi_host_alloc_node(scsih_driver_template,
+   sizeof(struct MPT2SAS_ADAPTER), dev_to_node(pdev-dev));
if (!shost)
return -ENODEV;
 
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch,v2 04/10] scsi: allocate scsi_cmnd-s from the device's local numa node

2012-11-02 Thread Jeff Moyer

Signed-off-by: Jeff Moyer jmo...@redhat.com
---
 drivers/scsi/scsi.c |   17 +++--
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 2936b44..4db6973 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -173,16 +173,20 @@ static DEFINE_MUTEX(host_cmd_pool_mutex);
  * NULL on failure
  */
 static struct scsi_cmnd *
-scsi_pool_alloc_command(struct scsi_host_cmd_pool *pool, gfp_t gfp_mask)
+scsi_pool_alloc_command(struct scsi_host_cmd_pool *pool, gfp_t gfp_mask,
+   int node)
 {
struct scsi_cmnd *cmd;
 
-   cmd = kmem_cache_zalloc(pool-cmd_slab, gfp_mask | pool-gfp_mask);
+   cmd = kmem_cache_alloc_node(pool-cmd_slab,
+   gfp_mask | pool-gfp_mask | __GFP_ZERO,
+   node);
if (!cmd)
return NULL;
 
-   cmd-sense_buffer = kmem_cache_alloc(pool-sense_slab,
-gfp_mask | pool-gfp_mask);
+   cmd-sense_buffer = kmem_cache_alloc_node(pool-sense_slab,
+   gfp_mask | pool-gfp_mask | __GFP_ZERO,
+   node);
if (!cmd-sense_buffer) {
kmem_cache_free(pool-cmd_slab, cmd);
return NULL;
@@ -223,7 +227,8 @@ scsi_host_alloc_command(struct Scsi_Host *shost, gfp_t 
gfp_mask)
 {
struct scsi_cmnd *cmd;
 
-   cmd = scsi_pool_alloc_command(shost-cmd_pool, gfp_mask);
+   cmd = scsi_pool_alloc_command(shost-cmd_pool, gfp_mask,
+ shost-numa_node);
if (!cmd)
return NULL;
 
@@ -435,7 +440,7 @@ struct scsi_cmnd *scsi_allocate_command(gfp_t gfp_mask)
if (!pool)
return NULL;
 
-   return scsi_pool_alloc_command(pool, gfp_mask);
+   return scsi_pool_alloc_command(pool, gfp_mask, NUMA_NO_NODE);
 }
 EXPORT_SYMBOL(scsi_allocate_command);
 
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch,v2 03/10] scsi: make scsi_alloc_sdev numa-aware

2012-11-02 Thread Jeff Moyer
Use the numa node id set in the Scsi_Host to allocate the sdev structure
on the device-local numa node.

Signed-off-by: Jeff Moyer jmo...@redhat.com
---
 drivers/scsi/scsi_scan.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 3e58b22..f10a308 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -232,8 +232,8 @@ static struct scsi_device *scsi_alloc_sdev(struct 
scsi_target *starget,
extern void scsi_evt_thread(struct work_struct *work);
extern void scsi_requeue_run_queue(struct work_struct *work);
 
-   sdev = kzalloc(sizeof(*sdev) + shost-transportt-device_size,
-  GFP_ATOMIC);
+   sdev = kzalloc_node(sizeof(*sdev) + shost-transportt-device_size,
+   GFP_ATOMIC, shost-numa_node);
if (!sdev)
goto out;
 
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch,v2 10/10] cciss: use blk_init_queue_node

2012-11-02 Thread Jeff Moyer

Signed-off-by: Jeff Moyer jmo...@redhat.com
---
 drivers/block/cciss.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index b0f553b..5fe5546 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1930,7 +1930,8 @@ static void cciss_get_serial_no(ctlr_info_t *h, int 
logvol,
 static int cciss_add_disk(ctlr_info_t *h, struct gendisk *disk,
int drv_index)
 {
-   disk-queue = blk_init_queue(do_cciss_request, h-lock);
+   disk-queue = blk_init_queue_node(do_cciss_request, h-lock,
+ dev_to_node(h-dev));
if (!disk-queue)
goto init_queue_failure;
sprintf(disk-disk_name, cciss/c%dd%d, h-ctlr, drv_index);
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[GIT PULL] target fixes for v3.7-rc4 (round 2)

2012-11-02 Thread Nicholas A. Bellinger
Hello Linus,

This series is a second round of target fixes for v3.7-rc4 that have
come into target-devel over the last days, and are important enough to
be applied ASAP.  Please go ahead and pull from:

  git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master

All are being CC'ed to stable.  The most important two are:

- target: Re-add explict zeroing of INQUIRY bounce buffer memory to fix
a regression for handling zero-length payloads, a bug that went during
v3.7-rc1, and hit = v3.6.3 stable. (nab + paolo)
- iscsi-target: Fix a long-standing missed R2T wakeup race in TX thread
processing when using a single queue slot. (Roland)

Thanks to Roland  PureStorage team for helping to track down this long
standing race with iscsi-target single queue slot operation.

Also, the tcm_fc(FCoE) regression bug that was observed recently with
-rc2 code has also been resolved with the cancel_delayed_work() return
bugfix (commit c0158ca) now in -rc3.  Thanks again to Yi Zou, MDR,
Robert Love @ Intel for helping to track this down.

Thank you,

--nab

Nicholas Bellinger (1):
  target: Re-add explict zeroing of INQUIRY bounce buffer memory

Roland Dreier (3):
  target: Don't return success from module_init() if setup fails
  target: Avoid integer overflow in se_dev_align_max_sectors()
  iscsi-target: Fix missed wakeup race in TX thread

Steve Hodgson (1):
  target: Fix incorrect usage of nested IRQ spinlocks in ABORT_TASK
path

 drivers/target/iscsi/iscsi_target.c   |4 +++-
 drivers/target/iscsi/iscsi_target_core.h  |1 +
 drivers/target/iscsi/iscsi_target_login.c |1 +
 drivers/target/iscsi/iscsi_target_util.c  |   22 --
 drivers/target/iscsi/iscsi_target_util.h  |1 +
 drivers/target/target_core_configfs.c |3 ++-
 drivers/target/target_core_device.c   |   18 +-
 drivers/target/target_core_spc.c  |2 ++
 drivers/target/target_core_tmr.c  |6 +++---
 9 files changed, 42 insertions(+), 16 deletions(-)

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html