Hi, On Tue, Aug 26, 2025 at 2:53 AM Tejun Heo <tj@xxxxxxxxxx> wrote: > > Hello, > > On Tue, Aug 26, 2025 at 01:45:44AM +0800, Julian Sun wrote: > ... > > Sorry for having misunderstood what you meant before. I’m afraid that > > init_wait_func() cannot work the same way. Because calling > > init_wait_func() presupposes that we are preparing to wait for an > > event(like wb_wait_completion()), but waiting for such an event might > > lead to a hung task. > > > > Please correct me if I'm wrong. > > Using init_wait_func() does not require someone waiting for it. AFAICS, you > should be able to do the same thing that you did - allocating the done > entries individually and freeing them when the done count reaches zero > without anyone waiting for it. waitq doesn't really make many assumptions > about how it's used - when you call wake_up() on it, it just walks the > queued entries and invoke the callbacks there. Ah, yeah, this sounds great, many thanks for your clarification. I’ll send v2 of the patch after testing. > > Thanks. > > -- > tejun Thanks, -- Julian Sun <sunjunchao@xxxxxxxxxxxxx>