From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH 5/6] KVM MMU: reduce kvm_mmu_page size Date: Mon, 12 Apr 2010 19:11:44 +0800 Message-ID: <4BC2FFF0.20303@cn.fujitsu.com> References: <4BC2D2E2.1030604@cn.fujitsu.com> <4BC2D43A.5020003@cn.fujitsu.com> <4BC2DB95.70704@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , KVM list , LKML To: Avi Kivity Return-path: Received: from cn.fujitsu.com ([222.73.24.84]:58219 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1753265Ab0DLLOX (ORCPT ); Mon, 12 Apr 2010 07:14:23 -0400 In-Reply-To: <4BC2DB95.70704@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > On 04/12/2010 11:05 AM, Xiao Guangrong wrote: >> 'multimapped' and 'unsync' in 'struct kvm_mmu_page' are just indication >> field, we can use flag bits instand of them >> >> @@ -202,9 +202,10 @@ struct kvm_mmu_page { >> * in this shadow page. >> */ >> DECLARE_BITMAP(slot_bitmap, KVM_MEMORY_SLOTS + >> KVM_PRIVATE_MEM_SLOTS); >> - int multimapped; /* More than one parent_pte? */ >> int root_count; /* Currently serving as active root */ >> - bool unsync; >> + #define MMU_PAGE_MULTIMAPPED 0x1 /* More than one >> parent_pte? */ >> + #define MMU_PAGE_UNSYNC 0x2 >> + unsigned int flags; >> unsigned int unsync_children; >> union { >> > > Please just use bool for multimapped. If we grow more than 4 flags, we > can use 'bool flag : 1;' to reduce space while retaining readability. > Yeah, good idea, i'll fix it in the next version Thanks, Xiao