* [patch 01/10] scsi: make __scsi_alloc_queue numa-aware
[not found] <1351628084-29358-1-git-send-email-jmoyer@redhat.com>
@ 2012-10-30 20:14 ` Jeff Moyer
2012-11-02 11:31 ` Bart Van Assche
2012-10-30 20:14 ` [patch 02/10] scsi: make scsi_alloc_sdev numa-aware Jeff Moyer
` (5 subsequent siblings)
6 siblings, 1 reply; 10+ messages in thread
From: Jeff Moyer @ 2012-10-30 20:14 UTC (permalink / raw)
To: linux-kernel; +Cc: James E.J. Bottomley, linux-scsi
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 <jmoyer@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
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [patch 01/10] scsi: make __scsi_alloc_queue numa-aware
2012-10-30 20:14 ` [patch 01/10] scsi: make __scsi_alloc_queue numa-aware Jeff Moyer
@ 2012-11-02 11:31 ` Bart Van Assche
2012-11-02 14:19 ` Jeff Moyer
0 siblings, 1 reply; 10+ messages in thread
From: Bart Van Assche @ 2012-11-02 11:31 UTC (permalink / raw)
To: Jeff Moyer; +Cc: linux-kernel, James E.J. Bottomley, linux-scsi
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 <jmoyer@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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [patch 01/10] scsi: make __scsi_alloc_queue numa-aware
2012-11-02 11:31 ` Bart Van Assche
@ 2012-11-02 14:19 ` Jeff Moyer
0 siblings, 0 replies; 10+ messages in thread
From: Jeff Moyer @ 2012-11-02 14:19 UTC (permalink / raw)
To: Bart Van Assche; +Cc: linux-kernel, James E.J. Bottomley, linux-scsi
Bart Van Assche <bvanassche@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 <jmoyer@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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [patch 02/10] scsi: make scsi_alloc_sdev numa-aware
[not found] <1351628084-29358-1-git-send-email-jmoyer@redhat.com>
2012-10-30 20:14 ` [patch 01/10] scsi: make __scsi_alloc_queue numa-aware Jeff Moyer
@ 2012-10-30 20:14 ` Jeff Moyer
2012-10-30 20:14 ` [patch 03/10] scsi: allocate scsi_cmnd-s from the device's local numa node Jeff Moyer
` (4 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Jeff Moyer @ 2012-10-30 20:14 UTC (permalink / raw)
To: linux-kernel; +Cc: James E.J. Bottomley, linux-scsi
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 <jmoyer@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
^ permalink raw reply related [flat|nested] 10+ messages in thread* [patch 03/10] scsi: allocate scsi_cmnd-s from the device's local numa node
[not found] <1351628084-29358-1-git-send-email-jmoyer@redhat.com>
2012-10-30 20:14 ` [patch 01/10] scsi: make __scsi_alloc_queue numa-aware Jeff Moyer
2012-10-30 20:14 ` [patch 02/10] scsi: make scsi_alloc_sdev numa-aware Jeff Moyer
@ 2012-10-30 20:14 ` Jeff Moyer
2012-10-30 20:14 ` [patch 04/10] sd: use alloc_disk_node Jeff Moyer
` (3 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Jeff Moyer @ 2012-10-30 20:14 UTC (permalink / raw)
To: linux-kernel; +Cc: James E.J. Bottomley, linux-scsi
Signed-off-by: Jeff Moyer <jmoyer@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
^ permalink raw reply related [flat|nested] 10+ messages in thread* [patch 04/10] sd: use alloc_disk_node
[not found] <1351628084-29358-1-git-send-email-jmoyer@redhat.com>
` (2 preceding siblings ...)
2012-10-30 20:14 ` [patch 03/10] scsi: allocate scsi_cmnd-s from the device's local numa node Jeff Moyer
@ 2012-10-30 20:14 ` Jeff Moyer
2012-10-30 20:14 ` [patch 07/10] megaraid_sas: use scsi_host_alloc_node Jeff Moyer
` (2 subsequent siblings)
6 siblings, 0 replies; 10+ messages in thread
From: Jeff Moyer @ 2012-10-30 20:14 UTC (permalink / raw)
To: linux-kernel; +Cc: James E.J. Bottomley, linux-scsi
Signed-off-by: Jeff Moyer <jmoyer@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
^ permalink raw reply related [flat|nested] 10+ messages in thread* [patch 07/10] megaraid_sas: use scsi_host_alloc_node
[not found] <1351628084-29358-1-git-send-email-jmoyer@redhat.com>
` (3 preceding siblings ...)
2012-10-30 20:14 ` [patch 04/10] sd: use alloc_disk_node Jeff Moyer
@ 2012-10-30 20:14 ` Jeff Moyer
2012-10-30 20:14 ` [patch 08/10] mpt2sas: " Jeff Moyer
2012-10-30 20:14 ` [patch 09/10] lpfc: " Jeff Moyer
6 siblings, 0 replies; 10+ messages in thread
From: Jeff Moyer @ 2012-10-30 20:14 UTC (permalink / raw)
To: linux-kernel; +Cc: Neela Syam Kolli, James E.J. Bottomley, linux-scsi
Signed-off-by: Jeff Moyer <jmoyer@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
^ permalink raw reply related [flat|nested] 10+ messages in thread* [patch 08/10] mpt2sas: use scsi_host_alloc_node
[not found] <1351628084-29358-1-git-send-email-jmoyer@redhat.com>
` (4 preceding siblings ...)
2012-10-30 20:14 ` [patch 07/10] megaraid_sas: use scsi_host_alloc_node Jeff Moyer
@ 2012-10-30 20:14 ` Jeff Moyer
2012-10-30 20:14 ` [patch 09/10] lpfc: " Jeff Moyer
6 siblings, 0 replies; 10+ messages in thread
From: Jeff Moyer @ 2012-10-30 20:14 UTC (permalink / raw)
To: linux-kernel; +Cc: James E.J. Bottomley, linux-scsi
Signed-off-by: Jeff Moyer <jmoyer@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
^ permalink raw reply related [flat|nested] 10+ messages in thread* [patch 09/10] lpfc: use scsi_host_alloc_node
[not found] <1351628084-29358-1-git-send-email-jmoyer@redhat.com>
` (5 preceding siblings ...)
2012-10-30 20:14 ` [patch 08/10] mpt2sas: " Jeff Moyer
@ 2012-10-30 20:14 ` Jeff Moyer
2012-10-31 18:56 ` James Smart
6 siblings, 1 reply; 10+ messages in thread
From: Jeff Moyer @ 2012-10-30 20:14 UTC (permalink / raw)
To: linux-kernel; +Cc: James Smart, James E.J. Bottomley, linux-scsi
Signed-off-by: Jeff Moyer <jmoyer@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
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [patch 09/10] lpfc: use scsi_host_alloc_node
2012-10-30 20:14 ` [patch 09/10] lpfc: " Jeff Moyer
@ 2012-10-31 18:56 ` James Smart
0 siblings, 0 replies; 10+ messages in thread
From: James Smart @ 2012-10-31 18:56 UTC (permalink / raw)
To: Jeff Moyer; +Cc: linux-kernel, James E.J. Bottomley, linux-scsi
Thanks Jeff.
-- james s
Acked-By: James Smart <james.smart@emulex.com>
On 10/30/2012 4:14 PM, Jeff Moyer wrote:
> Signed-off-by: Jeff Moyer <jmoyer@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;
>
^ permalink raw reply [flat|nested] 10+ messages in thread