From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takuya Yoshikawa Subject: Re: [PATCH 0/8] KVM: Reduce mmu_lock hold time when zapping mmu pages Date: Wed, 23 Jan 2013 23:49:05 +0900 Message-ID: <20130123234905.a982e78b52160a8bdf3f35f1@gmail.com> References: <20130123191231.d66489d2.yoshikawa_takuya_b1@lab.ntt.co.jp> <50FFBF24.3000203@linux.vnet.ibm.com> <20130123222846.05bfc05a91ee133bd25981d6@gmail.com> <50FFE973.30709@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Takuya Yoshikawa , mtosatti@redhat.com, gleb@redhat.com, kvm@vger.kernel.org To: Xiao Guangrong Return-path: Received: from mail-da0-f46.google.com ([209.85.210.46]:64835 "EHLO mail-da0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752463Ab3AWOtJ (ORCPT ); Wed, 23 Jan 2013 09:49:09 -0500 Received: by mail-da0-f46.google.com with SMTP id p5so3827813dak.33 for ; Wed, 23 Jan 2013 06:49:09 -0800 (PST) In-Reply-To: <50FFE973.30709@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, 23 Jan 2013 21:45:23 +0800 Xiao Guangrong wrote: > > The current code which deletes the two link nodes in different functions > > looks unnatural to me: traversing the sp->link nodes forces us to break > > the loop and sp->hash_link nodes alone is allowed to continue ... > > > > Making each function semantically clear should be more important than > > other things. > > > > The reason the code like this is, we have lockless shadow page walker. But hash_link needs to be protected by mmu_lock anyway? > > But maybe a matter of taste, so I'll wait for the maintainers' comments. > > > >> http://www.linux-kvm.org/page/TODO: O(1) mmu invalidation using a generation number > >> > >> I am doing this work for some weeks and will post the patch out during these days. > > > > I remember that Avi originally wrote the idea of introducing the > > generation of mmu pages in his other work. > > > > Whatever the original consideration is, the idea can speed up mmu invalidation a lot. > (Actually, i mentioned this idea to you when discussion fast write protect long time ago.) It's fine. I just wanted to know if my memory was correct. Takuya