Re: [PATCH 2/2 v3] lib: debugobjects: touch watchdog to avoid softlockup when !CONFIG_PREEMPT

From: Peter Zijlstra
Date: Thu Jan 18 2018 - 10:05:18 EST


On Thu, Jan 18, 2018 at 10:02:25AM +0100, Thomas Gleixner wrote:
> > > 2) We can do a cond_resched() if not in atomic context and interrupts are
> > > enabled.
> >
> > I did try this before I went with touching softlockup watchdog approach. The
> > problem is in_atomic() can't tell if it is in atomic context on non-preempt
> > kernel. For preempt kernel, it is easy.
>
> Peter, can we do anything about that?

Not really :/ Take for instance a spinlock on !PREEMPT, only the lock
variable is touched, preempt_count isn't. So we cannot know.