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

From: Dave Hansen
Date: Fri Sep 23 2016 - 13:34:15 EST


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.