[SCSI] mpt2sas : Fix for memory allocation error for large host credits
authornagalakshmi.nandigama@lsi.com <nagalakshmi.nandigama@lsi.com>
Thu, 1 Dec 2011 02:23:08 +0000 (07:53 +0530)
committerJames Bottomley <JBottomley@Parallels.com>
Thu, 15 Dec 2011 06:57:39 +0000 (10:57 +0400)
commitaff132d95ffe14eca96cab90597cdd010b457af7
tree652c0f0babc3c70fd6f91962318ff96e5bd0034d
parent4da7af9494b2f98a1503a2634059300c3e4615e6
[SCSI] mpt2sas : Fix for memory allocation error for large host credits

The amount of memory required for tracking chain buffers is rather
large, and when the host credit count is big, memory allocation
failure occurs inside __get_free_pages.

The fix is to limit the number of chains to 100,000.  In addition,
the number of host credits is limited to 30,000 IOs. However this
limitation can be overridden this using the command line option
max_queue_depth.  The algorithm for calculating the
reply_post_queue_depth is changed so that it is equal to
(reply_free_queue_depth + 16), previously it was (reply_free_queue_depth * 2).

Signed-off-by: Nagalakshmi Nandigama <nagalakshmi.nandigama@lsi.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/mpt2sas/mpt2sas_base.c
drivers/scsi/mpt2sas/mpt2sas_scsih.c