mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: "David S. Miller" <davem@redhat.com>, <linux-kernel@vger.kernel.org>
Subject: Re: Make 2.5.17 TLB even more friendlier
Date: Wed, 22 May 2002 13:57:39 +1000 (EST)	[thread overview]
Message-ID: <15595.5939.708078.827286@argo.ozlabs.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0205211609210.15094-100000@penguin.transmeta.com>

It seems to me that there is a race in this code in zap_pte_range,
because there is a gap between when we read the pte and when we clear
it:

	for (offset=0; offset < size; ptep++, offset += PAGE_SIZE) {
		pte_t pte = *ptep;
		if (pte_none(pte))
			continue;
		if (pte_present(pte)) {
			unsigned long pfn = pte_pfn(pte);

			pte_clear(ptep);

Isn't it possible that another cpu could set the dirty bit in the pte
between the "pte = *ptep" and the "pte_clear(ptep)"?  In my case
another cpu could also set the "has hash-table entry" bit.

Shouldn't we do this as "pte = ptep_get_and_clear(ptep)", at least in
the case where we are unmapping stuff?

Paul.

  reply	other threads:[~2002-05-22  3:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-21  6:07 David S. Miller
2002-05-21 12:18 ` Paul Mackerras
2002-05-21 12:10   ` David S. Miller
2002-05-21 12:53     ` Paul Mackerras
2002-05-21 18:42       ` Linus Torvalds
2002-05-21 23:05         ` Paul Mackerras
2002-05-21 23:13           ` Linus Torvalds
2002-05-22  3:57             ` Paul Mackerras [this message]
2002-05-22  4:04               ` Linus Torvalds
2002-05-22  8:40             ` Paul Mackerras

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=15595.5939.708078.827286@argo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®