All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrea Arcangeli <andrea@suse.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Hugh Dickins <hugh@veritas.com>,
	Marcelo Tosatti <marcelo@conectiva.com.br>,
	linux-kernel@vger.kernel.org
Subject: Re: pre12 VM doubts and patch
Date: Thu, 20 Sep 2001 08:08:37 +0200	[thread overview]
Message-ID: <20010920080837.A719@athlon.random> (raw)
In-Reply-To: <20010920071240.P720@athlon.random> <Pine.LNX.4.33.0109192255360.2852-100000@penguin.transmeta.com>
In-Reply-To: <Pine.LNX.4.33.0109192255360.2852-100000@penguin.transmeta.com>; from torvalds@transmeta.com on Wed, Sep 19, 2001 at 10:58:43PM -0700

On Wed, Sep 19, 2001 at 10:58:43PM -0700, Linus Torvalds wrote:
> 
> On Thu, 20 Sep 2001, Andrea Arcangeli wrote:
> >
> > when the page is exclusive we definitely can write to it
> 
> NO!
> 
> If it is a read-only mapping, we must NOT mark it writable.
> 
> The fact is, the page may have been written to earlier, marked read-only
> with mprotect(), and the page is dirty but read-only, and swapping it in

ah, I didn't thought at mprotect.

> MUST NOT markt it writable even if it is our last exclusive copy.
> 
> Which we've gotten wrong for a long time, actually. But you #if 0'ed the
> fix that happened fairly recently.

hmm, the stuff inside #if 0 doesn't seem to be correct either there,
write_access doesn't mean we have the right to write to it, it just mean
we're trying to.

anyways here it is the fix:

--- 2.4.10pre12aa1/mm/memory.c.~1~	Thu Sep 20 07:20:03 2001
+++ 2.4.10pre12aa1/mm/memory.c	Thu Sep 20 08:06:29 2001
@@ -1155,15 +1155,8 @@
 	pte = mk_pte(page, vma->vm_page_prot);
 
 	swap_free(entry);
-	if (exclusive_swap_page(page)) {	
-#if 0
-		if (write_access)
-			pte = pte_mkwrite(pte_mkdirty(pte));
-#else
+	if (exclusive_swap_page(page))
 		delete_from_swap_cache_nolock(page);
-		pte = pte_mkwrite(pte_mkdirty(pte));
-#endif
-	}
 	UnlockPage(page);
 
 	flush_page_to_ram(page);

thanks,
Andrea

  reply	other threads:[~2001-09-20  6:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-19 17:57 pre12 VM doubts and patch Hugh Dickins
2001-09-19 19:42 ` Hugh Dickins
2001-09-19 21:28   ` Andrea Arcangeli
2001-09-19 23:16     ` Linus Torvalds
2001-09-19 23:31       ` Andrea Arcangeli
2001-09-19 23:49         ` Andrea Arcangeli
2001-09-20  1:04         ` Jeff Chua
2001-09-20  1:05           ` Andrea Arcangeli
2001-09-20  1:12             ` Jeff Chua
2001-09-19 23:51     ` Hugh Dickins
2001-09-20  0:01       ` Andrea Arcangeli
2001-09-20  5:12 ` Andrea Arcangeli
2001-09-20  5:58   ` Linus Torvalds
2001-09-20  6:08     ` Andrea Arcangeli [this message]
2001-09-20  6:15       ` Linus Torvalds
2001-09-20  6:34         ` Andrea Arcangeli
2001-09-20  6:26       ` Andrea Arcangeli
2001-09-20  6:31         ` Linus Torvalds
2001-09-20  6:38           ` Andrea Arcangeli

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=20010920080837.A719@athlon.random \
    --to=andrea@suse.de \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.