linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: david@fromorbit.com, linux-fsdevel@vger.kernel.org
Subject: Re: How to handle an kmalloc failure in evict_inode()?
Date: Sat, 9 Aug 2014 11:43:21 -0400	[thread overview]
Message-ID: <20140809154321.GC15431@thunk.org> (raw)
In-Reply-To: <201408091948.FDD43704.FOJLFFSVOHQtMO@I-love.SAKURA.ne.jp>

On Sat, Aug 09, 2014 at 07:48:26PM +0900, Tetsuo Handa wrote:
> It seems to me that you are talking about only cases where memory allocation
> functions return NULL instead of waiting forever. But that is an optimistic
> assumption. What I'm observing under extreme memory pressure with XFS
> ( https://lkml.org/lkml/2014/7/2/249 ) is that memory allocation functions spin
> forever while keeping some of kernel threads locked. Do you have ideas for
> solving (or at least detecting) this behavior?

This is an mm problem.  I don't doubt that there are probably some
things that the mm can do a better job, but under a malicious /
abusive enough workload, the only solution is to OOM kill one or more
offending processes.

The mm layer can try to be more efficient at packing a certain amount
of sh*t into a bag, but ultimately, if you have 10 pounds of sh*t, and
a 5 pound bag, the bag is going to burst.  The only question is how
the bag is going to burst, and does so via just killing processes, or
whether you get some file system corruption in addition, as a bonus.

This is why I suspect the right answer is for the file system to use
GFP_NOFAIL instead of doing the retry loop inside the file system.
That gives the mm layer an easier way of getting a signal that things
are going bad, since the looping is done inside the slab allocator,
and so the mm can use this signal to decide if the time is right to
kick up the aggressiveness of the OOM killer.

     	    		      	      - Ted






      reply	other threads:[~2014-08-09 15:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 23:41 How to handle an kmalloc failure in evict_inode()? Theodore Ts'o
2014-08-05  1:13 ` Dave Chinner
2014-08-05  1:53   ` Theodore Ts'o
2014-08-05 12:17     ` Dave Chinner
2014-08-05 17:21       ` Theodore Ts'o
2014-08-05 22:12         ` Dave Chinner
2014-08-09 10:48           ` Tetsuo Handa
2014-08-09 15:43             ` Theodore Ts'o [this message]

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=20140809154321.GC15431@thunk.org \
    --to=tytso@mit.edu \
    --cc=david@fromorbit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    /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;
as well as URLs for NNTP newsgroup(s).