SCSI: mpt2sas : Fix for memory allocation error for large host credits
commit73669debb5f508962ffcc8b632ffb2971c606e5c
authornagalakshmi.nandigama@lsi.com <nagalakshmi.nandigama@lsi.com>
Thu, 1 Dec 2011 02:23:08 +0000 (1 07:53 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 26 Jan 2012 01:24:41 +0000 (25 17:24 -0800)
tree86f1de490a8b2fa3ed2e4278bf33600661e7b199
parentde3f88ba084473ce5365632f0209c3e95aeb55e9
SCSI: mpt2sas : Fix for memory allocation error for large host credits

commit aff132d95ffe14eca96cab90597cdd010b457af7 upstream.

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>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/scsi/mpt2sas/mpt2sas_base.c
drivers/scsi/mpt2sas/mpt2sas_scsih.c