public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Stephen Tweedie <sct@redhat.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Andrea Arcangeli <andrea@suse.de>,
	Rogier Wolff <R.E.Wolff@BitWizard.nl>,
	"Stephen C. Tweedie" <sct@redhat.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: mapping user space buffer to kernel address space
Date: Thu, 19 Oct 2000 21:06:50 +0100	[thread overview]
Message-ID: <20001019210650.A1984@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.10.10010172129290.6732-100000@penguin.transmeta.com>; from torvalds@transmeta.com on Tue, Oct 17, 2000 at 09:42:36PM -0700

Hi,

On Tue, Oct 17, 2000 at 09:42:36PM -0700, Linus Torvalds wrote:

> Now, the way I'v ealways envisioned this to work is that the VM scanning
> function basically always does the equivalent of just
> 
>  - get PTE entry, clear it out.
>  - if PTE was dirty, add the page to the swap cache, and mark it dirty,
>    but DON'T ACTUALLY START THE IO!
>  - free the page.
> 
> Then, we'd move the "writeout" part into the LRU queue side, and at that
> point I agree with you 100% that we probably should just delay it until
> there are no mappings available

I've just been talking about this with Ben LaHaise and Rik van Riel,
and Ben brought up a nasty problem --- NFS, which because of its
credentials requirements needs to have the struct file available in
its writepage function.  Of course, if we defer the write then we
don't necessarily have the file available when we come to flush the
page from cache.

One answer is to say "well then NFS is broken, fix it".  It's not too
hard --- NFS mmaps need a wp_page function which registers the
caller's credentials against the page when we dirty it so that we can
use those credentials on flush.  That means that writes to a
multiply-mapped file essentially get random credentials, but I don't
think we care --- the credentials eventually used will be enough to
avoid the root_squash problems and the permissions at open make sure
we're not doing anything illegal.  

(Changing permissions on an already-mmaped file and causing the NFS
server to refuse the write raises problems which are ... interesting,
but I'm not convinced that that is a new problem; I suspect we can
fabricate such a failure today.)

--Stephen
--
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.eu.org/Linux-MM/

       reply	other threads:[~2000-10-19 20:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20001018015949.C4635@athlon.random>
     [not found] ` <Pine.LNX.4.10.10010172129290.6732-100000@penguin.transmeta.com>
2000-10-19 20:06   ` Stephen Tweedie [this message]
2000-10-20 17:34     ` mapping user space buffer to kernel address space Linus Torvalds
     [not found] <200010140918.LAA10416@cave.bitwizard.nl>
     [not found] ` <Pine.LNX.4.10.10010141916490.1642-100000@penguin.transmeta.com>
     [not found]   ` <20001016000854.A27414@athlon.random>
     [not found]     ` <20001016221401.A19951@redhat.com>
     [not found]       ` <20001017001349.F17222@athlon.random>
2000-10-17 13:53         ` Stephen Tweedie

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=20001019210650.A1984@redhat.com \
    --to=sct@redhat.com \
    --cc=R.E.Wolff@BitWizard.nl \
    --cc=andrea@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=torvalds@transmeta.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