RE: [PATCH 1/1] sched.h: silent false ATOMIC_SLEEP warning from cond_resched
From: Maninder Singh
Date: Thu Oct 10 2024 - 06:12:36 EST
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:
commit 35a773a07926a22bf19d77ee00024522279c4e68
Author: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Date: Mon Sep 19 12:57:53 2016 +0200
sched/core: Avoid _cond_resched() for PREEMPT=y
On fully preemptible kernels _cond_resched() is pointless, so avoid
emitting any code for it.
So we thought it should not give warning also in this case.
Thanks,
Maninder Singh