linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@transmeta.com>
To: Bill Hawes <whawes@star.net>
Cc: ganesh.sittampalam@magd.ox.ac.uk,
	"Stephen C. Tweedie" <sct@redhat.com>,
	Virtual Memory problem report list
	<linux-kernel@vger.rutgers.edu>,
	mingo@valerie.inf.elte.hu, Alan Cox <number6@the-village.bc.nu>,
	"David S. Miller" <davem@dm.cobaltmicro.com>
Subject: Re: Progress! was: Re: Yet more VM writable swap-cached pages
Date: Thu, 9 Jul 1998 19:18:33 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.3.96.980709191306.431I-100000@penguin.transmeta.com> (raw)
In-Reply-To: <35A579F3.68F549AF@star.net>



On Thu, 9 Jul 1998, Bill Hawes wrote:
>
> > +extern inline pte_t pte_mkwrite(pte_t pte)     { pte_val(pte) |= _PAGE_RW; return pte; }
>                                                                     ^^^^^^^^
> Did you mean to put in _PAGE_WRITABLE here, or can the pte_mkwrite macro always assume the
> PRESENT bit is already set?

I decided that it cannot matter. If somebody tries to make a PROT_NONE
page writable by using pte_mkwrite(), there is already a bug there, and
I'm happier keeping it PROT_NONE than I am to mark it present. 

Note that this can not happen through a normal page fault, because a
normal page fault would have noticed that we don't actually have write
permission to the page at all. As such, the only way somebody can mark a
PROT_NONE page writable is if we're doing the nasty "bring in all the
pages because somebody did a mlock[all]() on us". 

In which case the above does the right thing, by certainly bringing the
page in, but not actually allowing anybody to read/write to it (actually,
I don't think this can happen even in that case, because if we have
PROT_NONE then the make_pages_present() stuff will not try to bring it
into memory writably, so we won't even try to make it writable). 

In short, the above really only makes sense if PRESENT is already set, and
if it was PROT_NONE from before it is a no-op which is fine.

		Linus


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

  reply	other threads:[~1998-07-10  1:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.3.95.980710021356.10100A-100000@fishy>
1998-07-10  1:26 ` Progress! was: Re: Yet more VM writable swap-cached pages Linus Torvalds
1998-07-10  2:18   ` Bill Hawes
1998-07-10  2:18     ` Linus Torvalds [this message]
     [not found] <Pine.LNX.3.95.980709184611.6873C-100000@fishy>
1998-07-10  0:42 ` Stephen C. Tweedie
1998-07-10  0:54   ` Linus Torvalds
1998-07-20 11:16     ` Richard Henderson
1998-07-20 17:01       ` Linus Torvalds
     [not found]   ` <35A57732.A7B5DFF@star.net>
1998-07-10 13:34     ` Stephen C. 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=Pine.LNX.3.96.980709191306.431I-100000@penguin.transmeta.com \
    --to=torvalds@transmeta.com \
    --cc=davem@dm.cobaltmicro.com \
    --cc=ganesh.sittampalam@magd.ox.ac.uk \
    --cc=linux-kernel@vger.rutgers.edu \
    --cc=mingo@valerie.inf.elte.hu \
    --cc=number6@the-village.bc.nu \
    --cc=sct@redhat.com \
    --cc=whawes@star.net \
    /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).