From: Baoquan He <bhe@redhat.com>
To: kexec@lists.infradead.org
Subject: [PATCH v5 4/8] crash: generic crash hotplug support infrastructure
Date: Tue, 29 Mar 2022 09:10:34 +0800 [thread overview]
Message-ID: <YkJciuCXKuU4a4gp@MiWiFi-R3L-srv> (raw)
In-Reply-To: <6f59af6a-8a70-85ce-b36c-38eb31503c7d@oracle.com>
On 03/28/22 at 11:08am, Eric DeVolder wrote:
> Baoquan, a comment below.
> eric
>
> On 3/24/22 09:37, Eric DeVolder wrote:
> >
> >
> > On 3/24/22 09:33, Baoquan He wrote:
> > > On 03/24/22 at 08:53am, Eric DeVolder wrote:
> > > > Baoquan,
> > > > Thanks, I've offered a minor correction below.
> > > > eric
> > > >
> > > > On 3/24/22 08:49, Baoquan He wrote:
> > > > > On 03/24/22 at 09:38pm, Baoquan He wrote:
> > > > > > On 03/03/22 at 11:27am, Eric DeVolder wrote:
> > > > > > > This patch introduces a generic crash hot plug/unplug infrastructure
> > > > > > > for CPU and memory changes. Upon CPU and memory changes, a generic
> > > > > > > crash_hotplug_handler() obtains the appropriate lock, does some
> > > > > > > important house keeping and then dispatches the hot plug/unplug event
> > > > > > > to the architecture specific arch_crash_hotplug_handler(), and when
> > > > > > > that handler returns, the lock is released.
> > > > > > >
> > > > > > > This patch modifies crash_core.c to implement a subsys_initcall()
> > > > > > > function that installs handlers for hot plug/unplug events. If CPU
> > > > > > > hotplug is enabled, then cpuhp_setup_state() is invoked to register a
> > > > > > > handler for CPU changes. Similarly, if memory hotplug is enabled, then
> > > > > > > register_memory_notifier() is invoked to install a handler for memory
> > > > > > > changes. These handlers in turn invoke the common generic handler
> > > > > > > crash_hotplug_handler().
> > > > > > >
> > > > > > > On the CPU side, cpuhp_setup_state_nocalls() is invoked with parameter
> > > > > > > CPUHP_AP_ONLINE_DYN. While this works, when a CPU is being unplugged,
> > > > > > > the CPU still shows up in foreach_present_cpu() during the regeneration
> > > > > > > of the new CPU list, thus the need to explicitly check and exclude the
> > > > > > > soon-to-be offlined CPU in crash_prepare_elf64_headers().
> > > > > > >
> > > > > > > On the memory side, each un/plugged memory block passes through the
> > > > > > > handler. For example, if a 1GiB DIMM is hotplugged, that generate 8
> > > > > > > memory events, one for each 128MiB memblock.
> > > > > >
> > > > > > I rewrite the log as below with my understanding. Hope it's simpler to
> > > > > > help people get what's going on here. Please consider to take if it's
> > > > > > OK to you or adjust based on this. The code looks good to me.
> > > > > >
> > > > > Made some tuning:
> > > > >
> > > > > crash: add generic infrastructure for crash hotplug support
> > > > >
> > > > > Upon CPU and memory changes, a generic crash_hotplug_handler() is added
> > > > > to dispatch the hot plug/unplug event to the architecture specific
> > > > > arch_crash_hotplug_handler(). During the process, kexec_mutex need be
> > > > > held.
> > > > >
> > > > > To support cpu hotplug, one callback pair are registered to capture
> > > > > KEXEC_CRASH_HP_ADD_CPU and KEXEC_CRASH_HP_REMOVE_CPU events via
> > > > > cpuhp_setup_state_nocalls().
> > > > s/KEXEC_CRASH_HP_ADD}REMOVE_CPU/CPUHP_AP_ONLINE_DYN/ as the KEXEC_CRASH are the
> > > > names I've introduced with this patch?
> > >
> > > Right.
> > >
> > > While checking it, I notice hp_action which you don't use actually.
> > > Can you reconsider that part of design, the hp_action, the a, b
> > > parameter passed to handler?
> >
> > Sure I can remove. I initially put in there as this was generic
> > infrastructure and not sure if it would benefit others.
> > eric
> >
>
> Actually, I will keep the hp_action as the work by Sourabh Jain for PPC uses
> the hp_action. I'll drop the a and b.
Sounds great.
>
> Also, shall I post v6, or are you still looking at patches 7 and 8?
Will check today, thanks for the effort.
WARNING: multiple messages have this Message-ID (diff)
From: Baoquan He <bhe@redhat.com>
To: Eric DeVolder <eric.devolder@oracle.com>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
kexec@lists.infradead.org, ebiederm@xmission.com,
dyoung@redhat.com, vgoyal@redhat.com, tglx@linutronix.de,
mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com,
hpa@zytor.com, nramas@linux.microsoft.com,
thomas.lendacky@amd.com, robh@kernel.org, efault@gmx.de,
rppt@kernel.org, david@redhat.com, konrad.wilk@oracle.com,
boris.ostrovsky@oracle.com
Subject: Re: [PATCH v5 4/8] crash: generic crash hotplug support infrastructure
Date: Tue, 29 Mar 2022 09:10:34 +0800 [thread overview]
Message-ID: <YkJciuCXKuU4a4gp@MiWiFi-R3L-srv> (raw)
In-Reply-To: <6f59af6a-8a70-85ce-b36c-38eb31503c7d@oracle.com>
On 03/28/22 at 11:08am, Eric DeVolder wrote:
> Baoquan, a comment below.
> eric
>
> On 3/24/22 09:37, Eric DeVolder wrote:
> >
> >
> > On 3/24/22 09:33, Baoquan He wrote:
> > > On 03/24/22 at 08:53am, Eric DeVolder wrote:
> > > > Baoquan,
> > > > Thanks, I've offered a minor correction below.
> > > > eric
> > > >
> > > > On 3/24/22 08:49, Baoquan He wrote:
> > > > > On 03/24/22 at 09:38pm, Baoquan He wrote:
> > > > > > On 03/03/22 at 11:27am, Eric DeVolder wrote:
> > > > > > > This patch introduces a generic crash hot plug/unplug infrastructure
> > > > > > > for CPU and memory changes. Upon CPU and memory changes, a generic
> > > > > > > crash_hotplug_handler() obtains the appropriate lock, does some
> > > > > > > important house keeping and then dispatches the hot plug/unplug event
> > > > > > > to the architecture specific arch_crash_hotplug_handler(), and when
> > > > > > > that handler returns, the lock is released.
> > > > > > >
> > > > > > > This patch modifies crash_core.c to implement a subsys_initcall()
> > > > > > > function that installs handlers for hot plug/unplug events. If CPU
> > > > > > > hotplug is enabled, then cpuhp_setup_state() is invoked to register a
> > > > > > > handler for CPU changes. Similarly, if memory hotplug is enabled, then
> > > > > > > register_memory_notifier() is invoked to install a handler for memory
> > > > > > > changes. These handlers in turn invoke the common generic handler
> > > > > > > crash_hotplug_handler().
> > > > > > >
> > > > > > > On the CPU side, cpuhp_setup_state_nocalls() is invoked with parameter
> > > > > > > CPUHP_AP_ONLINE_DYN. While this works, when a CPU is being unplugged,
> > > > > > > the CPU still shows up in foreach_present_cpu() during the regeneration
> > > > > > > of the new CPU list, thus the need to explicitly check and exclude the
> > > > > > > soon-to-be offlined CPU in crash_prepare_elf64_headers().
> > > > > > >
> > > > > > > On the memory side, each un/plugged memory block passes through the
> > > > > > > handler. For example, if a 1GiB DIMM is hotplugged, that generate 8
> > > > > > > memory events, one for each 128MiB memblock.
> > > > > >
> > > > > > I rewrite the log as below with my understanding. Hope it's simpler to
> > > > > > help people get what's going on here. Please consider to take if it's
> > > > > > OK to you or adjust based on this. The code looks good to me.
> > > > > >
> > > > > Made some tuning:
> > > > >
> > > > > crash: add generic infrastructure for crash hotplug support
> > > > >
> > > > > Upon CPU and memory changes, a generic crash_hotplug_handler() is added
> > > > > to dispatch the hot plug/unplug event to the architecture specific
> > > > > arch_crash_hotplug_handler(). During the process, kexec_mutex need be
> > > > > held.
> > > > >
> > > > > To support cpu hotplug, one callback pair are registered to capture
> > > > > KEXEC_CRASH_HP_ADD_CPU and KEXEC_CRASH_HP_REMOVE_CPU events via
> > > > > cpuhp_setup_state_nocalls().
> > > > s/KEXEC_CRASH_HP_ADD}REMOVE_CPU/CPUHP_AP_ONLINE_DYN/ as the KEXEC_CRASH are the
> > > > names I've introduced with this patch?
> > >
> > > Right.
> > >
> > > While checking it, I notice hp_action which you don't use actually.
> > > Can you reconsider that part of design, the hp_action, the a, b
> > > parameter passed to handler?
> >
> > Sure I can remove. I initially put in there as this was generic
> > infrastructure and not sure if it would benefit others.
> > eric
> >
>
> Actually, I will keep the hp_action as the work by Sourabh Jain for PPC uses
> the hp_action. I'll drop the a and b.
Sounds great.
>
> Also, shall I post v6, or are you still looking at patches 7 and 8?
Will check today, thanks for the effort.
next prev parent reply other threads:[~2022-03-29 1:10 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-03 16:27 [PATCH v5 0/8] crash: Kernel handling of CPU and memory hot un/plug Eric DeVolder
2022-03-03 16:27 ` Eric DeVolder
2022-03-03 16:27 ` [PATCH v5 1/8] x86/crash: fix minor typo/bug in debug message Eric DeVolder
2022-03-03 16:27 ` Eric DeVolder
2022-03-03 16:27 ` [PATCH v5 2/8] x86/crash hp: Introduce CRASH_HOTPLUG configuration options Eric DeVolder
2022-03-03 16:27 ` Eric DeVolder
2022-03-21 11:59 ` Baoquan He
2022-03-21 11:59 ` Baoquan He
2022-04-01 18:31 ` Eric DeVolder
2022-04-01 18:31 ` Eric DeVolder
2022-03-03 16:27 ` [PATCH v5 3/8] crash: prototype change for crash_prepare_elf64_headers Eric DeVolder
2022-03-03 16:27 ` Eric DeVolder
2022-03-03 16:27 ` [PATCH v5 4/8] crash: generic crash hotplug support infrastructure Eric DeVolder
2022-03-03 16:27 ` Eric DeVolder
2022-03-15 12:08 ` Sourabh Jain
2022-03-15 12:08 ` Sourabh Jain
2022-03-15 14:12 ` Eric DeVolder
2022-03-15 14:12 ` Eric DeVolder
2022-03-17 10:46 ` Sourabh Jain
2022-03-17 10:46 ` Sourabh Jain
2022-03-24 13:38 ` Baoquan He
2022-03-24 13:38 ` Baoquan He
2022-03-24 13:49 ` Baoquan He
2022-03-24 13:49 ` Baoquan He
2022-03-24 13:53 ` Eric DeVolder
2022-03-24 13:53 ` Eric DeVolder
2022-03-24 14:33 ` Baoquan He
2022-03-24 14:33 ` Baoquan He
2022-03-24 14:37 ` Eric DeVolder
2022-03-24 14:37 ` Eric DeVolder
2022-03-28 16:08 ` Eric DeVolder
2022-03-28 16:08 ` Eric DeVolder
2022-03-29 1:10 ` Baoquan He [this message]
2022-03-29 1:10 ` Baoquan He
2022-04-01 18:33 ` Eric DeVolder
2022-04-01 18:33 ` Eric DeVolder
2022-03-03 16:27 ` [PATCH v5 5/8] kexec: exclude elfcorehdr from the segment digest Eric DeVolder
2022-03-03 16:27 ` Eric DeVolder
2022-03-03 16:27 ` [PATCH v5 6/8] kexec: exclude hot remove cpu from elfcorehdr notes Eric DeVolder
2022-03-03 16:27 ` Eric DeVolder
2022-03-03 16:27 ` [PATCH v5 7/8] x86/crash: Add x86 crash hotplug support for kexec_file_load Eric DeVolder
2022-03-03 16:27 ` Eric DeVolder
2022-03-31 10:34 ` Baoquan He
2022-03-31 10:34 ` Baoquan He
2022-04-01 18:34 ` Eric DeVolder
2022-04-01 18:34 ` Eric DeVolder
2022-03-03 16:27 ` [PATCH v5 8/8] x86/crash: Add x86 crash hotplug support for kexec_load Eric DeVolder
2022-03-03 16:27 ` Eric DeVolder
2022-03-31 11:10 ` Baoquan He
2022-03-31 11:10 ` Baoquan He
2022-04-01 18:35 ` Eric DeVolder
2022-04-01 18:35 ` Eric DeVolder
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=YkJciuCXKuU4a4gp@MiWiFi-R3L-srv \
--to=bhe@redhat.com \
--cc=kexec@lists.infradead.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 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.