On 2025/4/10 17:11, Yu Kuai wrote:
Hi,

在 2025/04/10 16:06, LongPing Wei 写道:
On 2025/4/10 15:36, Christoph Hellwig wrote:
On Thu, Apr 10, 2025 at 11:09:04AM +0800, LongPing Wei wrote:
Fix the compile error when dm-bufio is built as a module.

1. dm-bufio module use blk_flush_plug();
2. blk_flush_plug is an inline function and it calls __blk_flush_plug.

Then don't call blk_flush_plug from dm-bufio, as drivers should not
micro-manage plug flushing.

Note that at least in current upstream and linux-next dm-bufio does
not actually call blk_flush_plug, so I'm not sure where your
report comes from.

Hi, Christoph

Stephen reported that a compile error happened when he tried merging
device-mapper tree.

Hi all,

After merging the device-mapper tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:

ERROR: modpost: "__blk_flush_plug" [drivers/md/dm-bufio.ko] undefined!

Caused by commit

  713ff5c782f5 ("dm-bufio: improve the performance of __dm_bufio_prefetch")

I have used the device-mapper tree from next-20250409 for today.


More details are here.

https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux- dm.git/commit/?h=for-next&id=713ff5c782f5a497bd0e93ca19607daf5bf34005

So, this patch has compile problem, I think it should be removed from
dm tree.


If __blk_flush_plug cannot be exported, this commit need to be removed
at first.

BTW, I don't get it from commit message, why you need to flush plug when
bio is not contiguous. Other than bio merge, plug is also benefit from
batch submitting:

__blk_mq_flush_plug_list
  q->mq_ops->queue_rqs(&plug->mq_list)

Thanks,
Kuai



https://lore.kernel.org/dm-devel/66bf8a8e-0a7d-47b8-9676- dc2e8c596...@oppo.com/T/#t

Thanks

LongPing

.



Previous discussion is here.

https://lore.kernel.org/dm-devel/20250325104942.1170388-1-weilongp...@oppo.com/T/#ma327528c69f6fd62e15febb5c94164c8e10c7c0d

It seems that verity_prefetch_io doesn't work efficiently.
dm_bufio_prefetch_with_ioprio
   __dm_bufio_prefetch
     blk_start_plug
     for loop
       __bufio_new
       submit_io
       cond_resched
     blk_finish_plug

If more than one hash blocks need to be prefetched, cond_resched will
be called in each loop and blk_finish_plug will be called at the end.

The requests for hash blocks may have not been dispatched when the
requests for data blocks have been completed.

The change ("dm-bufio: improve the performance of __dm_bufio_prefetch")
wants to decrease the probability of waiting hash blocks in
verity_end_io.


Thanks

LongPing

Reply via email to