Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

FUJITA Tomonori and committed by
James Bottomley
46081b16 373daacf

+2 -1
+2 -1
drivers/scsi/st.c
··· 3729 3729 b_size = PAGE_SIZE << order; 3730 3730 } else { 3731 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 3734 order++, b_size *= 2) 3734 3735 ; /* empty */ 3735 3736 STbuffer->reserved_page_order = order;