lkml.org 
[lkml]   [2015]   [Dec]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] watchdog: introduce touch_softlockup_watchdog_sched()
Hey, Peter.

On Thu, Dec 03, 2015 at 11:00:18AM +0100, Peter Zijlstra wrote:
> > have you considered something as simple as:
> >
> > WARN_ON(current->reclaim_state && !WQ_MEM_RECLAIM);
> >
> > ?
>
> Alternatively, you can 'abuse' the lockdep reclaim bits by marking
> !MEM_RECLAIM workqueue 'locks' with lockdep_trace_alloc(GFP_KERNEL),
> that way lockdep will yell if they get used in a reclaim context.
>
> This might be a tad tricky in that you need 2 sets of (lockdep) keys for
> things.

One of the latest bugs was an xfs work item in reclaim path which had
WQ_MEM_RECLAIM waiting on a waitqueue for an event which is to be
triggered by another work item which incorrectly was missing the flag.
Under memory pressure, it leads to silent deadlocks. The other one
was vmstat update work busy looping waiting for a work item which is
queued behind it. None of the dependency tracking mechanisms could
have detected either and both were pretty tricky to track down.

We can add MEM_RECLAIM -> !MEM_RECLAIM warning mechanism in addition
but I think adding stall detection is justified.

Thanks.

--
tejun


\
 
 \ /
  Last update: 2015-12-03 16:01    [W:0.157 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site