On Mon, Mar 24, 2014 at 8:31 AM, Steven Noonan <steven@xxxxxxxxxxxxxx> wrote: > Vrabel's comments make me think that revisiting the elimination of the > _PAGE_NUMA bit implementation would be a good idea... should I CC you > on this discussion (not sure if you're subscribed to xen-devel, or if > LKML is a better place for that discussion)? I detest the PAGE_NUMA games myself, but: From: David Vrabel <david.vrabel@xxxxxxxxxx>: > > I really do not understand how you're supposed to distinguish between a > PTE for a PROT_NONE page and one with _PAGE_NUMA -- they're identical. > i.e., pte_numa() will return true for a PROT_NONE protected page which > just seems wrong to me. The way to distinguish PAGE_NUMA from PROTNONE is *supposed* to be by looking at the vma, and PROTNONE goes together with a vma with PROT_NONE. That's what the comments in pgtable_types.h say. However, as far as I can tell, that is pure and utter bullshit. It's true that generally handle_mm_fault() shouldn't be called for PROT_NONE pages, since it will fail the protection checks. However, we have FOLL_FORCE that overrides those protection checks for things like ptrace etc. So people have tried to convince me that _PAGE_NUMA works, but I'm really not at all sure they are right. I fundamentally think that it was a horrible horrible disaster to make _PAGE_NUMA alias onto _PAGE_PROTNONE. But I'm cc'ing the people who tried to convince me otherwise last time around, to see if they can articulate this mess better now. The argument *seems* to be that if things are truly PROT_NONE, then the page will never be touched by page faulting code (and as mentioned, I think that argument is fundamentally broken), and if it's PROT_NUMA then the page faulting code will magically do the right thing. FURTHERMORE, the argument was that we can't just call things PROT_NONE and just say that "those are the semantics", because on other architectures PROT_NONE might mean/do something else. Which really makes no sense either, because if the argument was that PROT_NONE causes faults that can either be handled as faults (for PROT_NONE) or as NUMA issues (for NUMA), then dammit, that argument should be completely architecture-independent. But I gave up arguing with people. I will state (again) that I think this is a f*cking mess, and saying that PROTNONE and NUMA are somehow the exact same thing on x86 but not in general is bogus crap. And saying that you can determine which it is from the vma is very debatable too. Let the people responsible for the crap try to explain why it works and has to be that mess. Again. Rik, Mel? Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>