[PATCH] [RFC] checkpoint/restart timerfd

Oren Laadan orenl at cs.columbia.edu
Mon Nov 16 10:56:54 PST 2009



Matt Helsley wrote:
> On Fri, Nov 13, 2009 at 04:49:35PM -0800, Matt Helsley wrote:
>> Support checkpoint/restart of timers specified via timerfd. Checkpoint
>> essentially does the timerfd_gettime() syscall and saves the expired flags
>> and tick count. This ensures there will be no lost expirations/ticks
>> between checkpoint restart.
>>
>> This should largely work as expected since the time returned from gettime
>> is always relative.
>>
>> However, like any time-sensitive state, timerfds set with TFD_TIMER_ABSTIME
>> may expire/tick at the "wrong time" because that time has long since passed.
>> Short of introducing time namespaces there's almost nothing that can be done
>> to checkpoint these uses of timerfd. Would it make more sense to mark timerfds
>> which were (re)set with TFD_TIMER_ABSTIME and refuse to checkpoint them rather
>> than deliver a "best-effort" expiration/tick?
>>
>> Signed-off-by: Matt Helsley <matthltc at us.ibm.com>
>> --
>> NOTE: Compiles, untested.
>> ---
>>  fs/timerfd.c                   |  113 ++++++++++++++++++++++++++++++++++++----
> 
> Argh. Missed the "restore" path which requires installing a handler for
> these files in checkpoint/file.c. Fixed.

So in that missing part (here and in signalfd), make sure it also
compiles without CONFIG_{SIGNAL,TIMER}_FD. And ignore this comment
if you already did...

Oren.



More information about the Containers mailing list