Re: [PATCH v21 03/12] blk-zoned: Add an argument to blk_zone_plug_bio()

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

 




On 7/18/25 12:13 AM, Damien Le Moal wrote:
I still do not understand why this patch is needed because you can get the
current CPU submitting the BIO inside blk_zone_plug_bio() with
raw_smp_processor_id(). That CPU ID should be the same as the cached request
that we will use only if the BIO is not going through the BIO work, that is, if
it is the first write BIO in-flight for the zone.

I do not agree with the above. With CONFIG_PREEMPT enabled, migration to another CPU may happen after a cached request has been allocated and
before the zoned block device code is called. This can be prevented by
surrounding code with preempt_disable() and preempt_enable(). However, I
don't think that we want to do this in submit_bio() since there is code
in submit_bio() that may sleep (bio_queue_enter()) and sleeping with
preemption disabled is not allowed.

Is there perhaps something that I'm overlooking or misunderstanding?

Furthermore, for the DM case, you pass a CPU of "-1", but if the DM target needs
zone append emulation, it will use zone write plugging. So the same control as
for blk-mq is needed.

This "-1" means that it is not known from which CPU a request will be
allocated since a migration to another CPU may happen between the
blk_zone_plug_bio() call and request allocation.

Thanks,

Bart.




[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