From: Nishanth Aravamudan <nacc@us.ibm.com>
To: Dave Hansen <haveblue@us.ibm.com>
Cc: akpm@linux-foundation.org, mel@skynet.ie, wli@holomorphy.com,
apw@shadowen.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm: fix confusing __GFP_REPEAT related comments
Date: Fri, 30 Nov 2007 09:43:07 -0800 [thread overview]
Message-ID: <20071130174307.GS13444@us.ibm.com> (raw)
In-Reply-To: <1196447260.19681.8.camel@localhost>
On 30.11.2007 [10:27:40 -0800], Dave Hansen wrote:
> On Thu, 2007-11-29 at 20:19 -0800, Nishanth Aravamudan wrote:
> > "In looking at the callers using __GFP_REPEAT, not all handle failure --
> > should they be using __NOFAIL?"
> >
> > I *think* that all the current __GFP_REPEAT users are order <=
> > PAGE_ALLOC_CSOTLY_ORDER. Perhaps they all mean to use __GPF_NOFAIL? Some
> > don't handle failure immediately, but maybe their callers do, I haven't
> > had time to investigate fully.
>
> I think we treat pagetable allocations just like normal ones with
> error handling. If I saw a pte_alloc() in a patch that was used
> without checking for NULL, I'd certainly bitch about it.
Hrm, you may be right. And it appears the only non-pagetable callers of
__GFP_REPEAT allocations are:
drivers/mmc/host/wbsd.c::wbsd_request_dma()
drivers/net/ppp_deflate.c::z_decomp_alloc()
drivers/s390/char/vmcp.c::vmcp_write()
net/core/sock.c::sock_alloc_send_pskb()
But those are of course only the explicit callers -- there are
presumably many others that are getting the same effect by passing a low
order.
> In any case, if we want to nitpick, the *callers* haven't asked for
> __GFP_NOFAIL, so they shouldn't be depending on a lack of failures.
I agree.
> > And the whole gist, per the comments in mm/page_alloc.c, is that this is
> > all dependent upon this implementation of the VM. I think that means you
> > can't rely on those semantics being valid forever. So it's best for
> > callers to be as explicit as possible ... but in this case, I'm not sure
> > that the desired semantics actually exist.
>
> I don't really buy this "in this implementation of the VM" crap. When
> people go to figure out which functions and flags to use, they don't
> just go look at headers. They look at and depend on the
> implementations. If we change the implementations, we go change all
> the callers, too.
I agree here, as well. I think that's why I'm asking ... if the
implementation is changed to perhaps different semantics: first, do we
have a set of semantics that are more desirably? second, do I interpret
the current callers flags as is and risk breaking some mild assumption
somewhere (that, for instance, while __GFP_REPEAT might fail, it doesn't
currently, so callers, while handling errors, really don't expect to
ever hit that code path?)
> Your patch highlights an existing problem: we're not being very good
> with __GFP_REPEAT. All of the pagetable users (on x86 at least) are
> using __GFP_REPEAT, but effectively getting __GFP_NOFAIL. There are
> some other users around that might have larger buffers, but I think
> pagetable pages are pretty guaranteed to stay <= 1 page in size. :)
Indeed.
Thanks,
Nish
--
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center
--
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-11-30 17:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-29 21:48 [PATCH] mm: fix confusing __GFP_REPEAT related comments Nishanth Aravamudan
2007-11-29 23:14 ` Dave Hansen
2007-11-30 4:19 ` Nishanth Aravamudan
2007-11-30 18:27 ` Dave Hansen
2007-11-30 17:43 ` Nishanth Aravamudan [this message]
2007-11-30 18:31 ` Dave Hansen
2007-12-02 11:58 ` William Lee Irwin III
2007-12-03 18:06 ` Nishanth Aravamudan
-- strict thread matches above, loose matches on Subject: below --
2007-11-20 1:10 Nishanth Aravamudan
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=20071130174307.GS13444@us.ibm.com \
--to=nacc@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=apw@shadowen.org \
--cc=haveblue@us.ibm.com \
--cc=linux-mm@kvack.org \
--cc=mel@skynet.ie \
--cc=wli@holomorphy.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).