linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Ted Ts'o <tytso@mit.edu>, David Rientjes <rientjes@google.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Jens Axboe <jaxboe@fusionio.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ne
Subject: Re: [patch 1/5] mm: add nofail variants of kmalloc kcalloc and kzalloc
Date: Thu, 26 Aug 2010 16:38:00 +1000	[thread overview]
Message-ID: <20100826063759.GB705@dastard> (raw)
In-Reply-To: <20100826014847.GQ4453@thunk.org>

On Wed, Aug 25, 2010 at 09:48:47PM -0400, Ted Ts'o wrote:
> On Wed, Aug 25, 2010 at 05:30:42PM -0700, David Rientjes wrote:
> > 
> > We certainly hope that nobody will reimplement the same function without 
> > the __deprecated warning, especially for order < PAGE_ALLOC_COSTLY_ORDER 
> > where there's no looping at a higher level.  So perhaps the best 
> > alternative is to implement the same _nofail() functions but do a 
> > WARN_ON(get_order(size) > PAGE_ALLOC_COSTLY_ORDER) instead?
> 
> Yeah, that sounds better.
> 
> > I think it's really sad that the caller can't know what the upper bounds 
> > of its memory requirement are ahead of time or at least be able to 
> > implement a memory freeing function when kmalloc() returns NULL.
> 
> Oh, we can determine an upper bound.  You might just not like it.
> Actually ext3/ext4 shouldn't be as bad as XFS, which Dave estimated to
> be around 400k for a transaction.

For a 4k block size filesystem.

If I use 64k block size directories (which XFS can even on 4k page
size machines), the maximum transaction reservation goes up to at
around 3MB, and that's just for blocks being _modified_. It's not
the limit on the amount of memory that may need to be allocated
during a transaction....

> My guess is that the worst case for
> ext3/ext4 is probably around 256k or so; like XFS, most of the time,
> it would be a lot less. 

Right, it usually is a lot less, but one of the big problems is that
during low memory situations memory reclaim of the metadata page
cache actually causes _more_ memory allocation during tranactions
than otherwise would occur.......

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  parent reply	other threads:[~2010-08-26  6:38 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-24 10:50 [patch 1/5] mm: add nofail variants of kmalloc kcalloc and kzalloc David Rientjes
2010-08-24 10:50 ` [patch 3/5] fs: add nofail variant of alloc_buffer_head David Rientjes
2010-08-24 12:17   ` Jan Kara
2010-08-24 12:15 ` [patch 1/5] mm: add nofail variants of kmalloc kcalloc and kzalloc Jan Kara
2010-08-24 13:29 ` Peter Zijlstra
2010-08-24 13:33   ` Jens Axboe
2010-08-24 20:11     ` David Rientjes
2010-08-25 11:24       ` Ted Ts'o
2010-08-25 11:35         ` Peter Zijlstra
2010-08-25 11:57           ` Ted Ts'o
2010-08-25 12:48             ` Peter Zijlstra
2010-08-25 12:52               ` Peter Zijlstra
2010-08-25 13:20                 ` Theodore Tso
2010-08-25 13:31                   ` Peter Zijlstra
2010-08-25 20:43                     ` David Rientjes
2010-08-25 20:55                       ` Peter Zijlstra
2010-08-25 21:11                         ` David Rientjes
2010-08-25 21:27                           ` Peter Zijlstra
2010-08-25 23:11                             ` David Rientjes
2010-08-26  0:19                               ` Ted Ts'o
2010-08-26  0:30                                 ` David Rientjes
     [not found]                                 ` <alpine.DEB.2.00.1008251724360.25783@chino.kir.corp.google.com>
2010-08-26  1:48                                   ` Ted Ts'o
2010-08-26  3:09                                     ` David Rientjes
2010-08-26  7:06                                       ` Dave Chinner
2010-08-26  8:29                                       ` Peter Zijlstra
2010-08-26  6:38                                     ` Dave Chinner [this message]
2010-08-25 13:34                   ` Peter Zijlstra
2010-08-25 13:24               ` Dave Chinner
2010-08-25 13:35                 ` Peter Zijlstra
2010-08-25 20:53                   ` Ted Ts'o
2010-08-25 20:59                     ` David Rientjes
2010-08-25 21:35                     ` Peter Zijlstra
2010-08-25 20:58                   ` David Rientjes
2010-08-25 21:11                     ` Christoph Lameter
2010-08-25 21:21                       ` Peter Zijlstra
2010-08-25 21:23                       ` David Rientjes
2010-08-25 21:35                         ` Christoph Lameter
2010-08-25 23:05                           ` David Rientjes
2010-08-26  1:30                             ` Christoph Lameter
2010-08-26  3:12                               ` David Rientjes
2010-08-26 14:16                                 ` Christoph Lameter
2010-08-26 22:31                                   ` David Rientjes
2010-08-26  0:09                   ` Dave Chinner
2010-08-25 14:13         ` Peter Zijlstra
2010-08-24 13:55   ` Dave Chinner
2010-08-24 14:03     ` Peter Zijlstra
2010-08-24 20:12     ` David Rientjes
2010-08-24 20:08   ` David Rientjes
2010-09-02  1:02 ` [patch v2 " David Rientjes
2010-09-02  1:03   ` [patch v2 3/5] fs: add nofail variant of alloc_buffer_head David Rientjes
2010-09-02  7:59   ` [patch v2 1/5] mm: add nofail variants of kmalloc kcalloc and kzalloc Jiri Slaby
2010-09-02 14:51     ` Jan Kara
2010-09-02 21:15       ` Neil Brown
2010-09-05 23:03         ` David Rientjes
2010-09-05 23:01     ` David Rientjes
2010-09-06  9:05   ` David Rientjes

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=20100826063759.GB705@dastard \
    --to=david@fromorbit.com \
    --cc=akpm@linux-foundation.org \
    --cc=jaxboe@fusionio.com \
    --cc=peterz@infradead.org \
    --cc=rientjes@google.com \
    --cc=tytso@mit.edu \
    /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).