Re: [PATCH] lib/sbitmap: allocate sb->map via kvzalloc_node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/21/22 6:25 PM, Ming Lei wrote:
> Hello,
> 
> On Wed, Mar 16, 2022 at 09:27:08AM +0800, Ming Lei wrote:
>> sbitmap has been used in scsi for replacing atomic operations on
>> sdev->device_busy, so IOPS on some fast scsi storage can be improved.
>>
>> However, sdev->device_busy can be changed in fast path, so we have to
>> allocate the sb->map statically. sdev->device_busy has been capped to 1024,
>> but some drivers may configure the default depth as < 8, then
>> cause each sbitmap word to hold only one bit. Finally 1024 * 128(
>> sizeof(sbitmap_word)) bytes is needed for sb->map, given it is order 5
>> allocation, sometimes it may fail.
>>
>> Avoid the issue by using kvzalloc_node() for allocating sb->map.
>>
>> Cc: Ewan D. Milne <emilne@xxxxxxxxxx>
>> Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx>
> 
> Ping...

Was waiting on a response to the question on why we don't make this
dependent on size, but upon look at kvzalloc_node(), this is already
what it does. So I guess this looks fine to me too.

-- 
Jens Axboe




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux