Re: [PATCH] dm-bufio: fix sched in atomic context

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

 



On 7/15/25 01:17, Mikulas Patocka wrote:


On Thu, 10 Jul 2025, Sheng Yong wrote:

From: Sheng Yong <shengyong1@xxxxxxxxxx>

[..]

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






[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux