Skip to content

Commit

Permalink
[SCSI] st: Increase success probability in driver buffer allocation
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Kai Makisara <[email protected]>
Reported-by: Lukas Kolbe <[email protected]>
Signed-off-by: James Bottomley <[email protected]>
  • Loading branch information
fujita authored and James Bottomley committed Dec 23, 2010
1 parent 373daac commit 46081b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/scsi/st.c
Original file line number Diff line number Diff line change
Expand Up @@ -3729,7 +3729,8 @@ static int enlarge_buffer(struct st_buffer * STbuffer, int new_size, int need_dm
b_size = PAGE_SIZE << order;
} else {
for (b_size = PAGE_SIZE, order = 0;
order < ST_MAX_ORDER && b_size < new_size;
order < ST_MAX_ORDER &&
max_segs * (PAGE_SIZE << order) < new_size;
order++, b_size *= 2)
; /* empty */
STbuffer->reserved_page_order = order;
Expand Down

0 comments on commit 46081b1

Please sign in to comment.