svn commit: r302350 - in head: share/man/man9 sys/kern sys/sys

Gleb Smirnoff glebius at FreeBSD.org
Tue Jul 5 19:22:19 UTC 2016


On Tue, Jul 05, 2016 at 11:48:56AM -0700, Ngie Cooper (yaneurabeya) wrote:
N> > Author: glebius
N> > Date: Tue Jul  5 18:47:17 2016
N> > New Revision: 302350
N> > URL: https://svnweb.freebsd.org/changeset/base/302350
N> > 
N> > Log:
N> >  The paradigm of a callout is that it has three consequent states:
N> >  not scheduled -> scheduled -> running -> not scheduled. The API and the
N> >  manual page assume that, some comments in the code assume that, and looks
N> >  like some contributors to the code also did. The problem is that this
N> >  paradigm isn't true. A callout can be scheduled and running at the same
N> >  time, which makes API description ambigouous. In such case callout_stop()
N> >  family of functions/macros should return 1 and 0 at the same time, since it
N> >  successfully unscheduled future callout but the current one is running.
N> >  Before this change we returned 1 in such a case, with an exception that
N> >  if running callout was migrating we returned 0, unless CS_MIGRBLOCK was
N> >  specified.
N> > 
N> >  With this change, we now return 0 in case if future callout was unscheduled,
N> >  but another one is still in action, indicating to API users that resources
N> >  are not yet safe to be freed.
N> > 
N> >  However, the sleepqueue code relies on getting 1 return code in that case,
N> >  and there already was CS_MIGRBLOCK flag, that covered one of the edge cases.
N> >  In the new return path we will also use this flag, to keep sleepqueue safe.
N> > 
N> >  Since the flag CS_MIGRBLOCK doesn't block migration and now isn't limited to
N> >  migration edge case, rename it to CS_EXECUTING.
N> > 
N> >  This change fixes panics on a high loaded TCP server.
N> > 
N> >  Reviewed by:	jch, hselasky, rrs, kib
N> >  Approved by:	re (gjb)
N> >  Differential Revision:	https://reviews.freebsd.org/D7042
N> > 
N> > Modified:
N> >  head/share/man/man9/timeout.9
N> >  head/sys/kern/kern_timeout.c
N> >  head/sys/kern/subr_sleepqueue.c
N> >  head/sys/sys/callout.h
N> 
N> Should __FreeBSD_version be bumped for the change?

No. We consider the new behavior more matching the documentation rather than
old one.

-- 
Totus tuus, Glebius.


More information about the svn-src-all mailing list