Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753867AbbK0ChV (ORCPT ); Thu, 26 Nov 2015 21:37:21 -0500 Received: from rs224.mailgun.us ([209.61.151.224]:52352 "EHLO rs224.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753837AbbK0ChS (ORCPT ); Thu, 26 Nov 2015 21:37:18 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=variantweb.net; s=smtp; q=dns; h=Sender: Date: From: To: Cc: Subject: Message-ID: References: MIME-Version: Content-Type: In-Reply-To; b=N93xCBBkIdX+VyA8w8DHvj6WkVulkM7dvrvy6e0WkxWFogpxl7yLRgykewNAtx4AA3GuFN 99NUSVGRA1L/gAC/r+CaCdUnMQliu0DGJxz+tmAvFzIIwI4wmXLcxIVOHICDaE6Qe/J7pweN v7+Le1ACMMyq52WhMb2JeWJOwc3T0= X-Mailgun-Sid: WyJmNDFlMyIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgIjlkYjc2Il0= Date: Thu, 26 Nov 2015 20:37:15 -0600 From: Seth Jennings To: Ingo Molnar Cc: Thomas Gleixner , Ingo Molnar , Peter Anvin , Daniel J Blueman , Yinghai Lu , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86: mm: clean up probe_memory_block_size() Message-ID: <20151127023715.GA10427@cerebellum.local.variantweb.net> References: <1448396191-27996-1-git-send-email-sjennings@variantweb.net> <20151126091201.GB30403@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151126091201.GB30403@gmail.com> User-Agent: Mutt/1.5.23 (2015-06-09) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2185 Lines: 66 On Thu, Nov 26, 2015 at 10:12:01AM +0100, Ingo Molnar wrote: > > * Seth Jennings wrote: > > > The cumulative effect of bdee237c and 982792c7 is some pretty convoluted > > code. This commit has no (intended) functional change; just seeks to > > simplify and make the code more understandable. > > > > The whole section with the "tail size" doesn't seem to be reachable, > > since both the >= 64GB and < 64GB case return, so it was removed. > > > > This commit also adds code back for the UV case since it seemed to just > > go away without reason in bdee237c and might lead to unexpected change > > in behavior. > > > > Signed-off-by: Seth Jennings > > --- > > arch/x86/mm/init_64.c | 22 ++++++---------------- > > 1 file changed, 6 insertions(+), 16 deletions(-) > > > > diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c > > index ec081fe..a83c470 100644 > > --- a/arch/x86/mm/init_64.c > > +++ b/arch/x86/mm/init_64.c > > @@ -52,6 +52,7 @@ > > #include > > #include > > #include > > +#include > > #include > > > > #include "mm_internal.h" > > @@ -1194,26 +1195,15 @@ int kern_addr_valid(unsigned long addr) > > > > static unsigned long probe_memory_block_size(void) > > { > > + unsigned long bz = MIN_MEMORY_BLOCK_SIZE; > > > > + /* if system is UV or has 64GB of RAM or more, use large blocks */ > > + if (is_uv_system() || ((max_pfn << PAGE_SHIFT) >= (64UL << 30))) { > > pr_info("Using 2GB memory block size for large-memory system\n"); > > + bz = 2UL << 30; /* 2GB */ > > } > > > > + pr_debug("memory block size : %ldMB\n", bz >> 20); > > > > return bz; > > } > > So why keep 'bz' at all? Just return with the right value and be done with it. > 'bz' is just an unnecessary confusion factor. Good point. Just send out v2. Thanks, Seth > > Thanks, > > Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/