All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] GFS2: Use kmalloc when possible for ->readdir() (try #2)
Date: Wed, 28 Jul 2010 18:51:19 +0100	[thread overview]
Message-ID: <1280339479.2502.90.camel@localhost> (raw)
In-Reply-To: <20100728101327.88dbd7ac.akpm@linux-foundation.org>

Hi,

On Wed, 2010-07-28 at 10:13 -0700, Andrew Morton wrote:
> On Wed, 28 Jul 2010 17:56:23 +0100 Steven Whitehouse <swhiteho@redhat.com> wrote:
> 
> > +static void *gfs2_alloc_sort_buffer(unsigned size)
> > +{
> > +	void *ptr = NULL;
> > +
> > +	if (size < KMALLOC_MAX_SIZE)
> > +		ptr = kmalloc(size, GFP_NOFS | __GFP_NOWARN);
> > +	if (!ptr)
> > +		ptr = __vmalloc(size, GFP_NOFS, PAGE_KERNEL);
> > +	return ptr;
> > +}
> > +
> > +static void gfs2_free_sort_buffer(void *ptr)
> > +{
> > +	if (is_vmalloc_addr(ptr))
> > +		vfree(ptr);
> > +	else
> > +		kfree(ptr);
> > +}
> 
> This got kicked around a bit in May (Subject: mm: generic adaptive
> large memory allocation APIs).  That patch tried kmalloc(), then
> alloc_pages(), then vmalloc().  Nothing got merged though.
> 
> I wasn't terribly excited about it because of vague fears that it would
> just incite people to spend even less effort thinking about how large
> their individual allocations are.
> 
> apparmor has a private kvfree/kvmalloc.  Probably there are other
> versions floating around the tree as well.
> 

I did wonder about that too, but bearing in mind that the longer term
plan is to eliminate the vmalloc call, I wasn't sure it was worth doing,

Steve.




  reply	other threads:[~2010-07-28 17:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-28 11:15 [Cluster-devel] GFS2: Use kmalloc when possible for ->readdir() Steven Whitehouse
2010-07-28 15:39 ` Linus Torvalds
2010-07-28 16:52   ` Steven Whitehouse
2010-07-28 16:56   ` [Cluster-devel] GFS2: Use kmalloc when possible for ->readdir() (try #2) Steven Whitehouse
2010-07-28 17:13     ` Andrew Morton
2010-07-28 17:51       ` Steven Whitehouse [this message]
2010-07-29 17:58       ` Joel Becker

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=1280339479.2502.90.camel@localhost \
    --to=swhiteho@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.