From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Mon, 15 Aug 2011 15:03:19 +0000 Subject: Re: [PATCH v5 5/5] KVM: PPC: e500: MMU API Message-Id: <4E493537.1070001@freescale.com> List-Id: References: <20110707234159.GE6646@schlenkerla.am.freescale.net> In-Reply-To: <20110707234159.GE6646@schlenkerla.am.freescale.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-ppc@vger.kernel.org On 08/13/2011 10:14 AM, Benjamin Herrenschmidt wrote: > On Mon, 2011-07-18 at 11:18 -0500, Scott Wood wrote: > >>> Does this work? Why do we need to set them dirty in the first place? If the shared tlb pages are on file backed storage, we're screwed under memory pressure either way and they'd just get evicted despite us writing to them. Or does vmap pin them? Either way, they're either pinned or not. And if they're not, dirtying them here shouldn't really buy us anything, no? >> >> They're pinned by get_user_pages_fast(). We (potentially) write to them, so >> we should mark them dirty, because they are dirty. It's up to the rest >> of Linux what to do with that. Will being pinned stop updates from being >> written out if it is file-backed? And eventually the vm will be destroyed >> (or the tlb reconfigured) and the pages will be unpinned. > > Note that gup or gup_fast won't guarantee that the virtual->physical > mapping remains. > > IE. the backing page itself will remain around, but it could be broken > off the mapping and another page can have taken its place in qemu > address space. > > (Think page migration for example). How would that work if gup is being used to implement read()? Wouldn't the data be written to the wrong place? -Scott