Date: Tue, 5 Jul 2016 12:22:17 -0700 From: Gleb Smirnoff <glebius@FreeBSD.org> To: "Ngie Cooper (yaneurabeya)" <yaneurabeya@gmail.com> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers <src-committers@freebsd.org> Subject: Re: svn commit: r302350 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20160705192217.GC1076@FreeBSD.org> In-Reply-To: <D511EFD0-9CA7-49D3-A891-98C7F03A9FE0@gmail.com> References: <201607051847.u65IlIYf000901@repo.freebsd.org> <D511EFD0-9CA7-49D3-A891-98C7F03A9FE0@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160705192217.GC1076>