Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752256AbcCYNtr (ORCPT ); Fri, 25 Mar 2016 09:49:47 -0400 Received: from mga02.intel.com ([134.134.136.20]:35450 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751091AbcCYNtq (ORCPT ); Fri, 25 Mar 2016 09:49:46 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,391,1455004800"; d="scan'208";a="73126081" Subject: Re: [PATCH 3/4] KVM: MMU: reduce the size of mmu_page_path To: Paolo Bonzini References: <1458911978-19430-1-git-send-email-guangrong.xiao@linux.intel.com> <1458911978-19430-3-git-send-email-guangrong.xiao@linux.intel.com> <56F54103.6020508@redhat.com> Cc: gleb@kernel.org, mtosatti@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org From: Xiao Guangrong Message-ID: <56F541C5.6090904@linux.intel.com> Date: Fri, 25 Mar 2016 21:48:53 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56F54103.6020508@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 876 Lines: 23 On 03/25/2016 09:45 PM, Paolo Bonzini wrote: > > > On 25/03/2016 14:19, Xiao Guangrong wrote: >> Currently only PT64_ROOT_LEVEL - 1 levels are used, one additional entry >> in .parent[] is used as a sentinel, the additional entry in .idx[] is >> purely wasted >> >> This patch reduces its size and sets the sentinel on the upper level of >> the place where we start from > > This patch and the previous one are basically redoing commit > 0a47cd85833e ("KVM: MMU: Fix ubsan warnings", 2016-03-04). While you > find your version easier to understand, I of course find mine easier. > > Rather than getting stuck in a ko fight, the solution is to stick with > the code in KVM and add comments. I'll give it a try... If you do not like this one, we can just make the .index is [PT64_ROOT_LEVEL - 1] and keep the sentinel in .parents[], that little change and nice code shape.