From: Baoquan He <bhe@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Huacai Chen <chenhuacai@loongson.cn>,
Vivek Goyal <vgoyal@redhat.com>, Dave Young <dyoung@redhat.com>,
Youling Tang <tangyouling@kylinos.cn>,
kexec@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kdump: Defer the insertion of crashkernel resources
Date: Sat, 6 Jan 2024 10:09:29 +0800 [thread overview]
Message-ID: <ZZi2WXVmXHcmd17c@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20240105084911.b64f43b12b0c7e25436cb093@linux-foundation.org>
On 01/05/24 at 08:49am, Andrew Morton wrote:
> On Fri, 29 Dec 2023 16:02:13 +0800 Huacai Chen <chenhuacai@loongson.cn> wrote:
>
> > In /proc/iomem, sub-regions should be inserted after their parent,
> > otherwise the insertion of parent resource fails. But after generic
> > crashkernel reservation applied, in both RISC-V and ARM64 (LoongArch
> > will also use generic reservation later on), crashkernel resources are
> > inserted before their parent, which causes the parent disappear in
> > /proc/iomem. So we defer the insertion of crashkernel resources to an
> > early_initcall().
> >
> > ...
> >
> > --- a/kernel/crash_core.c
> > +++ b/kernel/crash_core.c
> > @@ -377,7 +377,6 @@ static int __init reserve_crashkernel_low(unsigned long long low_size)
> >
> > crashk_low_res.start = low_base;
> > crashk_low_res.end = low_base + low_size - 1;
> > - insert_resource(&iomem_resource, &crashk_low_res);
> > #endif
> > return 0;
> > }
> > @@ -459,8 +458,19 @@ void __init reserve_crashkernel_generic(char *cmdline,
> >
> > crashk_res.start = crash_base;
> > crashk_res.end = crash_base + crash_size - 1;
> > - insert_resource(&iomem_resource, &crashk_res);
> > }
> > +
> > +static __init int insert_crashkernel_resources(void)
> > +{
> > + if (crashk_res.start < crashk_res.end)
> > + insert_resource(&iomem_resource, &crashk_res);
> > +
> > + if (crashk_low_res.start < crashk_low_res.end)
> > + insert_resource(&iomem_resource, &crashk_low_res);
> > +
> > + return 0;
> > +}
> > +early_initcall(insert_crashkernel_resources);
> > #endif
> >
> > int crash_prepare_elf64_headers(struct crash_mem *mem, int need_kernel_map,
>
> I'm thinking
>
> Fixes: 0ab97169aa0 ("crash_core: add generic function to do reservation").
Yes.
>
> Also, is this a regression? Were earlier kernels OK?
It's a regression, will impact arm64 in v6.6 kernel. Add below too?
Cc: <stable@vger.kernel.org> # 6.6.x
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
WARNING: multiple messages have this Message-ID (diff)
From: Baoquan He <bhe@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Huacai Chen <chenhuacai@loongson.cn>,
Vivek Goyal <vgoyal@redhat.com>, Dave Young <dyoung@redhat.com>,
Youling Tang <tangyouling@kylinos.cn>,
kexec@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kdump: Defer the insertion of crashkernel resources
Date: Sat, 6 Jan 2024 10:09:29 +0800 [thread overview]
Message-ID: <ZZi2WXVmXHcmd17c@MiWiFi-R3L-srv> (raw)
In-Reply-To: <20240105084911.b64f43b12b0c7e25436cb093@linux-foundation.org>
On 01/05/24 at 08:49am, Andrew Morton wrote:
> On Fri, 29 Dec 2023 16:02:13 +0800 Huacai Chen <chenhuacai@loongson.cn> wrote:
>
> > In /proc/iomem, sub-regions should be inserted after their parent,
> > otherwise the insertion of parent resource fails. But after generic
> > crashkernel reservation applied, in both RISC-V and ARM64 (LoongArch
> > will also use generic reservation later on), crashkernel resources are
> > inserted before their parent, which causes the parent disappear in
> > /proc/iomem. So we defer the insertion of crashkernel resources to an
> > early_initcall().
> >
> > ...
> >
> > --- a/kernel/crash_core.c
> > +++ b/kernel/crash_core.c
> > @@ -377,7 +377,6 @@ static int __init reserve_crashkernel_low(unsigned long long low_size)
> >
> > crashk_low_res.start = low_base;
> > crashk_low_res.end = low_base + low_size - 1;
> > - insert_resource(&iomem_resource, &crashk_low_res);
> > #endif
> > return 0;
> > }
> > @@ -459,8 +458,19 @@ void __init reserve_crashkernel_generic(char *cmdline,
> >
> > crashk_res.start = crash_base;
> > crashk_res.end = crash_base + crash_size - 1;
> > - insert_resource(&iomem_resource, &crashk_res);
> > }
> > +
> > +static __init int insert_crashkernel_resources(void)
> > +{
> > + if (crashk_res.start < crashk_res.end)
> > + insert_resource(&iomem_resource, &crashk_res);
> > +
> > + if (crashk_low_res.start < crashk_low_res.end)
> > + insert_resource(&iomem_resource, &crashk_low_res);
> > +
> > + return 0;
> > +}
> > +early_initcall(insert_crashkernel_resources);
> > #endif
> >
> > int crash_prepare_elf64_headers(struct crash_mem *mem, int need_kernel_map,
>
> I'm thinking
>
> Fixes: 0ab97169aa0 ("crash_core: add generic function to do reservation").
Yes.
>
> Also, is this a regression? Were earlier kernels OK?
It's a regression, will impact arm64 in v6.6 kernel. Add below too?
Cc: <stable@vger.kernel.org> # 6.6.x
next prev parent reply other threads:[~2024-01-06 2:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-29 8:02 [PATCH] kdump: Defer the insertion of crashkernel resources Huacai Chen
2023-12-29 8:02 ` Huacai Chen
2024-01-05 2:53 ` Baoquan He
2024-01-05 2:53 ` Baoquan He
2024-01-05 16:49 ` Andrew Morton
2024-01-05 16:49 ` Andrew Morton
2024-01-06 2:09 ` Baoquan He [this message]
2024-01-06 2:09 ` Baoquan He
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=ZZi2WXVmXHcmd17c@MiWiFi-R3L-srv \
--to=bhe@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=chenhuacai@loongson.cn \
--cc=dyoung@redhat.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tangyouling@kylinos.cn \
--cc=vgoyal@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.