public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Seth Jennings <sjennings@variantweb.net>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Peter Anvin <hpa@zytor.com>,
	Daniel J Blueman <daniel@numascale.com>,
	Yinghai Lu <yinghai@kernel.org>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: mm: clean up probe_memory_block_size()
Date: Thu, 26 Nov 2015 10:12:01 +0100	[thread overview]
Message-ID: <20151126091201.GB30403@gmail.com> (raw)
In-Reply-To: <1448396191-27996-1-git-send-email-sjennings@variantweb.net>


* Seth Jennings <sjennings@variantweb.net> 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 <sjennings@variantweb.net>
> ---
>  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 <asm/numa.h>
>  #include <asm/cacheflush.h>
>  #include <asm/init.h>
> +#include <asm/uv/uv.h>
>  #include <asm/setup.h>
>  
>  #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.

Thanks,

	Ingo

  reply	other threads:[~2015-11-26  9:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 20:16 [PATCH] x86: mm: clean up probe_memory_block_size() Seth Jennings
2015-11-26  9:12 ` Ingo Molnar [this message]
2015-11-27  2:37   ` Seth Jennings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151126091201.GB30403@gmail.com \
    --to=mingo@kernel.org \
    --cc=daniel@numascale.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=sjennings@variantweb.net \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yinghai@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox