diff options
author | rrs <rrs@FreeBSD.org> | 2015-02-09 19:19:44 +0000 |
---|---|---|
committer | rrs <rrs@FreeBSD.org> | 2015-02-09 19:19:44 +0000 |
commit | 344ecf88af2dfb76703bce6a99c12f2fe7e7a165 (patch) | |
tree | 1f23063462d44b255b4fcda2af89f8a2bc287bfd /sys/sys/callout.h | |
parent | 9fc7114330f98a5abdb2764f28e1c60baf858f01 (diff) | |
download | FreeBSD-src-344ecf88af2dfb76703bce6a99c12f2fe7e7a165.zip FreeBSD-src-344ecf88af2dfb76703bce6a99c12f2fe7e7a165.tar.gz |
This fixes two conditions that can incur when migration
is being done in the callout code and harmonizes the macro
use.:
1) The callout_active() will lie. Basically if a migration
is occuring and the callout is about to expire and the
migration has been deferred, the callout_active will no
longer return true until after the migration. This confuses
and breaks callers that are doing callout_init(&c, 1); such
as TCP.
2) The migration code had a bug in it where when migrating, if
a two calls to callout_reset came in and they both collided with
the callout on the wheel about to run, then the second call to
callout_reset would corrupt the list the callout wheel uses
putting the callout thread into a endless loop.
3) Per imp, I have fixed all the macro occurance in the code that
were for the most part being ignored.
Phabricator D1711 and looked at by lstewart and jhb and sbruno.
Reviewed by: kostikbel, imp, adrian, hselasky
MFC after: 3 days
Sponsored by: Netflix Inc.
Diffstat (limited to 'sys/sys/callout.h')
-rw-r--r-- | sys/sys/callout.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/callout.h b/sys/sys/callout.h index 1096cb2..910d652 100644 --- a/sys/sys/callout.h +++ b/sys/sys/callout.h @@ -64,6 +64,7 @@ struct callout_handle { #ifdef _KERNEL #define callout_active(c) ((c)->c_flags & CALLOUT_ACTIVE) +#define callout_migrating(c) ((c)->c_flags & CALLOUT_DFRMIGRATION) #define callout_deactivate(c) ((c)->c_flags &= ~CALLOUT_ACTIVE) #define callout_drain(c) _callout_stop_safe(c, 1) void callout_init(struct callout *, int); |