Re: [patch] mm, oom: prevent soft lockup on memcg oom for UP systems
From: David Rientjes
Date: Wed Mar 11 2020 - 18:14:43 EST
On Thu, 12 Mar 2020, Tetsuo Handa wrote:
> > The cond_resched() here is needed if the iteration is lengthy depending on
> > the number of descendant memcgs already.
>
> No. cond_resched() here will become no-op if CONFIG_PREEMPTION=y and current
> thread has realtime priority.
>
It's helpful without CONFIG_PREEMPTION for excessively long memcg
iterations to avoid starving need_resched.
> > schedule_timeout_killable(1) does not make any guarantees that current
> > will be scheduled after the victim or oom_reaper on UP systems.
>
> The point of schedule_timeout_*(1) is to guarantee that current thread
> will yield CPU to other threads even if CONFIG_PREEMPTION=y and current
> thread has realtime priority case. There is no guarantee that current
> thread will be rescheduled immediately after a sleep is irrelevant.
>
> >
> > If you have an alternate patch to try, we can test it. But since this
> > cond_resched() is needed anyway, I'm not sure it will change the result.
>
> schedule_timeout_killable(1) is an alternate patch to try; I don't think
> that this cond_resched() is needed anyway.
>
You are suggesting schedule_timeout_killable(1) in shrink_node_memcgs()?