Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1490350 > unrolled thread

Re: [PATCH] mm: warn about allocations which stall for too long

Started byDave Hansen <dave.hansen@intel.com>
First post2016-09-23 19:40 +0200
Last post2016-09-26 10:20 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] mm: warn about allocations which stall for too long Dave Hansen <dave.hansen@intel.com> - 2016-09-23 19:40 +0200
    Re: [PATCH] mm: warn about allocations which stall for too long Balbir Singh <bsingharora@gmail.com> - 2016-09-24 15:20 +0200
      Re: [PATCH] mm: warn about allocations which stall for too long Michal Hocko <mhocko@kernel.org> - 2016-09-26 10:20 +0200
    Re: [PATCH] mm: warn about allocations which stall for too long Michal Hocko <mhocko@kernel.org> - 2016-09-26 10:20 +0200

#1490350 — Re: [PATCH] mm: warn about allocations which stall for too long

FromDave Hansen <dave.hansen@intel.com>
Date2016-09-23 19:40 +0200
SubjectRe: [PATCH] mm: warn about allocations which stall for too long
Message-ID<skCC6-6Ov-23@gated-at.bofh.it>
On 09/23/2016 01:15 AM, Michal Hocko wrote:
> +	/* Make sure we know about allocations which stall for too long */
> +	if (!(gfp_mask & __GFP_NOWARN) && time_after(jiffies, alloc_start + stall_timeout)) {
> +		pr_warn("%s: page alloction stalls for %ums: order:%u mode:%#x(%pGg)\n",
> +				current->comm, jiffies_to_msecs(jiffies-alloc_start),
> +				order, gfp_mask, &gfp_mask);
> +		stall_timeout += 10 * HZ;
> +		dump_stack();
> +	}

This would make an awesome tracepoint.  There's probably still plenty of
value to having it in dmesg, but the configurability of tracepoints is
hard to beat.

[toc] | [next] | [standalone]


#1490644

FromBalbir Singh <bsingharora@gmail.com>
Date2016-09-24 15:20 +0200
Message-ID<skV21-1qQ-1@gated-at.bofh.it>
In reply to#1490350

On 24/09/16 03:34, Dave Hansen wrote:
> On 09/23/2016 01:15 AM, Michal Hocko wrote:
>> +	/* Make sure we know about allocations which stall for too long */
>> +	if (!(gfp_mask & __GFP_NOWARN) && time_after(jiffies, alloc_start + stall_timeout)) {
>> +		pr_warn("%s: page alloction stalls for %ums: order:%u mode:%#x(%pGg)\n",
>> +				current->comm, jiffies_to_msecs(jiffies-alloc_start),
>> +				order, gfp_mask, &gfp_mask);
>> +		stall_timeout += 10 * HZ;
>> +		dump_stack();
>> +	}
> 
> This would make an awesome tracepoint.  There's probably still plenty of
> value to having it in dmesg, but the configurability of tracepoints is
> hard to beat.

An awesome tracepoint and a great place to trigger other tracepoints. With stall timeout
increasing every time, do we only care about the first instance when we exceeded stall_timeout?
Do we debug just that instance?

Balbir Singh.

[toc] | [prev] | [next] | [standalone]


#1491131

FromMichal Hocko <mhocko@kernel.org>
Date2016-09-26 10:20 +0200
Message-ID<slziN-1rJ-21@gated-at.bofh.it>
In reply to#1490644
On Sat 24-09-16 23:19:04, Balbir Singh wrote:
> 
> 
> On 24/09/16 03:34, Dave Hansen wrote:
> > On 09/23/2016 01:15 AM, Michal Hocko wrote:
> >> +	/* Make sure we know about allocations which stall for too long */
> >> +	if (!(gfp_mask & __GFP_NOWARN) && time_after(jiffies, alloc_start + stall_timeout)) {
> >> +		pr_warn("%s: page alloction stalls for %ums: order:%u mode:%#x(%pGg)\n",
> >> +				current->comm, jiffies_to_msecs(jiffies-alloc_start),
> >> +				order, gfp_mask, &gfp_mask);
> >> +		stall_timeout += 10 * HZ;
> >> +		dump_stack();
> >> +	}
> > 
> > This would make an awesome tracepoint.  There's probably still plenty of
> > value to having it in dmesg, but the configurability of tracepoints is
> > hard to beat.
> 
> An awesome tracepoint and a great place to trigger other tracepoints. With stall timeout
> increasing every time, do we only care about the first instance when we exceeded stall_timeout?
> Do we debug just that instance?

I am not sure I understand you here. The stall_timeout is increased to
see whether the situation is permanent of ephemeral. This is similar to
RCU lockup reports.
-- 
Michal Hocko
SUSE Labs

[toc] | [prev] | [next] | [standalone]


#1491135

FromMichal Hocko <mhocko@kernel.org>
Date2016-09-26 10:20 +0200
Message-ID<slziO-1rJ-33@gated-at.bofh.it>
In reply to#1490350
On Fri 23-09-16 10:34:01, Dave Hansen wrote:
> On 09/23/2016 01:15 AM, Michal Hocko wrote:
> > +	/* Make sure we know about allocations which stall for too long */
> > +	if (!(gfp_mask & __GFP_NOWARN) && time_after(jiffies, alloc_start + stall_timeout)) {
> > +		pr_warn("%s: page alloction stalls for %ums: order:%u mode:%#x(%pGg)\n",
> > +				current->comm, jiffies_to_msecs(jiffies-alloc_start),
> > +				order, gfp_mask, &gfp_mask);
> > +		stall_timeout += 10 * HZ;
> > +		dump_stack();
> > +	}
> 
> This would make an awesome tracepoint.  There's probably still plenty of
> value to having it in dmesg, but the configurability of tracepoints is
> hard to beat.

Currently we only have trace_mm_page_alloc in __alloc_pages_nodemask. I
think we want to add another one to mark the beginning of the allocation
so that we can track allocation latencies per allocation context and
ideally drop them down into sources - congestion waits, reclaim path,
slab reclaim etc. Janani Ravichandran is working on a script to do that
http://lkml.kernel.org/r/20160911222411.GA2854@janani-Inspiron-3521

But this sounds a bit orthogonal to my proposal here because I would
really like to warn unconditionally when an allocation stalls for
unreasonably long. Tracepoints are not an ideal tool for that because
you have to start collecting tracing output before this situations
happen. Moreover in my experience I often had to replace my local
debugging trace_printks by regular printks because the prior ones just
got lost under a heavy memory pressure.
-- 
Michal Hocko
SUSE Labs

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web