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

next in thread | raw e-mail | index | archive | help
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



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