diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2010-03-17 16:22:52 +0530 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-04-11 09:23:56 -0500 |
commit | 89009fbb7d2df37536c8dc932fdead4189783f92 (patch) | |
tree | 12625e1d4dd6017ce3fc18db1b8c9659a1917661 /drivers/scsi/mpt2sas/mpt2sas_base.c | |
parent | f891dcfdc11d2004253861f51d627bfda6773c76 (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/mpt2sas_base.c')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.c | 12 |
1 files changed, 7 insertions, 5 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) ioc->config_page, ioc->config_page_dma); } - kfree(ioc->scsi_lookup); + free_pages((ulong)ioc->scsi_lookup, ioc->scsi_lookup_pages); kfree(ioc->hpr_lookup); kfree(ioc->internal_lookup); } @@ -2113,11 +2113,13 @@ _base_allocate_memory_pools(struct MPT2SAS_ADAPTER *ioc, int sleep_flag) ioc->name, (unsigned long long) ioc->request_dma)); total_sz += sz; - ioc->scsi_lookup = kcalloc(ioc->scsiio_depth, - sizeof(struct request_tracker), GFP_KERNEL); + sz = ioc->scsiio_depth * sizeof(struct request_tracker); + ioc->scsi_lookup_pages = get_order(sz); + ioc->scsi_lookup = (struct request_tracker *)__get_free_pages( + GFP_KERNEL, ioc->scsi_lookup_pages); if (!ioc->scsi_lookup) { - printk(MPT2SAS_ERR_FMT "scsi_lookup: kcalloc failed\n", - ioc->name); + printk(MPT2SAS_ERR_FMT "scsi_lookup: get_free_pages failed, " + "sz(%d)\n", ioc->name, (int)sz); goto out; } |