On Thu, May 01, 2014 at 05:23:37PM -0400, Prarit Bhargava wrote:
On 05/01/2014 02:58 PM, Vivek Goyal wrote:
> On Thu, May 01, 2014 at 01:11:30PM -0400, Prarit Bhargava wrote:
>
> [..]
>> diff --git a/98-kexec.rules b/98-kexec.rules
>> index 8c742dd..e32ee13 100644
>> --- a/98-kexec.rules
>> +++ b/98-kexec.rules
>> @@ -1,4 +1,4 @@
>> -SUBSYSTEM=="cpu", ACTION=="online",
PROGRAM="/bin/systemctl try-restart kdump.service"
>> -SUBSYSTEM=="cpu", ACTION=="offline",
PROGRAM="/bin/systemctl try-restart kdump.service"
>> -SUBSYSTEM=="memory", ACTION=="add",
PROGRAM="/bin/systemctl try-restart kdump.service"
>> -SUBSYSTEM=="memory", ACTION=="remove",
PROGRAM="/bin/systemctl try-restart kdump.service"
>> +SUBSYSTEM=="cpu", ACTION=="add",
PROGRAM="/bin/systemctl try-restart kdump.service"
>> +SUBSYSTEM=="cpu", ACTION=="remove",
PROGRAM="/bin/systemctl try-restart kdump.service"
>
> So when is "add" event generated. After cpu has been added and that add
> operation is complete?
^^^ you used "add" too many times here and you need to define what
"add" means
in your sentence.
Can you ask your question using these udev definitions?
When is "add" event generated? After cpu has been added or when cpu is
being added?
IOW, when a cpu N is added a new file /sys/<foo-dir>/cpuN/crash_notes will
be created. So this "add" event is generated after above file has been
created?
IOW, is it guaranteed that crash_notes file for newly added cpu has been
created by the time kexec-tools runs.
[..]
>
> IOW, I don't want a race between kexec-tools looking at
> /sys/.../cpu<N>/crash_notes and cpu add operation. It should not happen
> that cpu add operation is still in progress while kexec starts poking
> in /sys. Otherwise potentially we can miss this cpu in /proc/vmcore.
>
crash_notes is created when the cpu is added, not when it is onlined. I cannot
predict when a panic occurs, and it has always worked like this so I'm not
agreeing with your concern wrt to the crash_notes file.
I am not worried about when panic occurs. I am only worrying about timing
of event generation w.r.t crash_notes file creation.
Thanks
Vivek