linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Hugh Dickins <hugh@veritas.com>,
	Jared Hulbert <jaredeh@gmail.com>,
	Carsten Otte <cotte@de.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	linux-arch@vger.kernel.org
Subject: Re: [rfc][patch 2/2] mm: introduce optional pte_special pte bit
Date: Wed, 16 Jan 2008 05:37:28 +0100	[thread overview]
Message-ID: <20080116043728.GA7684@wotan.suse.de> (raw)
In-Reply-To: <alpine.LFD.1.00.0801151944120.2806@woody.linux-foundation.org>

On Tue, Jan 15, 2008 at 08:04:19PM -0800, Linus Torvalds wrote:
> 
> 
> On Wed, 16 Jan 2008, Nick Piggin wrote:
> > 
> > My biggest concen is that s390 basically are thinking about doing
> > something like this:
> > 
> >        if (unlikely(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP))) {
> >                 if (vma->vm_flags & VM_MIXEDMAP) {
> > #ifdef s390
> > 			if (pte_special(pte))
> > 				return NULL;
> > #else
> >                         if (!pfn_valid(pfn))
> >                                 return NULL;
> > #endif
> 
> Ok. So now that I actually know what the reason for the insanity was.
> 
> > Basically what I want to do is make the pte_special part usable by
> > all architectures, and bring it out of the vma tests.
> 
> But if it's always there, then there is no reason for *any* of this. The 
> right thing is to just always do
> 
> 	return pte_special(pte) ? NULL : pte_page(pte);
> 
> and I'd be happy with that too. I'm just not happy with the mixing, and 
> with the #ifdef inside code.

Right, that's what I had hoped as well. But when I say pte_special
*usable* by all architectures, I mean it is usable by all that can
spare a bit in the pte. Apparently ARM can't because some some bug
in an Xscale CPU or something (the thread is on linux-arch).


> All the other code only makes sense if there isn't a special bit in the 
> pte, but I was literally told that the only architecture that does *not* 
> have any free bits for that is S390. So now you use S390 as an excuse to 
> do that "pte_special()", which is what I think EVERYBODY ELSE wanted to do 
> in the first place!

I remember that too. I guess some wires got crossed somewhere. s390
evidently does have free bits in their pte_present-type ptes.

 
> Can you see why I'm not so enamoured with the patch? Either it makes 
> sense, and *everybody* should just use that simple one-liner, or it 
> doesn't make sense, and *nobody* should do it.
> 
> It's the "both cases" that just drives me wild. It doesn't make sense.

I can see what you mean, but if we have one architecture (arm) that
cannot support pte_special, then the conclusion is that we should
only support vma-based scheme and be done with it.

But in that case will still end up with the s390 specific code in
the VM_MIXEDMAP case, because they cannot support VM_MIXEDMAP with
pfn_valid (because of their memory model). So once they have that
special case there, I'd much rather make it an explicit core VM
concept rather than hiding it away in s390 code.

The argument to allow other architectures to use it is a very minor
one, just that there is no reason *not* to allow them to use it if
it generates even slightly better code (especially not if they want
to use a pte_special bit for other reasons anyway eg. lockless GUP).

Actually it is useful even just to involve the core VM people in the
logic rather than hiding it in s390 stuff (which scares people away).
And also makes the pte-based scheme testable on non-s390...


  reply	other threads:[~2008-01-16  4:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-13  3:08 [rfc] changes to user memory mapping scheme Nick Piggin
2008-01-13  3:09 ` [rfc][patch 1/2] mm: introduce VM_MIXEDMAP Nick Piggin
2008-01-13  3:10 ` [rfc][patch 2/2] mm: introduce optional pte_special pte bit Nick Piggin
2008-01-13  3:41   ` Linus Torvalds
2008-01-13  4:39     ` Nick Piggin
2008-01-13  4:45       ` Linus Torvalds
2008-01-13  5:06         ` Nick Piggin
2008-01-13 16:50           ` Linus Torvalds
2008-01-13 20:46             ` Martin Schwidefsky
2008-01-14 21:04             ` Jared Hulbert
2008-01-15  9:18               ` Carsten Otte
2008-01-16  3:38             ` Nick Piggin
2008-01-16  4:04               ` Linus Torvalds
2008-01-16  4:37                 ` Nick Piggin [this message]
2008-01-16  4:48                   ` Linus Torvalds
2008-01-16  4:51                     ` David Miller
2008-01-16  5:23                       ` Linus Torvalds
2008-01-16  5:48                         ` Nick Piggin
2008-01-16  9:52                           ` Martin Schwidefsky
2008-01-16  5:17                     ` Nick Piggin
2008-01-16 10:52                       ` Catalin Marinas
2008-01-16 18:18                         ` Russell King
2008-01-16 17:21                       ` Linus Torvalds
2008-01-16 17:14   ` David Howells

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=20080116043728.GA7684@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=cotte@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hugh@veritas.com \
    --cc=jaredeh@gmail.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=schwidefsky@de.ibm.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;
as well as URLs for NNTP newsgroup(s).