diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2010-12-20 11:44:45 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-12-23 00:26:50 -0500 |
commit | 46081b166415acb66d4b3150ecefcd9460bb48a1 (patch) | |
tree | fd164cf95a6981fe5888108469e694806d02e6d1 /drivers/scsi/st.c | |
parent | 373daacfce9ea0091cb3027572354ddebefb8ebb (diff) |
[SCSI] st: Increase success probability in driver buffer allocation
Modify allocation to try the minimum possible page order allowed by the HBA
scatter/gather segment limit in allocation of the driver's internal
buffer. This increases the probability of successful allocation. The
allocation may still fail if this minimum order is > 0.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Kai Makisara <kai.makisara@kolumbus.fi>
Reported-by: Lukas Kolbe <lkolbe@techfak.uni-bielefeld.de>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/st.c')
-rw-r--r-- | drivers/scsi/st.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 12a36acae0b0..1871b8ae83ae 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c | |||
@@ -3729,7 +3729,8 @@ static int enlarge_buffer(struct st_buffer * STbuffer, int new_size, int need_dm | |||
3729 | b_size = PAGE_SIZE << order; | 3729 | b_size = PAGE_SIZE << order; |
3730 | } else { | 3730 | } else { |
3731 | for (b_size = PAGE_SIZE, order = 0; | 3731 | for (b_size = PAGE_SIZE, order = 0; |
3732 | order < ST_MAX_ORDER && b_size < new_size; | 3732 | order < ST_MAX_ORDER && |
3733 | max_segs * (PAGE_SIZE << order) < new_size; | ||
3733 | order++, b_size *= 2) | 3734 | order++, b_size *= 2) |
3734 | ; /* empty */ | 3735 | ; /* empty */ |
3735 | STbuffer->reserved_page_order = order; | 3736 | STbuffer->reserved_page_order = order; |