mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benjamin Blum <bblum@google.com>
To: Paul Menage <menage@google.com>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	containers@lists.linux-foundation.org,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH 3/3] Quick vmalloc vs kmalloc fix to the case where array  size is too large
Date: Tue, 14 Jul 2009 14:30:28 -0700	[thread overview]
Message-ID: <2f86c2480907141430u314f8987s857bdaa229d6e482@mail.gmail.com> (raw)
In-Reply-To: <6599ad830907141050r1e9dde98l56afd37629f749e8@mail.gmail.com>

Indeed.

Alternatively, I could make it case on KMALLOC_MAX_SIZE as follows:

if (size > KMALLOC_MAX_SIZE) {
    /* use vmalloc directly */
} else {
    /* try kmalloc, and, expecting fragmentation, if that fails, use vmalloc */
}

As the free wrapper uses is_vmalloc_addr, it'd work fine and be able
to decide for a certain range of sizes whether kmalloc or vmalloc is
appropriate.

On Tue, Jul 14, 2009 at 10:50 AM, Paul Menage<menage@google.com> wrote:
> On Tue, Jul 14, 2009 at 10:47 AM, Dave Hansen<dave@linux.vnet.ibm.com> wrote:
>>
>> How big were those allocations that were failing?  The code made it
>> appear that order-2 (PAGE_SIZE*4) allocations were failing.  That's a
>> bit lower than I'd expect the page allocator to start failing.
>
> I think it depends on how much fragmentation you've got.
>
> We've seen it fail for cpusets with (I guess) hundreds or thousands of threads.
>
> Paul
>

      reply	other threads:[~2009-07-14 21:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-10 23:01 [PATCH v2 0/3] CGroups: cgroup member list enhancement/fix Ben Blum
2009-07-10 23:01 ` [PATCH 1/3] Adds a read-only "procs" file similar to "tasks" that shows only unique tgids Ben Blum
2009-07-13  3:46   ` Li Zefan
2009-07-13 15:25     ` Benjamin Blum
2009-07-14 18:34   ` Dave Hansen
2009-07-14 21:26     ` Benjamin Blum
2009-07-14 21:49       ` Dave Hansen
2009-07-14 22:55         ` Benjamin Blum
2009-07-15  1:31         ` Li Zefan
2009-07-10 23:02 ` [PATCH 2/3] Ensures correct concurrent opening/reading of pidlists across pid namespaces Ben Blum
2009-07-11 21:59   ` Serge E. Hallyn
2009-07-10 23:02 ` [PATCH 3/3] Quick vmalloc vs kmalloc fix to the case where array size is too large Ben Blum
2009-07-13  3:03   ` Li Zefan
2009-07-13  6:03     ` KAMEZAWA Hiroyuki
2009-07-13 15:27       ` Benjamin Blum
2009-07-13 23:49         ` KAMEZAWA Hiroyuki
2009-07-14  3:50           ` Paul Menage
2009-07-14  3:53             ` KAMEZAWA Hiroyuki
2009-07-14  4:04               ` Paul Menage
2009-07-14  4:25                 ` KAMEZAWA Hiroyuki
2009-07-14 17:26                   ` Benjamin Blum
2009-07-14 17:28                   ` Paul Menage
2009-07-14 17:47                     ` Dave Hansen
2009-07-14 17:50                       ` Paul Menage
2009-07-14 21:30                         ` Benjamin Blum [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=2f86c2480907141430u314f8987s857bdaa229d6e482@mail.gmail.com \
    --to=bblum@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=containers@lists.linux-foundation.org \
    --cc=dave@linux.vnet.ibm.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=menage@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

all inboxes | Powered by JetHome®