From: Sheng Yong <shengyong2021@gmail.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: shengyong2021@gmail.com, shengyong1@xiaomi.com, agk@redhat.com,
snitzer@kernel.org, nhuck@google.com, dm-devel@lists.linux.dev,
linux-kernel@vger.kernel.org, Wang Shuai <wangshuai12@xiaomi.com>
Subject: Re: [PATCH] dm-bufio: fix sched in atomic context
Date: Tue, 15 Jul 2025 09:35:21 +0800 [thread overview]
Message-ID: <17dbffb9-ded6-4605-a7bb-b6f2624313ed@gmail.com> (raw)
In-Reply-To: <673ddfed-d874-9ffe-c2fe-a741e8fc69f1@redhat.com>
On 7/15/25 01:17, Mikulas Patocka wrote:
>
>
> On Thu, 10 Jul 2025, Sheng Yong wrote:
>
>> From: Sheng Yong <shengyong1@xiaomi.com>
>>
[..]
>>
>> diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
>> index ec84ba5e93e5..caf6ae9a8b52 100644
>> --- a/drivers/md/dm-bufio.c
>> +++ b/drivers/md/dm-bufio.c
>> @@ -2742,7 +2742,9 @@ static unsigned long __evict_a_few(unsigned long nr_buffers)
>> __make_buffer_clean(b);
>> __free_buffer_wake(b);
>>
>> + dm_bufio_unlock(c);
>> cond_resched();
>> + dm_bufio_lock(c);
>> }
>>
>> dm_bufio_unlock(c);
>> --
>> 2.43.0
>
> Hi
>
> I accepted this patch. I changed it to:
>
> - cond_resched();
> + if (need_resched()) {
> + dm_bufio_unlock(c);
> + cond_resched();
> + dm_bufio_lock(c);
> + }
> }
>
> dm_bufio_unlock(c);
>
> so that we are not hammering on the dm bufio lock when scheduling is not
> needed.
Hi, Mikulas,
Thank you for the update. It looks good to me.
thanks,
Yong
>
> Mikulas
>
prev parent reply other threads:[~2025-07-15 1:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-10 6:48 Sheng Yong
2025-07-14 17:17 ` Mikulas Patocka
2025-07-15 1:35 ` Sheng Yong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=17dbffb9-ded6-4605-a7bb-b6f2624313ed@gmail.com \
--to=shengyong2021@gmail.com \
--cc=agk@redhat.com \
--cc=dm-devel@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=nhuck@google.com \
--cc=shengyong1@xiaomi.com \
--cc=snitzer@kernel.org \
--cc=wangshuai12@xiaomi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®