linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: xfs@oss.sgi.com, linux-mm@kvack.org, Michal Hocko <mhocko@suse.com>
Subject: Re: [PATCH 1/2] xfs: Add __GFP_NORETRY and __GFP_NOWARN to open-coded __GFP_NOFAIL allocations
Date: Mon, 21 Sep 2015 09:11:46 +1000	[thread overview]
Message-ID: <20150920231146.GX3902@dastard> (raw)
In-Reply-To: <1442732594-4205-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp>

On Sun, Sep 20, 2015 at 04:03:13PM +0900, Tetsuo Handa wrote:
> kmem_alloc(), kmem_zone_alloc() and xfs_buf_allocate_memory() are doing
> open-coded __GFP_NOFAIL allocations with warning messages as a canary.
> But since small !__GFP_NOFAIL allocations retry forever inside memory
> allocator unless TIF_MEMDIE is set, the canary does not help even if
> allocations are stalling. Thus, this patch adds __GFP_NORETRY so that
> we can know possibility of allocation deadlock.
> 
> If a patchset which makes small !__GFP_NOFAIL !__GFP_FS allocations not
> retry inside memory allocator is merged, warning messages by
> warn_alloc_failed() will dominate warning messages by the canary
> because each thread calls warn_alloc_failed() for approximately
> every 2 milliseconds. Thus, this patch also adds __GFP_NOWARN so that
> we won't flood kernel logs by these open-coded __GFP_NOFAIL allocations.

Please, at minimum, look at the code you are modifying. __GFP_NOWARN
is already set by both kmem_flags_convert() and xb_to_gfp(),
precisely for this reason. Any changes to the default gfp flags we
use need to be inside those wrappers - that's why they exist.

Further, xb_to_gfp() may already return just "__GFP_NORETRY |
__GFP_NOWARN", so appending them unconditionally is clearly not the
best approach.

Further, fundamentally changing the allocation behaviour of the
filesystem requires some indication of the testing and
characterisation of how the change has impacted low memory balance
and performance of the filesystem.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  parent reply	other threads:[~2015-09-20 23:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-20  7:03 Tetsuo Handa
2015-09-20  7:03 ` [PATCH 2/2] xfs: Print comm name and pid when open-coded __GFP_NOFAIL allocation stucks Tetsuo Handa
2015-09-20 23:18   ` Dave Chinner
2015-09-21  1:23     ` [PATCH v2] " Tetsuo Handa
2015-09-22  5:12       ` Dave Chinner
2015-09-22  8:03         ` [PATCH v3] " Tetsuo Handa
2015-09-20 23:11 ` Dave Chinner [this message]
2015-09-21  1:23   ` [PATCH 1/2] xfs: Add __GFP_NORETRY and __GFP_NOWARN to open-coded __GFP_NOFAIL allocations Tetsuo Handa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150920231146.GX3902@dastard \
    --to=david@fromorbit.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox