Re: [PATCH] null_blk: Set mq device as blocking with zoned mode

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

 



On 2020/11/05 16:54, Christoph Hellwig wrote:
> On Thu, Nov 05, 2020 at 03:50:08PM +0900, Damien Le Moal wrote:
>> Commit aa1c09cb65e2 ("null_blk: Fix locking in zoned mode") changed zone
>> locking to using the potentially sleeping wait_on_bit_io() function. A
>> zoned null_blk device must thus be marked as blocking to avoid calls to
>> queue_rq() from invalid contexts triggering might_sleep() warnings.
> 
> That's going to have a fair amount of overhead.  Can't you change the
> locking to avoid blocking?
> 

I know, but the GFP_NOIO allocation with memory backing prevents any sort of
spinlock. So unless we change that to GFP_NOWAIT I do not see a way out of it.
I am fine with GFP_NOWAIT, but not sure if that is not going to break some test
setups out there.

The other solution would be to "do writes" (memory allocation and copy) first,
regardless of zone state, wp etc, then do the zone checking under a spinlock,
with that eventually failing the IO despite the copy already done. But for a
test device, I think that is acceptable.

Any other idea ?


-- 
Damien Le Moal
Western Digital Research




[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