On Thu, 18 Jan 2024, Yu Kuai wrote: > Hi, > > 在 2024/01/18 2:18, Mikulas Patocka 写道: > > Note that md_wakeup_thread_directly is racy - it will do nothing if the > > thread is already running or it may cause spurious wake-up if the thread > > is blocked in another subsystem. > > No, as the comment said, md_wakeup_thread_directly() is just to prevent > that md_wakeup_thread() can't wake up md_do_sync() if it's waiting for > metadata update. Yes - but what happens if you wake up the thread just a few instructions before it is going to sleep for metadata update? wake_up_process does nothing on a running process and the thread proceeds with waiting. This is what I thought could happen when I was making the patch. Mikulas