On Wednesday 19 July 2017 08:12 AM, Xunlei Pang wrote:
On 07/17/2017 at 07:50 PM, Pratyush Anand wrote:
>
>
> On Monday 17 July 2017 09:37 AM, Pratyush Anand wrote:
>> Currently kdump service is restarted even when any new file is added in cpu
>> subsystem. So, it can be restarted multiple times in the cases like loading
>> of acpi_cpufreq module or online/offline of any cpu.
>>
>> However, we should see kdump service restart only once in case a new CPU
>> is added or removed. cpu crash notes buffer is created when a new CPU is
>> added. It's location does not change when a CPU is onlined/offlined or
>> acpi_cpufreq driver is loaded. Therefore, no need to restart kdump
>> service in such cases.
>>
>> IMO, there is only one processor driver (drivers/acpi/processor_core.c) which
>> can enumerate a hot added cpu. An `udevadm info` enquiry to acpi device created
>> by this driver gives:
>> # udevadm info -a -p /sys/bus/acpi/devices/LNXCPU\:00/
>> looking at device
>> '/devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0010:00/LNXCPU:00':
>> KERNEL=="LNXCPU:00"
>> SUBSYSTEM=="acpi"
>>
>> Therefore, this patch modifies the rule to filter such devices.
>>
>> Signed-off-by: Pratyush Anand <panand(a)redhat.com>
>> ---
>> 98-kexec.rules | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/98-kexec.rules b/98-kexec.rules
>> index e32ee13cb2e8..d43760e38f8f 100644
>> --- a/98-kexec.rules
>> +++ b/98-kexec.rules
>> @@ -1,4 +1,4 @@
>> -SUBSYSTEM=="cpu", ACTION=="add",
PROGRAM="/bin/systemctl try-restart kdump.service"
>> -SUBSYSTEM=="cpu", ACTION=="remove",
PROGRAM="/bin/systemctl try-restart kdump.service"
>> +SUBSYSTEM=="acpi", ACTION=="add",
KERNEL=="LNXCPU*", PROGRAM="/etc/init.d/kdump condrestart"
>> +SUBSYSTEM=="acpi", ACTION=="remove",
KERNEL=="LNXCPU*", PROGRAM="/etc/init.d/kdump condrestart"
>
> It looks like that following works as well, not sure why we did not see any kdump
restart earlier with these rules.
>
> SUBSYSTEM=="cpu", ACTION=="add", KERNEL=="cpu[0-9]*",
PROGRAM="/etc/init.d/kdump condrestart"
> SUBSYSTEM=="cpu", ACTION=="remove",
KERNEL=="cpu[0-9]*", PROGRAM="/etc/init.d/kdump condrestart"
Seeing "/etc/init.d/kdump condrestart", I guess it's for RHEL6, right?
Yes, it was for RHEL6.
If so, I think no need to send to Fedora first.
I think, We should have for fedora as well, but following..
SUBSYSTEM=="cpu", ACTION=="add", KERNEL=="cpu[0-9]*",
PROGRAM="/bin/systemctl
try-restart kdump.service"
SUBSYSTEM=="cpu", ACTION=="remove", KERNEL=="cpu[0-9]*",
PROGRAM="/bin/systemctl try-restart kdump.service"
Regards
--
Pratyush