linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Michael Rubin <mrubin@google.com>
Cc: Curt Wohlgemuth <curtw@google.com>, linux-ext4@vger.kernel.org
Subject: Re: Use of kmalloc vs vmalloc in ext4?
Date: Fri, 24 Apr 2009 23:07:03 -0400	[thread overview]
Message-ID: <20090425030703.GD13608@mit.edu> (raw)
In-Reply-To: <532480950904052345m48bc5df5wcdc4c5e32778130c@mail.gmail.com>

On Sun, Apr 05, 2009 at 11:45:10PM -0700, Michael Rubin wrote:
> Anyone have any comments? Or historical reasons? We operate with some
> constrained memory situations, and were wondering if a patch to move
> from kmalloc to vmalloc would be well received.

Sorry, I didn't have time to get to this until now.  I've been burning
the midnight oil getting the e2fsprogs 1.41.5 release out, as well as
catching up after the Collab Summit.

The best thing to do I think is to try using kmalloc(), and if it
fails, to fall back to vmalloc().  We can use is_vmalloc_addr() to
decide whether to use vfree() or kfree(), a trick which I picked up
from fs/ntfs/malloc.h.  I'm surprised this trick isn't used more in
the kernel.  Perhaps there should be made a general-purpose
infrastructure, but for now I'll just open-code it.

		    	    	      		- Ted

  parent reply	other threads:[~2009-04-25  3:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-11 14:32 Use of kmalloc vs vmalloc in ext4? Curt Wohlgemuth
2009-04-06  6:45 ` Michael Rubin
2009-04-06  9:33   ` Andreas Dilger
2009-04-25  3:00   ` [PATCH] ext4: Fallback to vmalloc if kmalloc can't allocate s_flex_groups array Theodore Ts'o
2009-04-25  3:28     ` Eric Sandeen
2009-04-25  3:57       ` Theodore Tso
2009-04-25  3:07   ` Theodore Tso [this message]
2009-04-25  3:39     ` Use of kmalloc vs vmalloc in ext4? Theodore Tso
2009-04-26  2:12       ` Theodore Tso

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=20090425030703.GD13608@mit.edu \
    --to=tytso@mit.edu \
    --cc=curtw@google.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=mrubin@google.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;
as well as URLs for NNTP newsgroup(s).