From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch 3/3] KVM: MMU: prepopulate the shadow on invlpg Date: Sun, 02 Nov 2008 10:39:10 +0200 Message-ID: <490D672E.80906@redhat.com> References: <20081025223111.498934405@localhost.localdomain> <20081025223243.946600413@localhost.localdomain> <49045906.7070305@redhat.com> <20081031194727.GD21772@dmt.cnet> <490B6359.7000307@redhat.com> <20081031223311.GA31882@dmt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Marcelo Tosatti Return-path: Received: from mx2.redhat.com ([66.187.237.31]:45562 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752740AbYKBIjO (ORCPT ); Sun, 2 Nov 2008 03:39:14 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id mA28dESn015459 for ; Sun, 2 Nov 2008 03:39:14 -0500 In-Reply-To: <20081031223311.GA31882@dmt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: Marcelo Tosatti wrote: > Err, I'm on crack. The assumption is that the common case is pte > invalidation + invlpg: kunmap_atomic, page aging clearing the > accessed bit, page reclaim. > > Linux COW will invalidate + invlpg (do_wp_page) first: > > entry = mk_pte(new_page, vma->vm_page_prot); > entry = maybe_mkwrite(pte_mkdirty(entry), vma); > /* > * Clear the pte entry and flush it first, before > * updating the > * pte with the new entry. This will avoid a race > * condition > * seen in the presence of one thread doing SMC and > * another > * thread doing COW. > */ > ptep_clear_flush_notify(vma, address, page_table); > > Not sure about Windows. > > Okay, so Linux won't win on this. But is there any downside, apart from fetching the pte and reestablishing the spte? -- error compiling committee.c: too many arguments to function