public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Wei Yang <richardw.yang@linux.intel.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	richard.weiyang@gmail.com, dave.hansen@linux.intel.com,
	luto@kernel.org, peterz@infradead.or, tglx@linutronix.de
Subject: Re: [Patch v2 4/6] x86/mm: Refine debug print string retrieval function
Date: Fri, 6 Dec 2019 11:27:46 +0100	[thread overview]
Message-ID: <20191206102746.GD2844@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20191206015126.GB3846@richard>

On Fri, Dec 06, 2019 at 09:51:26AM +0800, Wei Yang wrote:

> >> +#if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE)
> >> +	static const char *sz[2] = { "4K", "4M" };
> >> +#else
> >> +	static const char *sz[4] = { "4K", "2M", "1G", "" };
> >> +#endif
> >> +	unsigned int idx, s;
> >>  
> >> +	for (idx = 0; idx < maxidx; idx++, mr++) {
> >> +		s = (mr->page_size_mask >> PG_LEVEL_2M) & (ARRAY_SIZE(sz) - 1);
> >
> >Is it at all possible for !PAE to have 1G here, if you use the sz[4]
> >definition unconditionally?
> >
> 
> You mean remove the ifdef and use sz[4] for both condition?
> 
> Then how to differentiate 4M and 2M?

Argh, I'm blind.. I failed to spot that. N/m then.

  reply	other threads:[~2019-12-06 10:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05  2:13 [Patch v2 0/6] Refactor split_mem_range with proper helper and loop Wei Yang
2019-12-05  2:13 ` [Patch v2 1/6] x86/mm: Remove second argument of split_mem_range() Wei Yang
2019-12-05  2:13 ` [Patch v2 2/6] x86/mm: Add attribute __ro_after_init to after_bootmem Wei Yang
2019-12-05  2:14 ` [Patch v2 3/6] x86/mm: Make page_size_mask unsigned int clearly Wei Yang
2019-12-05  2:14 ` [Patch v2 4/6] x86/mm: Refine debug print string retrieval function Wei Yang
2019-12-05  9:13   ` Peter Zijlstra
2019-12-06  1:51     ` Wei Yang
2019-12-06 10:27       ` Peter Zijlstra [this message]
2019-12-06 15:17         ` Wei Yang
2019-12-05  2:14 ` [Patch v2 5/6] x86/mm: Use address directly in split_mem_range() Wei Yang
2019-12-07  3:36   ` kbuild test robot
2019-12-07  7:17     ` Wei Yang
2019-12-05  2:14 ` [Patch v2 6/6] x86/mm: Refactor split_mem_range with proper helper and loop Wei Yang

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=20191206102746.GD2844@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.or \
    --cc=richard.weiyang@gmail.com \
    --cc=richardw.yang@linux.intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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