From: Nick Piggin <nickpiggin@yahoo.com.au>
To: "Bryan O'Sullivan" <bos@pathscale.com>
Cc: Hugh Dickins <hugh@veritas.com>,
Roland Dreier <rdreier@cisco.com>, Andrew Morton <akpm@osdl.org>,
torvalds@osdl.org, hch@infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 10 of 20] ipath - support for userspace apps using core driver
Date: Sat, 18 Mar 2006 09:14:50 +1100 [thread overview]
Message-ID: <441B34DA.3040709@yahoo.com.au> (raw)
In-Reply-To: <1142611861.28538.22.camel@serpentine.pathscale.com>
Bryan O'Sullivan wrote:
> On Fri, 2006-03-17 at 11:37 +1100, Nick Piggin wrote:
>
>
>>But it doesn't look like dma_alloc_coherent is guaranteed to return
>>memory allocated from the regular page allocator, nor even memory
>>backed by a struct page.
>
>
> Hmm. Which of the implementations that you've seen will return
> something not backed by a struct page? On the half dozen arches I've
> looked at (i386/x86_64, powerpc, sparc64, ia64, mips), every one uses
> either kmalloc, __get_free_pages, or __alloc_pages at some point, and I
> think they all have struct pages behind them.
>
Well I was mainly just looking at the interface definition and that it
only returns an address. i386 specifically looks like it can return
ioremap memory in some cases, right? (which I don't think needs to have
a struct page behind it)
>
>>For example, I see one that returns kmalloc()ed memory. If the pages
>>for the slab are already allocated then __GFP_COMP will not do anything
>>there.
>
>
> Bleh. Perhaps I'm being dense here, but if I'm making a request of
> non-zero order and the slab has already been allocated, won't it be
> populated with compound pages anyway? Or will it have been allocated as
> a single giant compound page, just handing me back individual hunks of
> the appropriate size?
>
By the looks of the slab implementation, it will vary depending on
whether or not the slab was already allocated and whether that was using
__GFP_COMP or not.
> I ask this because I seemed to be getting compound pages out of
> dma_alloc_coherent even when I *wasn't* passing in __GFP_COMP. This is
> apparently why PG_private was set on the individual pages I was getting
> back.
>
I think the reason was a little different: you're getting a higher order
page. This can either be compound or non-compound. If it is not compound,
then you (or the VM) can easily end up freeing one of its constituent
pages (and PagePrivate is set when that page is free in the allocator).
Then when you go to free the whole higher-order page, it finds that one
of its constituent pages has PagePrivate set (which is a bug).
--
SUSE Labs, Novell Inc.
Send instant messages to your online friends http://au.messenger.yahoo.com
next prev parent reply other threads:[~2006-03-17 22:15 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <71644dd19420ddb07a75.1141922823@localhost.localdomain>
2006-03-09 23:28 ` [PATCH 10 of 20] ipath - support for userspace apps using core driver Roland Dreier
2006-03-09 23:55 ` Bryan O'Sullivan
2006-03-10 0:01 ` Roland Dreier
2006-03-10 0:07 ` Bryan O'Sullivan
2006-03-10 0:32 ` Roland Dreier
2006-03-10 0:36 ` Bryan O'Sullivan
2006-03-10 0:37 ` Andrew Morton
2006-03-10 0:50 ` Bryan O'Sullivan
2006-03-16 0:56 ` Bryan O'Sullivan
2006-03-16 1:51 ` Roland Dreier
2006-03-16 2:11 ` Bryan O'Sullivan
2006-03-16 2:37 ` Roland Dreier
2006-03-16 2:52 ` Bryan O'Sullivan
2006-03-16 2:56 ` Bryan O'Sullivan
2006-03-16 3:28 ` Andrew Morton
2006-03-16 4:58 ` Bryan O'Sullivan
2006-03-16 5:38 ` Andrew Morton
2006-03-16 5:54 ` Roland Dreier
2006-03-16 6:17 ` Andrew Morton
2006-03-16 6:44 ` Nick Piggin
2006-03-16 9:39 ` Andrew Morton
2006-03-16 10:00 ` Nick Piggin
2006-03-16 7:25 ` Roland Dreier
2006-03-16 16:46 ` Linus Torvalds
2006-03-16 14:57 ` Hugh Dickins
2006-03-16 6:31 ` Nick Piggin
2006-03-16 14:34 ` Hugh Dickins
2006-03-17 0:37 ` Nick Piggin
2006-03-17 1:09 ` Roland Dreier
2006-03-17 15:27 ` Hugh Dickins
2006-03-17 22:21 ` Nick Piggin
2006-03-17 16:11 ` Bryan O'Sullivan
2006-03-17 16:28 ` Linus Torvalds
2006-03-17 16:40 ` Bryan O'Sullivan
2006-03-17 22:28 ` Nick Piggin
2006-03-17 22:14 ` Nick Piggin [this message]
2006-03-16 15:12 ` Bryan O'Sullivan
2006-03-16 17:08 ` Linus Torvalds
2006-03-16 17:46 ` Hugh Dickins
2006-03-16 17:53 ` Bryan O'Sullivan
2006-03-16 14:24 ` Hugh Dickins
2006-03-16 15:33 ` Bryan O'Sullivan
2006-03-16 17:23 ` Hugh Dickins
2006-03-16 17:40 ` Bryan O'Sullivan
2006-03-16 19:52 ` Bryan O'Sullivan
2006-03-16 20:10 ` Hugh Dickins
2006-03-16 20:35 ` Linus Torvalds
2006-03-16 20:43 ` Bryan O'Sullivan
2006-03-21 20:52 ` Bryan O'Sullivan
2006-03-21 23:20 ` Hugh Dickins
2006-03-22 15:58 ` Bryan O'Sullivan
2006-03-22 16:19 ` Linus Torvalds
2006-03-22 16:43 ` Bryan O'Sullivan
2006-03-22 17:46 ` Hugh Dickins
2006-03-22 17:53 ` Bryan O'Sullivan
2006-03-16 23:37 ` Roland Dreier
2006-03-16 23:51 ` Remapping pages mapped to userspace (was: [PATCH 10 of 20] ipath - support for userspace apps using core driver) Roland Dreier
2006-03-16 23:56 ` Bryan O'Sullivan
2006-03-17 1:10 ` Remapping pages mapped to userspace Roland Dreier
2006-03-17 1:12 ` Roland Dreier
2006-03-17 1:28 ` Alan Cox
2006-03-17 2:16 ` Roland Dreier
2006-03-17 17:13 ` Remapping pages mapped to userspace (was: [PATCH 10 of 20] ipath - support for userspace apps using core driver) Hugh Dickins
2006-03-17 17:17 ` Bryan O'Sullivan
2006-03-17 17:30 ` Linus Torvalds
2006-03-17 18:20 ` Hugh Dickins
2006-03-17 22:58 ` Remapping pages mapped to userspace Roland Dreier
2006-03-16 15:08 ` [PATCH 10 of 20] ipath - support for userspace apps using core driver Bryan O'Sullivan
2006-03-16 17:27 ` Hugh Dickins
2006-03-16 17:44 ` Bryan O'Sullivan
2006-03-16 16:52 ` Bryan O'Sullivan
2006-03-16 3:58 ` Linus Torvalds
2006-03-16 4:53 ` Roland Dreier
2006-03-16 2:28 ` Linus Torvalds
2006-03-09 23:33 ` Roland Dreier
2006-03-09 23:56 ` Bryan O'Sullivan
2006-03-10 0:35 [PATCH 0 of 20] [RFC] ipath driver - another round for review Bryan O'Sullivan
2006-03-10 0:35 ` [PATCH 10 of 20] ipath - support for userspace apps using core driver Bryan O'Sullivan
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=441B34DA.3040709@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=akpm@osdl.org \
--cc=bos@pathscale.com \
--cc=hch@infradead.org \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rdreier@cisco.com \
--cc=torvalds@osdl.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