* [PATCH] block: Export __blk_flush_plug to modules
@ 2025-04-10 3:09 LongPing Wei
2025-04-10 7:36 ` Christoph Hellwig
0 siblings, 1 reply; 6+ messages in thread
From: LongPing Wei @ 2025-04-10 3:09 UTC (permalink / raw)
To: snitzer, mpatocka, axboe
Cc: dm-devel, linux-block, guoweichao, sfr, LongPing Wei
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.
Signed-off-by: LongPing Wei <weilongping@oppo.com>
---
block/blk-core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/blk-core.c b/block/blk-core.c
index e8cc270a453f..4d72ebeb18f7 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1230,6 +1230,7 @@ void __blk_flush_plug(struct blk_plug *plug, bool from_schedule)
plug->cur_ktime = 0;
current->flags &= ~PF_BLOCK_TS;
}
+EXPORT_SYMBOL(__blk_flush_plug);
/**
* blk_finish_plug - mark the end of a batch of submitted I/O
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] block: Export __blk_flush_plug to modules
2025-04-10 3:09 [PATCH] block: Export __blk_flush_plug to modules LongPing Wei
@ 2025-04-10 7:36 ` Christoph Hellwig
2025-04-10 8:06 ` LongPing Wei
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2025-04-10 7:36 UTC (permalink / raw)
To: LongPing Wei
Cc: snitzer, mpatocka, axboe, dm-devel, linux-block, guoweichao, sfr
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] block: Export __blk_flush_plug to modules
2025-04-10 7:36 ` Christoph Hellwig
@ 2025-04-10 8:06 ` LongPing Wei
2025-04-10 9:11 ` Yu Kuai
0 siblings, 1 reply; 6+ messages in thread
From: LongPing Wei @ 2025-04-10 8:06 UTC (permalink / raw)
To: Christoph Hellwig
Cc: snitzer, mpatocka, axboe, dm-devel, linux-block, guoweichao, sfr
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
https://lore.kernel.org/dm-devel/66bf8a8e-0a7d-47b8-9676-dc2e8c596bdb@oppo.com/T/#t
Thanks
LongPing
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] block: Export __blk_flush_plug to modules
2025-04-10 8:06 ` LongPing Wei
@ 2025-04-10 9:11 ` Yu Kuai
2025-04-10 9:44 ` LongPing Wei
2025-04-10 10:44 ` Mikulas Patocka
0 siblings, 2 replies; 6+ messages in thread
From: Yu Kuai @ 2025-04-10 9:11 UTC (permalink / raw)
To: LongPing Wei, Christoph Hellwig
Cc: snitzer, mpatocka, axboe, dm-devel, linux-block, guoweichao, sfr,
yukuai (C)
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.
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-dc2e8c596bdb@oppo.com/T/#t
>
>
> Thanks
>
> LongPing
>
> .
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] block: Export __blk_flush_plug to modules
2025-04-10 9:11 ` Yu Kuai
@ 2025-04-10 9:44 ` LongPing Wei
2025-04-10 10:44 ` Mikulas Patocka
1 sibling, 0 replies; 6+ messages in thread
From: LongPing Wei @ 2025-04-10 9:44 UTC (permalink / raw)
To: Yu Kuai, Christoph Hellwig
Cc: snitzer, mpatocka, axboe, dm-devel, linux-block, guoweichao, sfr,
yukuai (C)
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-
>> dc2e8c596bdb@oppo.com/T/#t
>>
>> Thanks
>>
>> LongPing
>>
>> .
>>
>
Previous discussion is here.
https://lore.kernel.org/dm-devel/20250325104942.1170388-1-weilongping@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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] block: Export __blk_flush_plug to modules
2025-04-10 9:11 ` Yu Kuai
2025-04-10 9:44 ` LongPing Wei
@ 2025-04-10 10:44 ` Mikulas Patocka
1 sibling, 0 replies; 6+ messages in thread
From: Mikulas Patocka @ 2025-04-10 10:44 UTC (permalink / raw)
To: Yu Kuai
Cc: LongPing Wei, Christoph Hellwig, snitzer, axboe, dm-devel,
linux-block, guoweichao, sfr, yukuai (C)
[-- Attachment #1: Type: text/plain, Size: 1981 bytes --]
On Thu, 10 Apr 2025, 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.
OK, I've just removed it.
Mikulas
> 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-dc2e8c596bdb@oppo.com/T/#t
> >
> > Thanks
> >
> > LongPing
> >
> > .
> >
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-04-10 10:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-10 3:09 [PATCH] block: Export __blk_flush_plug to modules LongPing Wei
2025-04-10 7:36 ` Christoph Hellwig
2025-04-10 8:06 ` LongPing Wei
2025-04-10 9:11 ` Yu Kuai
2025-04-10 9:44 ` LongPing Wei
2025-04-10 10:44 ` Mikulas Patocka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).