linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: Nishanth Aravamudan <nacc@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 10:27:40 -0800	[thread overview]
Message-ID: <1196447260.19681.8.camel@localhost> (raw)
In-Reply-To: <20071130041922.GQ13444@us.ibm.com>

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.

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.

> 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.

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. :)

-- Dave

--
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>

  reply	other threads:[~2007-11-30 17:27 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 [this message]
2007-11-30 17:43       ` Nishanth Aravamudan
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=1196447260.19681.8.camel@localhost \
    --to=haveblue@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=apw@shadowen.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@skynet.ie \
    --cc=nacc@us.ibm.com \
    --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).