Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Sep 2009 23:57:24 -0700
From:      MingyanGuo <guomingyan@gmail.com>
To:        freebsd-hackers@freebsd.org
Cc:        LI Xin <delphij@delphij.net>
Subject:   Re: How to prevent other CPU from accessing a set of pages before  calling pmap_remove_all function
Message-ID:  <1fa17f810909092357x8625182q970f8fb6aa76e7a9@mail.gmail.com>
In-Reply-To: <1fa17f810909092326l1271df94t1dea5ac9d5deba1b@mail.gmail.com>
References:  <1fa17f810909092326l1271df94t1dea5ac9d5deba1b@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 9, 2009 at 11:26 PM, MingyanGuo <guomingyan@gmail.com> wrote:

> Hi all,
>
> I find that function pmap_remove_all for arch amd64 works with a time
> window between reading & clearing the PTE flags(access flag and dirty flag)
> and invalidating its TLB entry on other CPU. After some discussion with Li
> Xin(cced), I think all the processes that are using the PTE being removed
> should be blocked before calling pmap_remove_all, or other CPU may dirty the
> page but does not set the dirty flag before the TLB entry is flushed. But I
> can not find how to block them to call the function. I read the function
> vm_pageout_scan in file vm/vm_pageout.c but can not find the exact method it
> used.  Or I just misunderstood the semantics of function pmap_remove_all ?
>
> Thanks in advance.
>
> Regards,
> MingyanGuo
>

Sorry for the noise. I understand the logic now. There is no time window
problem between reading & clearing the PTE and invalidating it on other CPU,
even if other CPU is using the PTE.  I misunderstood the logic.

Regards,
MingyanGuo



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1fa17f810909092357x8625182q970f8fb6aa76e7a9>