linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Jared Hulbert <jaredeh@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Carsten Otte <cotte@de.ibm.com>,
	Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	Maxim Shchetynin <maxim@de.ibm.com>
Subject: Re: [RFC][PATCH 1/3] xip: no struct pages -- get_xip_mem
Date: Tue, 11 Mar 2008 11:58:53 +0100	[thread overview]
Message-ID: <20080311105853.GA31429@wotan.suse.de> (raw)
In-Reply-To: <alpine.LFD.1.00.0803072331090.2911@woody.linux-foundation.org>

On Fri, Mar 07, 2008 at 11:37:32PM -0800, Linus Torvalds wrote:
> 
> 
> On Fri, 7 Mar 2008, Jared Hulbert wrote:
> >
> > [RFC][PATCH 1/3] xip: no struct pages -- get_xip_mem
> > 
> > Convert XIP to support non-struct page backed memory.
> > The get_xip_page API is changed from a page based to an address/pfn based one.
> 
> Is there any way we could just re-use the same calling conventions as we 
> already use for "vma->fault()"?
> 
> > +	int (*get_xip_mem)(struct address_space *, pgoff_t, int, void **,
> > +			unsigned long *);
> 
> This really looks very close to 
> 
> 	int (*fault)(struct vm_area_struct *vma, struct vm_fault *vmf);
> 
> and "struct vm_fault" returns either a kernel virtual address or a "struct 
> page *" 
> 
> So would it be possible to just use the same calling convention, except 
> passing a "struct address_space" instead of a "struct vm_area_struct"?
> 
> I realize that "struct vm_fault" doesn't have a pfn in it (if they don't 
> do a "struct page", they are expected to fill in the PTE directly instead 
> and return VM_FAULT_NOPAGE), but I wonder if it should.
> 
> The whole git_xip_page() issue really looks very similar to "fault in a 
> page from an address space". It feels kind of wrong to have filesystems 
> implement two functions for what seems to be the exact same issue.

It's not quite the same. get_xip_mem is used not just for page faults,
but also for read(2) and write(2) -- this really is the whole reason
why it wants a pfn and a kaddr: for the fault path, you need to install
the pfn, for read or write, the kernel wants a handle on the memory.

I think I'd rather not use vm_fault at the moment, and definitely not
unify it with fault (I'm still trying to unify nopage, nopfn, and
page_mkwrite with fault; and all of those really are special cases of
a fault).

Anyway, I'm just reposting the patchset, I'd love to get the ball rolling
again...


      parent reply	other threads:[~2008-03-11 10:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-08  4:33 [RFC][PATCH 1/3] xip: no struct pages -- get_xip_mem Jared Hulbert
2008-03-08  7:37 ` Linus Torvalds
2008-03-08 18:53   ` Jared Hulbert
2008-03-10 23:43     ` Jared Hulbert
2008-03-11 10:58   ` Nick Piggin [this message]

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=20080311105853.GA31429@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=cotte@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=jaredeh@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=maxim@de.ibm.com \
    --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).