linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Nick Piggin <npiggin@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	akpm@linux-foundation.org, linux-mm@kvack.org
Subject: Re: [patch 3/8] mm: merge nopfn into fault
Date: Thu, 24 May 2007 11:07:29 +0100	[thread overview]
Message-ID: <20070524100729.GB28305@infradead.org> (raw)
In-Reply-To: <20070524034557.GA20252@wotan.suse.de>

On Thu, May 24, 2007 at 05:45:57AM +0200, Nick Piggin wrote:
> On Wed, May 23, 2007 at 08:37:28PM -0700, Linus Torvalds wrote:
> > 
> > 
> > On Thu, 24 May 2007, Benjamin Herrenschmidt wrote:
> > > 
> > > Note that I culd just modify the address/page index in the struct
> > > vm_fault... doesn't make much difference in this case.
> > > 
> > > Might even create an arch helper prepare_special_pgsize_fault() or
> > > something like that that takes the VM fault struct, whack it the right
> > > way, and returns it to the driver for passing to vm_insert_pfn() so that
> > > all of the logic is actually hidden from the driver.
> > 
> > I don't think we really need that, but what I'd like to avoid is people 
> > using "address" when they don't actually need to (especially if it's just 
> > a quick-and-lazy conversion, and they use "address" to do the page index 
> > calculation with the "pgoff + ((address - vma->start) >> PAGE_SHIFT)" kind 
> > of thing.
> > 
> > So exactly _because_ the "nopage()" interface takes "address", I'd like to 
> > avoid it in that form in the "vm_fault" structure, just so that people 
> > don't do stupid things with it.
> > 
> > (And yes, I'm not proud of the "nopage()" interface, but it evolved from 
> > historical behaviour which did everything at the low level, so "address" 
> > _used_ to make sense for the same reason you want it now).
> 
> Yes, the goal was always to use pgoff to locate the page, because that
> is the correct abstraction to pass through this interface.
> 
>  
> > So just about any "hiding" would do it as far as I'm concerned. Ranging 
> > from the odd (making it a "virtual page number") to just using an 
> > inconvenient name that just makes it obvious that it shouldn't be used 
> > lightly ("virtual_page_fault_address"), to making it a type that cannot 
> > easily be used for that kind of arithmetic ("void __user *" would make 
> > sense, no?).
> 
> 'void __user *' seems reasonable, I think. Good idea.N

Abusing __user for something entirely different is really dumb,
just use the same __attribute__((noderef, address_space(N)) annotation
that __user and __iomem use. but please use a different address_space

--
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-05-24 10:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-18  7:37 akpm, Nick Piggin
2007-05-18 15:23 ` Linus Torvalds
2007-05-19  1:46   ` Nick Piggin
2007-05-23 23:40   ` Benjamin Herrenschmidt
2007-05-24  1:42     ` Nick Piggin
2007-05-24  2:04       ` Linus Torvalds
2007-05-24  2:16         ` Nick Piggin
2007-05-24  3:17         ` Benjamin Herrenschmidt
2007-05-24  3:26           ` Benjamin Herrenschmidt
2007-05-24  3:37             ` Linus Torvalds
2007-05-24  3:45               ` Nick Piggin
2007-05-24 10:07                 ` Christoph Hellwig [this message]
2007-05-24 10:15                   ` Benjamin Herrenschmidt
2007-05-24  3:48               ` Benjamin Herrenschmidt
2007-05-25 11:18               ` Nick Piggin
2007-05-25 16:36                 ` Linus Torvalds
2007-05-26  7:34                   ` Nick Piggin
2007-05-26  8:03                     ` Nick Piggin
2007-05-26 15:44                       ` Linus Torvalds

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=20070524100729.GB28305@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@suse.de \
    --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