linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Vladimir Isaev <Vladimir.Isaev@synopsys.com>,
	"linux-snps-arc@lists.infradead.org" 
	<linux-snps-arc@lists.infradead.org>
Cc: "linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"rppt@linux.ibm.com" <rppt@linux.ibm.com>
Subject: Re: [PATCH v2] ARC: Use max_high_pfn as a HIGHMEM zone border
Date: Mon, 10 May 2021 19:50:19 +0000	[thread overview]
Message-ID: <a6786e4e-e1aa-e84d-3b08-509a90513077@synopsys.com> (raw)
In-Reply-To: <20210427121354.3620-1-isaev@synopsys.com>

On 4/27/21 5:13 AM, Vladimir Isaev wrote:
> Commit 4af22ded0ecf ("arc: fix memory initialization for systems
> with two memory banks") fixed highmem, but for the PAE case it causes
> bug messages:
>
> BUG: Bad page state in process swapper  pfn:80000
> page:(ptrval) refcount:0 mapcount:1 mapping:00000000 index:0x0 pfn:0x80000
> flags: 0x0()
> raw: 00000000 00000100 00000122 00000000 00000000 00000000 00000000 00000000
> raw: 00000000
> page dumped because: nonzero mapcount
> Modules linked in:
> CPU: 0 PID: 0 Comm: swapper Not tainted 5.12.0-rc5-00003-g1e43c377a79f #1
>
> Stack Trace:
>    arc_unwind_core+0xe8/0x118
> Disabling lock debugging due to kernel taint
>
> This is because the fix expects highmem to be always less than
> lowmem and uses min_low_pfn as an upper zone border for highmem.
>
> max_high_pfn should be ok for both highmem and highmem+PAE cases.
>
> Signed-off-by: Vladimir Isaev <isaev@synopsys.com>
> Cc: Mike Rapoport <rppt@linux.ibm.com>
> Cc: Vineet Gupta <vgupta@synopsys.com>

Applied to for-curr.

Thx,
-Vineet

> ---
> Changes for v2:
>   - Revised commit message and added comment to code
> ---
>   arch/arc/mm/init.c | 11 ++++++++++-
>   1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c
> index ce07e697916c..1bcc6985b9a0 100644
> --- a/arch/arc/mm/init.c
> +++ b/arch/arc/mm/init.c
> @@ -157,7 +157,16 @@ void __init setup_arch_memory(void)
>   	min_high_pfn = PFN_DOWN(high_mem_start);
>   	max_high_pfn = PFN_DOWN(high_mem_start + high_mem_sz);
>   
> -	max_zone_pfn[ZONE_HIGHMEM] = min_low_pfn;
> +	/*
> +	 * max_high_pfn should be ok here for both HIGHMEM and HIGHMEM+PAE.
> +	 * For HIGHMEM without PAE max_high_pfn should be less than
> +	 * min_low_pfn to guarantee that these two regions don't overlap.
> +	 * For PAE case highmem is greater than lowmem, so it is natural
> +	 * to use max_high_pfn.
> +	 *
> +	 * In both cases, holes should be handled by pfn_valid().
> +	 */
> +	max_zone_pfn[ZONE_HIGHMEM] = max_high_pfn;
>   
>   	high_memory = (void *)(min_high_pfn << PAGE_SHIFT);
>   


      reply	other threads:[~2021-05-10 19:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-27 12:13 [PATCH v2] ARC: Use max_high_pfn as a HIGHMEM zone border Vladimir Isaev
2021-05-10 19:50 ` Vineet Gupta [this message]

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=a6786e4e-e1aa-e84d-3b08-509a90513077@synopsys.com \
    --to=vineet.gupta1@synopsys.com \
    --cc=Vladimir.Isaev@synopsys.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=rppt@linux.ibm.com \
    /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;
as well as URLs for NNTP newsgroup(s).