From: "David S. Miller" <davem@redhat.com>
To: sct@redhat.com
Cc: alan@lxorguk.ukuu.org.uk, kanoj@google.engr.sgi.com,
manfreds@colorfullife.com, linux-kernel@vger.rutgers.edu,
linux-mm@kvack.org, torvalds@transmeta.com
Subject: Re: zap_page_range(): TLB flush race
Date: Mon, 10 Apr 2000 16:12:18 -0700 [thread overview]
Message-ID: <200004102312.QAA05115@pizda.ninka.net> (raw)
In-Reply-To: <20000410232149.M17648@redhat.com> (sct@redhat.com)
On Sun, Apr 09, 2000 at 12:37:05AM +0100, Alan Cox wrote:
>
> Basically establish_pte() has to be architecture specific, as some processors
> need different orders either to avoid races or to handle cpu specific
> limitations.
What exactly do different architectures need which set_pte() doesn't
already allow them to do magic in?
Doing a properly synchronized PTE update and Cache/TLB flush when the
mapping can exist on multiple processors is not most efficiently done
if we take some generic setup.
The idea is that if we encapsulate the "flush_cache; set_pte;
flush_tlb" operations into a single arch-specific routine, the
implementation can then implement the most efficient solution possible
to this SMP problem.
For example, the fastest way to atomically update an existing PTE on
an SMP system using a software TLB miss scheme is wildly different
from that on an SMP system using a hardware replaced TLB.
For example, with a software TLB miss scheme it might be something
like this:
establish_pte() {
capture_cpus(mm->cpu_vm_mask);
everybody_flush_cache_page(mm->cpu_vm_mask, ...);
atomic_set_pte(ptep, entry);
everybody_flush_tlb_page(mm->cpu_vm_mask, ...);
release_cpus(mm->cpu_vm_mask);
}
With the obvious important optimizations for when mm->count is one,
etc.
The other case is when we are checking the dirty status of a pte
in vmscan, something similar is needed there as well:
pte_t atomic_pte_check_dirty() {
capture_cpus(mm->cpu_vm_mask);
entry = *ptep;
if (pte_dirty(entry)) {
everybody_flush_cache_page(mm->cpu_vm_mask, ...);
pte_clear(ptep);
everybody_flush_tlb_page(mm->cpu_vm_mask, ...);
}
release_cpus(mm->cpu_vm_mask);
return entry;
}
Later,
David S. Miller
davem@redhat.com
--
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/
next prev parent reply other threads:[~2000-04-10 23:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-08 20:06 Manfred Spraul
2000-04-08 21:11 ` Kanoj Sarcar
2000-04-08 22:46 ` Manfred Spraul
2000-04-08 23:31 ` Kanoj Sarcar
2000-04-08 23:37 ` Alan Cox
2000-04-08 23:54 ` Kanoj Sarcar
2000-04-09 9:10 ` Manfred Spraul
2000-04-09 9:19 ` David S. Miller
2000-04-10 22:21 ` Stephen C. Tweedie
2000-04-10 23:12 ` David S. Miller [this message]
2000-04-11 9:14 ` Stephen C. Tweedie
2000-04-11 14:41 ` Manfred Spraul
2000-04-11 16:40 ` Andrea Arcangeli
2000-04-11 17:45 ` Manfred Spraul
2000-04-11 18:14 ` Kanoj Sarcar
2000-04-12 10:02 ` Jamie Lokier
2000-04-11 11:56 ` Alan Cox
2000-04-08 23:44 ` David S. Miller
2000-04-09 0:20 ` Kanoj Sarcar
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=200004102312.QAA05115@pizda.ninka.net \
--to=davem@redhat.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=kanoj@google.engr.sgi.com \
--cc=linux-kernel@vger.rutgers.edu \
--cc=linux-mm@kvack.org \
--cc=manfreds@colorfullife.com \
--cc=sct@redhat.com \
--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