From: Kanoj Sarcar <kanoj@google.engr.sgi.com>
To: Jamie Lokier <lk@tantalophile.demon.co.uk>
Cc: Ben LaHaise <bcrl@redhat.com>,
linux-mm@kvack.org, mingo@redhat.com, alan@redhat.com
Subject: Re: x86 ptep_get_and_clear question
Date: Thu, 15 Feb 2001 09:23:42 -0800 (PST) [thread overview]
Message-ID: <200102151723.JAA43255@google.engr.sgi.com> (raw)
In-Reply-To: <20010215173547.A2079@pcep-jamie.cern.ch> from "Jamie Lokier" at Feb 15, 2001 05:35:47 PM
>
> Ben LaHaise wrote:
> > > Processor 2 has recently done some writes, so the dirty bit is set in
> > > processor 2's TLB.
> > >
> > > Processor 1 clears the dirty bit atomically.
> > >
> > > Processor 2 does some more writes, and does not check the page table
> > > because the page is already dirty in its TLB.
> > >
> > > Result: The later writes on processor 2 do not mark the page dirty.
> >
> > Yeah, but the tlb is flushed in those cases (look for flush_tlb_page in
> > try_to_swap_out).
>
> As long as processor 1 waits for the flush on processor 2 to complete
> before marking the struct page dirty, that looks fine to me.
>
> -- Jamie
>
Since this seems to be so hard to understand, lets keep things simple and
continue with my previous example, instead of pulling new examples.
Look in mm/mprotect.c. Look at the call sequence change_protection() -> ...
change_pte_range(). Specifically at the sequence:
entry = ptep_get_and_clear(pte);
set_pte(pte, pte_modify(entry, newprot));
Go ahead and pull your x86 specs, and prove to me that between the
ptep_get_and_clear(), which zeroes out the pte (specifically, when the
dirty bit is not set), processor 2 can not come in and set the dirty
bit on the in-memory pte. Which immediately gets overwritten by the
set_pte(). For an example of how this can happen, look at my previous
postings.
Jamie's example misses the point in the sense that at the very beginning,
when he says "Processor 2 has recently done some writes", processor 2 has
made sure that the dirty bit is set in the in-memory pte. So, although
processor 1 clears the entire pte, the set_pte() will set the dirty bit,
and no information is lost. Even if processor 2 tries writing between
the ptep_get_and_clear() and set_pte(). Whether Jamie was trying to
illustrate a different problem, I am not sure. All I am trying to say
is that the "dirty bit lost on smp x86" still exists, ptep_get_and_clear
does not do anything to fix it.
Kanoj
--
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:[~2001-02-15 17:23 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-15 1:50 x86 ptep_get_and_clear question Kanoj Sarcar
2001-02-15 2:13 ` Ben LaHaise
2001-02-15 2:37 ` Kanoj Sarcar
2001-02-15 10:55 ` Jamie Lokier
2001-02-15 16:06 ` Ben LaHaise
2001-02-15 16:35 ` Jamie Lokier
2001-02-15 17:23 ` Kanoj Sarcar [this message]
2001-02-15 17:27 ` Ben LaHaise
2001-02-15 17:38 ` Kanoj Sarcar
2001-02-15 17:46 ` Ben LaHaise
2001-02-15 17:47 ` Jamie Lokier
2001-02-15 17:47 ` Jamie Lokier
2001-02-15 18:05 ` Kanoj Sarcar
2001-02-15 18:05 ` Kanoj Sarcar
2001-02-15 18:23 ` Kanoj Sarcar
2001-02-15 18:23 ` Kanoj Sarcar
2001-02-15 18:42 ` Jamie Lokier
2001-02-15 18:42 ` Jamie Lokier
2001-02-15 18:57 ` Kanoj Sarcar
2001-02-15 18:57 ` Kanoj Sarcar
2001-02-15 19:06 ` Ben LaHaise
2001-02-15 19:06 ` Ben LaHaise
2001-02-15 19:19 ` Kanoj Sarcar
2001-02-15 19:19 ` Kanoj Sarcar
2001-02-15 20:16 ` Linus Torvalds
2001-02-15 18:51 ` Manfred Spraul
2001-02-15 18:51 ` Manfred Spraul
2001-02-15 19:05 ` Kanoj Sarcar
2001-02-15 19:05 ` Kanoj Sarcar
2001-02-15 19:19 ` Jamie Lokier
2001-02-15 19:19 ` Jamie Lokier
2001-02-15 20:31 ` Linus Torvalds
2001-02-15 21:26 ` Manfred Spraul
2001-02-15 21:29 ` Manfred Spraul
2001-02-16 1:21 ` Linus Torvalds
2001-02-16 14:18 ` Jamie Lokier
2001-02-16 14:59 ` Manfred Spraul
2001-02-16 15:27 ` Jamie Lokier
2001-02-16 15:54 ` Manfred Spraul
2001-02-16 16:00 ` Jamie Lokier
2001-02-16 16:23 ` Manfred Spraul
2001-02-16 16:43 ` Jamie Lokier
2001-02-16 17:12 ` Manfred Spraul
2001-02-16 17:20 ` Jamie Lokier
2001-02-16 17:36 ` Linus Torvalds
2001-02-16 18:49 ` Manfred Spraul
2001-02-16 19:00 ` Linus Torvalds
2001-02-16 19:02 ` Ben LaHaise
2001-02-16 19:32 ` Linus Torvalds
2001-02-16 19:42 ` Ben LaHaise
2001-02-16 17:37 ` Jamie Lokier
2001-02-16 18:04 ` Manfred Spraul
2001-02-16 18:09 ` Jamie Lokier
2001-02-16 18:36 ` Hugh Dickins
2001-02-16 17:29 ` Ben LaHaise
2001-02-16 17:38 ` Linus Torvalds
2001-02-16 17:44 ` Ben LaHaise
2001-02-16 17:59 ` Linus Torvalds
2001-02-15 23:57 ` Jamie Lokier
2001-02-16 0:55 ` Linus Torvalds
2001-02-15 19:07 ` Jamie Lokier
2001-02-15 19:07 ` Jamie Lokier
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=200102151723.JAA43255@google.engr.sgi.com \
--to=kanoj@google.engr.sgi.com \
--cc=alan@redhat.com \
--cc=bcrl@redhat.com \
--cc=linux-mm@kvack.org \
--cc=lk@tantalophile.demon.co.uk \
--cc=mingo@redhat.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.