* [PATCH] kdump: Add udev events for memory online/offline
@ 2011-10-27 9:32 ` Michael Holzheu
0 siblings, 0 replies; 23+ messages in thread
From: Michael Holzheu @ 2011-10-27 9:32 UTC (permalink / raw)
To: akpm
Cc: Heiko Carstens, Vivek Goyal, Eric W. Biederman, schwidefsky,
kexec, linux-kernel, Kay Sievers, Dave Hansen
From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Currently no udev events for memory hotplug "online" and "offline" are
generated:
# udevadm monitor
# echo offline > /sys/devices/system/memory/memory4/state
==> No event
When kdump is loaded, kexec detects the current memory configuration and
stores it in the pre-allocated ELF core header. Therefore, for kdump it is
necessary to reload the kdump kernel with kexec when the memory
configuration changes (e.g. for online/offline hotplug memory).
In order to do this automatically, udev rules should be used. This kernel
patch adds udev events for "online" and "offline". Together with this kernel
patch, the following udev rules for online/offline have to be added to
"/etc/udev/rules.d/98-kexec.rules":
SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/etc/init.d/kdump restart"
SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/etc/init.d/kdump restart"
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
---
drivers/base/memory.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -310,11 +310,15 @@ store_mem_state(struct sys_device *dev,
mem = container_of(dev, struct memory_block, sysdev);
- if (!strncmp(buf, "online", min((int)count, 6)))
+ if (!strncmp(buf, "online", min((int)count, 6))) {
ret = memory_block_change_state(mem, MEM_ONLINE, MEM_OFFLINE);
- else if(!strncmp(buf, "offline", min((int)count, 7)))
+ if (ret == 0)
+ kobject_uevent(&dev->kobj, KOBJ_ONLINE);
+ } else if (!strncmp(buf, "offline", min((int)count, 7))) {
ret = memory_block_change_state(mem, MEM_OFFLINE, MEM_ONLINE);
-
+ if (ret == 0)
+ kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
+ }
if (ret)
return ret;
return count;
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: [PATCH] kdump: Add udev events for memory online/offline
2011-10-27 9:32 ` Michael Holzheu
@ 2011-10-28 22:41 ` Andrew Morton
-1 siblings, 0 replies; 23+ messages in thread
From: Andrew Morton @ 2011-10-28 22:41 UTC (permalink / raw)
To: holzheu
Cc: Heiko Carstens, Kay Sievers, kexec, linux-kernel, Dave Hansen,
Eric W. Biederman, schwidefsky, Vivek Goyal
On Thu, 27 Oct 2011 11:32:45 +0200
Michael Holzheu <holzheu@linux.vnet.ibm.com> wrote:
> From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
>
> Currently no udev events for memory hotplug "online" and "offline" are
> generated:
>
> # udevadm monitor
> # echo offline > /sys/devices/system/memory/memory4/state
> ==> No event
>
> When kdump is loaded, kexec detects the current memory configuration and
> stores it in the pre-allocated ELF core header. Therefore, for kdump it is
> necessary to reload the kdump kernel with kexec when the memory
> configuration changes (e.g. for online/offline hotplug memory).
>
> In order to do this automatically, udev rules should be used. This kernel
> patch adds udev events for "online" and "offline". Together with this kernel
> patch, the following udev rules for online/offline have to be added to
> "/etc/udev/rules.d/98-kexec.rules":
>
> SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/etc/init.d/kdump restart"
> SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/etc/init.d/kdump restart"
>
> Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
> ---
> drivers/base/memory.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> --- a/drivers/base/memory.c
> +++ b/drivers/base/memory.c
> @@ -310,11 +310,15 @@ store_mem_state(struct sys_device *dev,
>
> mem = container_of(dev, struct memory_block, sysdev);
>
> - if (!strncmp(buf, "online", min((int)count, 6)))
> + if (!strncmp(buf, "online", min((int)count, 6))) {
> ret = memory_block_change_state(mem, MEM_ONLINE, MEM_OFFLINE);
> - else if(!strncmp(buf, "offline", min((int)count, 7)))
> + if (ret == 0)
> + kobject_uevent(&dev->kobj, KOBJ_ONLINE);
> + } else if (!strncmp(buf, "offline", min((int)count, 7))) {
> ret = memory_block_change_state(mem, MEM_OFFLINE, MEM_ONLINE);
> -
> + if (ret == 0)
> + kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
> + }
ot: what on earth is up with that min() thing which
Dave-who-doesn't-know-about-min_t added to the strncmp() calls?
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: [PATCH] kdump: Add udev events for memory online/offline
@ 2011-10-28 22:41 ` Andrew Morton
0 siblings, 0 replies; 23+ messages in thread
From: Andrew Morton @ 2011-10-28 22:41 UTC (permalink / raw)
To: holzheu
Cc: Heiko Carstens, Vivek Goyal, Eric W. Biederman, schwidefsky,
kexec, linux-kernel, Kay Sievers, Dave Hansen
On Thu, 27 Oct 2011 11:32:45 +0200
Michael Holzheu <holzheu@linux.vnet.ibm.com> wrote:
> From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
>
> Currently no udev events for memory hotplug "online" and "offline" are
> generated:
>
> # udevadm monitor
> # echo offline > /sys/devices/system/memory/memory4/state
> ==> No event
>
> When kdump is loaded, kexec detects the current memory configuration and
> stores it in the pre-allocated ELF core header. Therefore, for kdump it is
> necessary to reload the kdump kernel with kexec when the memory
> configuration changes (e.g. for online/offline hotplug memory).
>
> In order to do this automatically, udev rules should be used. This kernel
> patch adds udev events for "online" and "offline". Together with this kernel
> patch, the following udev rules for online/offline have to be added to
> "/etc/udev/rules.d/98-kexec.rules":
>
> SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/etc/init.d/kdump restart"
> SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/etc/init.d/kdump restart"
>
> Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
> ---
> drivers/base/memory.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> --- a/drivers/base/memory.c
> +++ b/drivers/base/memory.c
> @@ -310,11 +310,15 @@ store_mem_state(struct sys_device *dev,
>
> mem = container_of(dev, struct memory_block, sysdev);
>
> - if (!strncmp(buf, "online", min((int)count, 6)))
> + if (!strncmp(buf, "online", min((int)count, 6))) {
> ret = memory_block_change_state(mem, MEM_ONLINE, MEM_OFFLINE);
> - else if(!strncmp(buf, "offline", min((int)count, 7)))
> + if (ret == 0)
> + kobject_uevent(&dev->kobj, KOBJ_ONLINE);
> + } else if (!strncmp(buf, "offline", min((int)count, 7))) {
> ret = memory_block_change_state(mem, MEM_OFFLINE, MEM_ONLINE);
> -
> + if (ret == 0)
> + kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
> + }
ot: what on earth is up with that min() thing which
Dave-who-doesn't-know-about-min_t added to the strncmp() calls?
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: [PATCH] kdump: Add udev events for memory online/offline
2011-10-28 22:41 ` Andrew Morton
@ 2011-10-28 22:57 ` Dave Hansen
-1 siblings, 0 replies; 23+ messages in thread
From: Dave Hansen @ 2011-10-28 22:57 UTC (permalink / raw)
To: Andrew Morton
Cc: Heiko Carstens, Kay Sievers, kexec, linux-kernel,
Eric W. Biederman, schwidefsky, holzheu, Vivek Goyal
On Fri, 2011-10-28 at 15:41 -0700, Andrew Morton wrote:
> > + } else if (!strncmp(buf, "offline", min((int)count, 7))) {
> > ret = memory_block_change_state(mem, MEM_OFFLINE, MEM_ONLINE);
> > -
> > + if (ret == 0)
> > + kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
> > + }
>
> ot: what on earth is up with that min() thing which
> Dave-who-doesn't-know-about-min_t added to the strncmp() calls?
My first reaction was, "that's not my code!", but git seems to disagree
with me. So I'll go and blame it on being young and stupid in 2005.
Reading it, I also think it's probably buggy.
echo -n "o" > state
would be interesting. I think it'll fall in to the 'online' case.
While probably not that common, it's certainly unexpected. I'll send a
patch to fix it up.
-- Dave
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: [PATCH] kdump: Add udev events for memory online/offline
@ 2011-10-28 22:57 ` Dave Hansen
0 siblings, 0 replies; 23+ messages in thread
From: Dave Hansen @ 2011-10-28 22:57 UTC (permalink / raw)
To: Andrew Morton
Cc: holzheu, Heiko Carstens, Vivek Goyal, Eric W. Biederman,
schwidefsky, kexec, linux-kernel, Kay Sievers
On Fri, 2011-10-28 at 15:41 -0700, Andrew Morton wrote:
> > + } else if (!strncmp(buf, "offline", min((int)count, 7))) {
> > ret = memory_block_change_state(mem, MEM_OFFLINE, MEM_ONLINE);
> > -
> > + if (ret == 0)
> > + kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
> > + }
>
> ot: what on earth is up with that min() thing which
> Dave-who-doesn't-know-about-min_t added to the strncmp() calls?
My first reaction was, "that's not my code!", but git seems to disagree
with me. So I'll go and blame it on being young and stupid in 2005.
Reading it, I also think it's probably buggy.
echo -n "o" > state
would be interesting. I think it'll fall in to the 'online' case.
While probably not that common, it's certainly unexpected. I'll send a
patch to fix it up.
-- Dave
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH] kdump: Add udev events for memory online/offline
2011-10-27 9:32 ` Michael Holzheu
@ 2011-10-28 22:46 ` Andrew Morton
-1 siblings, 0 replies; 23+ messages in thread
From: Andrew Morton @ 2011-10-28 22:46 UTC (permalink / raw)
To: holzheu
Cc: Heiko Carstens, Kay Sievers, kexec, linux-kernel, Dave Hansen,
Eric W. Biederman, schwidefsky, Vivek Goyal
On Thu, 27 Oct 2011 11:32:45 +0200
Michael Holzheu <holzheu@linux.vnet.ibm.com> wrote:
> From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
>
> Currently no udev events for memory hotplug "online" and "offline" are
> generated:
>
> # udevadm monitor
> # echo offline > /sys/devices/system/memory/memory4/state
> ==> No event
>
> When kdump is loaded, kexec detects the current memory configuration and
> stores it in the pre-allocated ELF core header. Therefore, for kdump it is
> necessary to reload the kdump kernel with kexec when the memory
> configuration changes (e.g. for online/offline hotplug memory).
>
> In order to do this automatically, udev rules should be used. This kernel
> patch adds udev events for "online" and "offline". Together with this kernel
> patch, the following udev rules for online/offline have to be added to
> "/etc/udev/rules.d/98-kexec.rules":
>
> SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/etc/init.d/kdump restart"
> SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/etc/init.d/kdump restart"
>
> Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
> ---
> drivers/base/memory.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> --- a/drivers/base/memory.c
> +++ b/drivers/base/memory.c
> @@ -310,11 +310,15 @@ store_mem_state(struct sys_device *dev,
>
> mem = container_of(dev, struct memory_block, sysdev);
>
> - if (!strncmp(buf, "online", min((int)count, 6)))
> + if (!strncmp(buf, "online", min((int)count, 6))) {
> ret = memory_block_change_state(mem, MEM_ONLINE, MEM_OFFLINE);
> - else if(!strncmp(buf, "offline", min((int)count, 7)))
> + if (ret == 0)
> + kobject_uevent(&dev->kobj, KOBJ_ONLINE);
> + } else if (!strncmp(buf, "offline", min((int)count, 7))) {
> ret = memory_block_change_state(mem, MEM_OFFLINE, MEM_ONLINE);
> -
> + if (ret == 0)
> + kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
> + }
> if (ret)
> return ret;
> return count;
I think a safer place from which to send the uevent is
memory_block_change_state() or even memory_block_action(). Because if
either of those functions later gets new callers, those callers might
forget to send the uevent?
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: [PATCH] kdump: Add udev events for memory online/offline
@ 2011-10-28 22:46 ` Andrew Morton
0 siblings, 0 replies; 23+ messages in thread
From: Andrew Morton @ 2011-10-28 22:46 UTC (permalink / raw)
To: holzheu
Cc: Heiko Carstens, Vivek Goyal, Eric W. Biederman, schwidefsky,
kexec, linux-kernel, Kay Sievers, Dave Hansen
On Thu, 27 Oct 2011 11:32:45 +0200
Michael Holzheu <holzheu@linux.vnet.ibm.com> wrote:
> From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
>
> Currently no udev events for memory hotplug "online" and "offline" are
> generated:
>
> # udevadm monitor
> # echo offline > /sys/devices/system/memory/memory4/state
> ==> No event
>
> When kdump is loaded, kexec detects the current memory configuration and
> stores it in the pre-allocated ELF core header. Therefore, for kdump it is
> necessary to reload the kdump kernel with kexec when the memory
> configuration changes (e.g. for online/offline hotplug memory).
>
> In order to do this automatically, udev rules should be used. This kernel
> patch adds udev events for "online" and "offline". Together with this kernel
> patch, the following udev rules for online/offline have to be added to
> "/etc/udev/rules.d/98-kexec.rules":
>
> SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/etc/init.d/kdump restart"
> SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/etc/init.d/kdump restart"
>
> Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
> ---
> drivers/base/memory.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> --- a/drivers/base/memory.c
> +++ b/drivers/base/memory.c
> @@ -310,11 +310,15 @@ store_mem_state(struct sys_device *dev,
>
> mem = container_of(dev, struct memory_block, sysdev);
>
> - if (!strncmp(buf, "online", min((int)count, 6)))
> + if (!strncmp(buf, "online", min((int)count, 6))) {
> ret = memory_block_change_state(mem, MEM_ONLINE, MEM_OFFLINE);
> - else if(!strncmp(buf, "offline", min((int)count, 7)))
> + if (ret == 0)
> + kobject_uevent(&dev->kobj, KOBJ_ONLINE);
> + } else if (!strncmp(buf, "offline", min((int)count, 7))) {
> ret = memory_block_change_state(mem, MEM_OFFLINE, MEM_ONLINE);
> -
> + if (ret == 0)
> + kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
> + }
> if (ret)
> return ret;
> return count;
I think a safer place from which to send the uevent is
memory_block_change_state() or even memory_block_action(). Because if
either of those functions later gets new callers, those callers might
forget to send the uevent?
^ permalink raw reply [flat|nested] 23+ messages in thread* [PATCH v2] kdump: Add udev events for memory online/offline
2011-10-28 22:46 ` Andrew Morton
@ 2011-10-31 13:21 ` Michael Holzheu
-1 siblings, 0 replies; 23+ messages in thread
From: Michael Holzheu @ 2011-10-31 13:21 UTC (permalink / raw)
To: Andrew Morton
Cc: Heiko Carstens, Kay Sievers, kexec, linux-kernel, Dave Hansen,
Eric W. Biederman, schwidefsky, Vivek Goyal
On Fri, 2011-10-28 at 15:46 -0700, Andrew Morton wrote:
> On Thu, 27 Oct 2011 11:32:45 +0200
[snip]
> I think a safer place from which to send the uevent is
> memory_block_change_state() or even memory_block_action(). Because if
> either of those functions later gets new callers, those callers might
> forget to send the uevent?
Ok fine. I put the code into memory_block_change_state(). This also has
the advantage that we are serialized by "mem->state_mutex". Not sure if
we need that, but for CPU hotplug the udev events are also serialized
with a lock. See "drivers/base/cpu.c" -> cpu_hotplug_driver_lock()
Do you think the following patch is acceptable?
---
From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Currently no udev events for memory hotplug "online" and "offline" are
generated:
# udevadm monitor
# echo offline > /sys/devices/system/memory/memory4/state
==> No event
When kdump is loaded, kexec detects the current memory configuration and
stores it in the pre-allocated ELF core header. Therefore, for kdump it is
necessary to reload the kdump kernel with kexec when the memory
configuration changes (e.g. for online/offline hotplug memory).
In order to do this automatically, udev rules should be used. This kernel
patch adds udev events for "online" and "offline". Together with this kernel
patch, the following udev rules for online/offline have to be added to
"/etc/udev/rules.d/98-kexec.rules":
SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/etc/init.d/kdump restart"
SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/etc/init.d/kdump restart"
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
---
drivers/base/memory.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -291,11 +291,22 @@ static int memory_block_change_state(str
ret = memory_block_action(mem->start_section_nr, to_state);
- if (ret)
+ if (ret) {
mem->state = from_state_req;
- else
- mem->state = to_state;
+ goto out;
+ }
+ mem->state = to_state;
+ switch (mem->state) {
+ case MEM_OFFLINE:
+ kobject_uevent(&mem->sysdev.kobj, KOBJ_OFFLINE);
+ break;
+ case MEM_ONLINE:
+ kobject_uevent(&mem->sysdev.kobj, KOBJ_ONLINE);
+ break;
+ default:
+ break;
+ }
out:
mutex_unlock(&mem->state_mutex);
return ret;
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 23+ messages in thread* [PATCH v2] kdump: Add udev events for memory online/offline
@ 2011-10-31 13:21 ` Michael Holzheu
0 siblings, 0 replies; 23+ messages in thread
From: Michael Holzheu @ 2011-10-31 13:21 UTC (permalink / raw)
To: Andrew Morton
Cc: Heiko Carstens, Vivek Goyal, Eric W. Biederman, schwidefsky,
kexec, linux-kernel, Kay Sievers, Dave Hansen
On Fri, 2011-10-28 at 15:46 -0700, Andrew Morton wrote:
> On Thu, 27 Oct 2011 11:32:45 +0200
[snip]
> I think a safer place from which to send the uevent is
> memory_block_change_state() or even memory_block_action(). Because if
> either of those functions later gets new callers, those callers might
> forget to send the uevent?
Ok fine. I put the code into memory_block_change_state(). This also has
the advantage that we are serialized by "mem->state_mutex". Not sure if
we need that, but for CPU hotplug the udev events are also serialized
with a lock. See "drivers/base/cpu.c" -> cpu_hotplug_driver_lock()
Do you think the following patch is acceptable?
---
From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Currently no udev events for memory hotplug "online" and "offline" are
generated:
# udevadm monitor
# echo offline > /sys/devices/system/memory/memory4/state
==> No event
When kdump is loaded, kexec detects the current memory configuration and
stores it in the pre-allocated ELF core header. Therefore, for kdump it is
necessary to reload the kdump kernel with kexec when the memory
configuration changes (e.g. for online/offline hotplug memory).
In order to do this automatically, udev rules should be used. This kernel
patch adds udev events for "online" and "offline". Together with this kernel
patch, the following udev rules for online/offline have to be added to
"/etc/udev/rules.d/98-kexec.rules":
SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/etc/init.d/kdump restart"
SUBSYSTEM=="memory", ACTION=="offline", PROGRAM="/etc/init.d/kdump restart"
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
---
drivers/base/memory.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -291,11 +291,22 @@ static int memory_block_change_state(str
ret = memory_block_action(mem->start_section_nr, to_state);
- if (ret)
+ if (ret) {
mem->state = from_state_req;
- else
- mem->state = to_state;
+ goto out;
+ }
+ mem->state = to_state;
+ switch (mem->state) {
+ case MEM_OFFLINE:
+ kobject_uevent(&mem->sysdev.kobj, KOBJ_OFFLINE);
+ break;
+ case MEM_ONLINE:
+ kobject_uevent(&mem->sysdev.kobj, KOBJ_ONLINE);
+ break;
+ default:
+ break;
+ }
out:
mutex_unlock(&mem->state_mutex);
return ret;
^ permalink raw reply [flat|nested] 23+ messages in thread* Re: [PATCH v2] kdump: Add udev events for memory online/offline
2011-10-31 13:21 ` Michael Holzheu
(?)
@ 2011-11-14 2:37 ` WANG Cong
-1 siblings, 0 replies; 23+ messages in thread
From: WANG Cong @ 2011-11-14 2:37 UTC (permalink / raw)
To: linux-kernel; +Cc: kexec
On Mon, 31 Oct 2011 14:21:46 +0100, Michael Holzheu wrote:
> On Fri, 2011-10-28 at 15:46 -0700, Andrew Morton wrote:
>> On Thu, 27 Oct 2011 11:32:45 +0200
>
> [snip]
>
>> I think a safer place from which to send the uevent is
>> memory_block_change_state() or even memory_block_action(). Because if
>> either of those functions later gets new callers, those callers might
>> forget to send the uevent?
>
> Ok fine. I put the code into memory_block_change_state(). This also has
> the advantage that we are serialized by "mem->state_mutex". Not sure if
> we need that, but for CPU hotplug the udev events are also serialized
> with a lock. See "drivers/base/cpu.c" -> cpu_hotplug_driver_lock()
>
> Do you think the following patch is acceptable?
Yes.
> ---
> From: Michael Holzheu <holzheu@linux.vnet.ibm.com>
>
> Currently no udev events for memory hotplug "online" and "offline" are
> generated:
>
> # udevadm monitor
> # echo offline > /sys/devices/system/memory/memory4/state ==> No event
>
> When kdump is loaded, kexec detects the current memory configuration and
> stores it in the pre-allocated ELF core header. Therefore, for kdump it
> is necessary to reload the kdump kernel with kexec when the memory
> configuration changes (e.g. for online/offline hotplug memory).
>
> In order to do this automatically, udev rules should be used. This
> kernel patch adds udev events for "online" and "offline". Together with
> this kernel patch, the following udev rules for online/offline have to
> be added to "/etc/udev/rules.d/98-kexec.rules":
>
> SUBSYSTEM=="memory", ACTION=="online", PROGRAM="/etc/init.d/kdump
> restart" SUBSYSTEM=="memory", ACTION=="offline",
> PROGRAM="/etc/init.d/kdump restart"
>
> Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Thanks.
^ permalink raw reply [flat|nested] 23+ messages in thread