Date: Sun, 27 Jan 2008 10:06:37 -0600 (CST) From: Mark Tinguely <tinguely@casselton.net> To: mlfbsd@ci0.org, tinguely@casselton.net Cc: freebsd-arm@freebsd.org Subject: Re: ARM pmap cache flushed after PT modification. Message-ID: <200801271606.m0RG6b1C036780@casselton.net> In-Reply-To: <20080127011417.GA19569@ci0.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> I like your work, and am about to commit it, however, just a small point : > > On Thu, Jan 17, 2008 at 09:48:54AM -0600, Mark Tinguely wrote: > > In pmap_nuke_pv(), the vm_page_flag_clear(pg, PG_WRITEABLE) has been moved > > to the pmap_fix_cache(). > > > > if ((pve->pv_flags & PVF_NC) && ((pm == pmap_kernel()) || > (pve->pv_flags & PVF_WRITE) || !(pve->pv_flags & PVF_MWC))) > pmap_fix_cache(pg, pm, 0); > > You only call pmap_fix_cache() if the PVF_NC bit is set, so > vm_page_flag_clear(pg, PG_WRITEABLE) won't be called, and PVF_MOD won't be > removed, if we're removing the only writeable entry for a cacheable page, or > did I miss something ? You are correct, great catch. Before, the cache fixing routine was called when a write mapping was removed. In addition, I really should call the cache fixing routine when caching was stopped and a kernel mapping was removed (this is a read kernel mapping but obviously there are user mapping(s) and now they may be able to re-enable caching) or a read mapping is being remove when there is at most one user write in this process space. if ((pve->pv_flags & PVF_WRITE) || ((pve->pv_flags & PVF_NC) && ((pm == pmap_kernel()) || !(pve->pv_flags & PVF_MWC)))) pmap_fix_cache(pg, pm, 0); ---- I have been reading a lot in the ARM11 (aka ARMv6) technical reference manual. ARMv6 has significant cache changes to simplify page sharing and decrease cache flushing. The single core ARMv6 MMU could use the existing pmap code but is not as efficient as it could be. To maximize the single core MMU (and bypass all this pmap_fix_cache() and flushing the cache when switching processes), page coloring needs to be added (2 colors for 32KB caches and 4 colors for 64KB caches). The multicores does not need the page coloring, but changes to the pmap can help SMP support and efficiency issues. --Mark Tinguely.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200801271606.m0RG6b1C036780>