From: Andrew Morton <akpm@linux-foundation.org>
To: Christoph Lameter <clameter@sgi.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Mel Gorman <mel@skynet.ie>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Daniel Phillips <phillips@google.com>,
linux-mm <linux-mm@kvack.org>
Subject: Re: [PATCH] add __GFP_ZERO to GFP_LEVEL_MASK
Date: Tue, 24 Jul 2007 17:06:48 -0700 [thread overview]
Message-ID: <20070724170648.97c1749b.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0707241639440.9018@schroedinger.engr.sgi.com>
On Tue, 24 Jul 2007 16:58:51 -0700 (PDT) Christoph Lameter <clameter@sgi.com> wrote:
> On Tue, 24 Jul 2007, Andrew Morton wrote:
>
> > __GFP_COMP I'm not so sure about.
> > drivers/char/drm/drm_pci.c:drm_pci_alloc() (and other places like infiniband)
> > pass it into dma_alloc_coherent() which some architectures implement via slab. umm,
> > arch/arm/mm/consistent.c is one such.
>
> Should drm_pci_alloc really aright in setting __GFP_COMP?
I don't see what's special about that dma_alloc_coherent() call.
> dma_alloc_coherent does not set __GFP_COMP for other higher order allocs
> and expects to be able to operate on the page structs indepedently. That
> is not the case for a compound page.
>
> Creates a really interesting case for SLAB. Slab did not use __GFP_COMP in
> order to be able to allow the use page->private (No longer an issue since
> the 2.6.22 cleanups and avoiding the use of page->private for the compound
> head).
>
> Now the __GFP_COMP flag is passed through for any higher order page alloc
> (such as a kmalloc allocation > PAGE_SIZE). Then we may have allocated one
> slab that is a compound page amoung others higher order pages allocated
> without __GFP_COMP. May have caused rare and strange failures in 2.6.21
> and earlier because of the concurrent page->private use in compound head
> pages and arch pages.
>
> SLUB will always use __GFP_COMP so the pages are consistent regardless if
> __GFP_COMP is passed in or not.
>
> The strange scenarios come about by expecting a page allocation when
> sometimes we just substitute a slab alloc.
>
> We could filter __GFP_COMP out to avoid the BUG()? Or deal with it on a
> case by case basis?
Fix callers, I'd suggest. There are a number of fishy-looking open-coded
usages of __GFP_COMP around the place.
It's a bit sad that some architectures are using slab for dma_alloc_coherent()
while others go to alloc_pages().
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-07-25 0:06 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-23 10:03 [PATCH] add __GFP_ZERP " Peter Zijlstra
2007-07-23 11:21 ` Mel Gorman
2007-07-23 11:38 ` [PATCH] add __GFP_ZERO " Peter Zijlstra
2007-07-23 12:30 ` Mel Gorman
2007-07-23 23:17 ` Christoph Lameter
2007-07-24 6:01 ` Peter Zijlstra
2007-07-24 6:48 ` Peter Zijlstra
2007-07-24 7:14 ` Christoph Lameter
2007-07-24 7:09 ` Christoph Lameter
2007-07-24 7:24 ` Peter Zijlstra
2007-07-24 7:35 ` Christoph Lameter
2007-07-24 19:07 ` Christoph Lameter
2007-07-24 19:25 ` Andrew Morton
2007-07-24 19:36 ` Christoph Lameter
2007-07-24 22:10 ` Andrew Morton
2007-07-24 23:00 ` Christoph Lameter
2007-07-24 23:12 ` Andrew Morton
2007-07-24 23:58 ` Christoph Lameter
2007-07-25 0:06 ` Andrew Morton [this message]
2007-07-25 13:06 ` Mel Gorman
2007-07-23 18:37 ` [PATCH] add __GFP_ZERP " Andrew Morton
2007-07-23 18:40 ` Peter Zijlstra
2007-07-23 21:43 ` Christoph Lameter
2007-07-23 22:13 ` Andrew Morton
2007-07-23 22:41 ` Linus Torvalds
2007-07-23 22:56 ` Andrew Morton
2007-07-23 23:00 ` Christoph Lameter
2007-07-23 22:50 ` Christoph Lameter
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=20070724170648.97c1749b.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=a.p.zijlstra@chello.nl \
--cc=clameter@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@skynet.ie \
--cc=phillips@google.com \
--cc=torvalds@linux-foundation.org \
/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