Re: dm-crypt: fix softlockup in dmcrypt_write

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

 





在 2023/2/28 9:25, yangerkun 写道:


在 2023/2/28 1:55, Mike Snitzer 写道:
On Sun, Feb 26 2023 at  8:31P -0500,
yangerkun <yangerkun@xxxxxxxxxxxxxxx> wrote:



在 2023/2/26 10:01, Bart Van Assche 写道:
On 2/22/23 19:19, yangerkun wrote:
@@ -1924,6 +1926,10 @@ static int dmcrypt_write(void *data)
           BUG_ON(rb_parent(write_tree.rb_node));
+        if (time_is_before_jiffies(start_time + HZ)) {
+            schedule();
+            start_time = jiffies;
+        }

Why schedule() instead of cond_resched()?

cond_resched may not really schedule, which may trigger the problem too, but
it seems after 1 second, it may never happend?

I had the same question as Bart when reviewing your homegrown
conditional schedule().  Hopefully you can reproduce this issue?  If
so, please see if simply using cond_resched() fixes the issue.

Yes, our testcase can trigger the issue, will do it with cond_resched.

Without this patch, the softlockup may trigger soon, after this patch no matter cond_resched or schedule, softlockup won't trigger after two hour test.

Thanks,
Kun.




Thanks,
Mike

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/dm-devel




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

  Powered by Linux