aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/mpt2sas
diff options
context:
space:
mode:
authorKashyap, Desai <kashyap.desai@lsi.com>2010-03-17 06:52:52 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-04-11 10:23:56 -0400
commit89009fbb7d2df37536c8dc932fdead4189783f92 (patch)
tree12625e1d4dd6017ce3fc18db1b8c9659a1917661 /drivers/scsi/mpt2sas
parentf891dcfdc11d2004253861f51d627bfda6773c76 (diff)
[SCSI] mpt2sas: Use of get_free_pages for huge memorary allocation.
use the get_free_pages API for larger contigious physical memory chunk. Also, the ioc->chain_depth need to be changed from a 16bit to 32bit variable because the number of chains will exceed 64k when the queue depth is large. Signed-off-by: Kashyap Desai <kashyap.desai@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/mpt2sas')
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_base.c12
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_base.h5
2 files changed, 10 insertions, 7 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index 2e6e45a2803f..9ad4b48a9b62 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -1901,7 +1901,7 @@ _base_release_memory_pools(struct MPT2SAS_ADAPTER *ioc)
1901 ioc->config_page, ioc->config_page_dma); 1901 ioc->config_page, ioc->config_page_dma);
1902 } 1902 }
1903 1903
1904 kfree(ioc->scsi_lookup); 1904 free_pages((ulong)ioc->scsi_lookup, ioc->scsi_lookup_pages);
1905 kfree(ioc->hpr_lookup); 1905 kfree(ioc->hpr_lookup);
1906 kfree(ioc->internal_lookup); 1906 kfree(ioc->internal_lookup);
1907} 1907}
@@ -2113,11 +2113,13 @@ _base_allocate_memory_pools(struct MPT2SAS_ADAPTER *ioc, int sleep_flag)
2113 ioc->name, (unsigned long long) ioc->request_dma)); 2113 ioc->name, (unsigned long long) ioc->request_dma));
2114 total_sz += sz; 2114 total_sz += sz;
2115 2115
2116 ioc->scsi_lookup = kcalloc(ioc->scsiio_depth, 2116 sz = ioc->scsiio_depth * sizeof(struct request_tracker);
2117 sizeof(struct request_tracker), GFP_KERNEL); 2117 ioc->scsi_lookup_pages = get_order(sz);
2118 ioc->scsi_lookup = (struct request_tracker *)__get_free_pages(
2119 GFP_KERNEL, ioc->scsi_lookup_pages);
2118 if (!ioc->scsi_lookup) { 2120 if (!ioc->scsi_lookup) {
2119 printk(MPT2SAS_ERR_FMT "scsi_lookup: kcalloc failed\n", 2121 printk(MPT2SAS_ERR_FMT "scsi_lookup: get_free_pages failed, "
2120 ioc->name); 2122 "sz(%d)\n", ioc->name, (int)sz);
2121 goto out; 2123 goto out;
2122 } 2124 }
2123 2125
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 142b694c9de5..cdedfcbb8ca7 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -676,7 +676,8 @@ struct MPT2SAS_ADAPTER {
676 dma_addr_t request_dma; 676 dma_addr_t request_dma;
677 u32 request_dma_sz; 677 u32 request_dma_sz;
678 struct request_tracker *scsi_lookup; 678 struct request_tracker *scsi_lookup;
679 spinlock_t scsi_lookup_lock; 679 ulong scsi_lookup_pages;
680 spinlock_t scsi_lookup_lock;
680 struct list_head free_list; 681 struct list_head free_list;
681 int pending_io_count; 682 int pending_io_count;
682 wait_queue_head_t reset_wq; 683 wait_queue_head_t reset_wq;
@@ -688,7 +689,7 @@ struct MPT2SAS_ADAPTER {
688 u16 max_sges_in_chain_message; 689 u16 max_sges_in_chain_message;
689 u16 chains_needed_per_io; 690 u16 chains_needed_per_io;
690 u16 chain_offset_value_for_main_message; 691 u16 chain_offset_value_for_main_message;
691 u16 chain_depth; 692 u32 chain_depth;
692 693
693 /* hi-priority queue */ 694 /* hi-priority queue */
694 u16 hi_priority_smid; 695 u16 hi_priority_smid;