merge mod_alarm() into add_alarm()
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
Pablo Neira Ayuso
maintainerQuoted 6 lines · Max Kellermann
include/alarm.h | 4 +--- src/alarm.c | 13 +++++-------- src/cache_timer.c | 5 ++--- src/sync-alarm.c | 17 +++++++---------- src/sync-ftfw.c | 8 +++----- 5 files changed, 18 insertions(+), 29 deletions(-)
Applied a similar version. Thanks.
BTW, I'm cc'ing to both netfilter-devel and netfilter-failover, next time just include netfilter-devel since we're discussing development stuff.
Signature · 1 line
"Los honestos son inadaptados sociales" -- Les Luthiers
A message that is not in the archive (sent off-list or not yet received): [email protected]
Pablo Neira Ayuso
maintainerRe: [nf-failover] [conntrack-utils PATCH r7254 02/14] remove duplicate init_alarm() invocations
src/sync-alarm.c static void cache_alarm_add(struct us_conntrack *u, void *data) · line 52
Quoted 9 lines · Max Kellermann
src/sync-alarm.c +0
-1@@ -49,7 +49,6 @@ static void cache_alarm_add(struct us_conntrack *u, void *data) {struct alarm_list *alarm = data; -init_alarm (alarm, u, refresher);
I guess that you wanted to remove init_alarm() from refresher() instead. Fixed and applied. Thanks.
Signature · 1 line
"Los honestos son inadaptados sociales" -- Les Luthiers
A message that is not in the archive (sent off-list or not yet received): [email protected]
Pablo Neira Ayuso
maintainerRe: [nf-failover] [conntrack-utils PATCH r7254 04/14] fix misoptimization for next_alarm calculation
Quoted 12 lines · Max Kellermann
do_alarm_run()determines thenext_alarmtime. there is however a condition where this result comes wrong, because of "unsafe" side effects oflist_for_each_entry_safe(). Example: imagine there are two
alarms: A is due now, and B is due in 5 minutes.When
do_alarm_run()runs alarm A,list_for_each_entry_safe()remembers B as the alarm for the next loop iteration.Now A re-schedules itself in 1 minute. It is again the first entry in the
alarm_listqueue, butlist_for_each_entry_safe()will not handle it in this loop.
Quoted 5 lines
Instead,
do_alarm_run()sees B and returns "5 minutes" as thenext_alarmtime.Solve this by breaking from the loop when a late event is detected, and letting
get_next_alarm()do all the work.
Good point. I noticed this while rewriting the alarm scheduler, in the rewrite it should handle this case correctly.
Signature · 1 line
"Los honestos son inadaptados sociales" -- Les Luthiers
A message that is not in the archive (sent off-list or not yet received): [email protected]
Pablo Neira Ayuso
maintainerRe: [nf-failover] [conntrack-utils PATCH r7254 08/14] check alarms even if select()!=0
Quoted 5 lines · Max Kellermann
It is not documented that
select()always returns 0 when the timeout expires - the timeout may expire, and there may be events on file descriptors at the same time. Don't check theselect()return value, checktimerisset(next_alarm)instead, and always updatenext_alarmwithget_next_alarm()
Indeed, good point. This was fixed in r7260.
Quoted 2 lines
Also the old code never checked for new alarms which were added during the file descriptor handlers.
Same thing.
Signature · 1 line
"Los honestos son inadaptados sociales" -- Les Luthiers
A message that is not in the archive (sent off-list or not yet received): [email protected]
Pablo Neira Ayuso
maintainerRe: [nf-failover] [conntrack-utils PATCH r7254 05/14] make the "tv" parameter const
I have kept back 5/14, 6/14, 7/14 and 9/14 since I don't find an obvious way to merge this to r7260. Thanks anyway for your work again.
Signature · 1 line
"Los honestos son inadaptados sociales" -- Les Luthiers