Re: [PATCH 1/1] sched.h: silent false ATOMIC_SLEEP warning from cond_resched
From: Peter Zijlstra
Date: Thu Oct 10 2024 - 06:39:40 EST
On Thu, Oct 10, 2024 at 03:39:40PM +0530, Maninder Singh wrote:
> Hi,
>
> > On Thu, Oct 10, 2024 at 08:56:53AM +0530, Hariom Panthi wrote:
> > > In case of (CONFIG_PREEMPTION && !CONFIG_PREEMPT_DYNAMIC),
> > > cond_reched() is not sleeping.
> > >
> > > Thus remove __might_resched in that cases.
> >
> > *why* ? It's still a valid site to do the atomic_sleep testing, no?
>
> In our case there was a call to vunmap_pmd_range from __do_softirq,
> and vunmap_pmd_range is not actually sleeping call, but because of
> cond_resched it was giving warning with DEBUG_ATOMIC_SLEEP.
>
> and cond_resched in case of CONFIG_PREEMPTION is empty function with below change:
By still having that warning we helpfully tell you your code is broken
for that other .config. Code should be good irrespective of the .config
used, right?