On Wed, 20 Dec 2023 07:17:53 +0800 Kevin Hao <haokexin@xxxxxxxxx> wrote: > A freezable kernel thread can enter frozen state during freezing by > either calling try_to_freeze() or using wait_event_freezable() and its > variants. However, there is no need to use both methods simultaneously. > The freezable wait variants have been used in khugepaged_wait_work() > and khugepaged_alloc_sleep(), so remove this redundant > try_to_freeze(). > > ... > > --- a/mm/khugepaged.c > +++ b/mm/khugepaged.c > @@ -2500,7 +2500,7 @@ static void khugepaged_do_scan(struct collapse_control *cc) > while (true) { > cond_resched(); > > - if (unlikely(kthread_should_stop() || try_to_freeze())) > + if (unlikely(kthread_should_stop())) > break; > > spin_lock(&khugepaged_mm_lock); What are the effects upon worst-case freezing latency?