From owner-svn-src-projects@freebsd.org Fri Aug 28 07:31:21 2015 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB81D9C49BF for ; Fri, 28 Aug 2015 07:31:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBF46957; Fri, 28 Aug 2015 07:31:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7S7VKXU033656; Fri, 28 Aug 2015 07:31:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7S7VKbj033651; Fri, 28 Aug 2015 07:31:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201508280731.t7S7VKbj033651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 28 Aug 2015 07:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r287248 - in projects/hps_head: share/man/man9 sys/kern X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2015 07:31:21 -0000 Author: hselasky Date: Fri Aug 28 07:31:19 2015 New Revision: 287248 URL: https://svnweb.freebsd.org/changeset/base/287248 Log: Revert r287194 due to coming changes in -current. Modified: projects/hps_head/share/man/man9/timeout.9 projects/hps_head/sys/kern/kern_timeout.c Modified: projects/hps_head/share/man/man9/timeout.9 ============================================================================== --- projects/hps_head/share/man/man9/timeout.9 Fri Aug 28 06:41:40 2015 (r287247) +++ projects/hps_head/share/man/man9/timeout.9 Fri Aug 28 07:31:19 2015 (r287248) @@ -246,8 +246,9 @@ argument. The number of ticks in a second is defined by .Dv hz and can vary from system to system. -This function has the same return value like -.Fn callout_stop . +This function returns a non-zero value if the given callout was pending and +the callback function was prevented from being called. +Otherwise, a value of zero is returned. If a lock is associated with the callout given by the .Fa c argument and it is exclusivly locked when this function is called, this @@ -482,25 +483,17 @@ is undefined. This function is used to stop a timeout function invocation associated with the callout pointed to by the .Fa c argument, in a non-blocking fashion. -This function can be called multiple times in a row with no side effects, even if the callout is already stopped. -This function however should not be called before the callout has been initialized. +This function can be called multiple times in a row with no side effects, even if the callout is already stopped. This function however should not be called before the callout has been initialized. +This function returns a non-zero value if the given callout was pending and +the callback function was prevented from being called. +Else a value of zero is returned. If a lock is associated with the callout given by the .Fa c argument and it is exclusivly locked when this function is called, the .Fn callout_stop function will always ensure that the callback function is never reached. In other words the callout will be atomically stopped. -When a callout is atomically stopped a return value of non-zero is returned. -Else a value of zero is returned. -If there is no lock associated with the callout given by the -.Fa c -argument the return values are slightly different. -If the callout was stopped ahead of the callback function a return -value of non-zero is returned. -If the callback function is currently executing and also if the -callout was restarted before being stopped again, a return value of -zero is returned. -In all other cases a value of zero is returned. +Else there is no such guarantee. .Sh DRAINING CALLOUTS .Ft int .Fn callout_drain "struct callout *c" Modified: projects/hps_head/sys/kern/kern_timeout.c ============================================================================== --- projects/hps_head/sys/kern/kern_timeout.c Fri Aug 28 06:41:40 2015 (r287247) +++ projects/hps_head/sys/kern/kern_timeout.c Fri Aug 28 07:31:19 2015 (r287248) @@ -1028,19 +1028,8 @@ callout_restart_async(struct callout *c, */ if (cc_exec_cancel(cc, direct) == false || (c->c_flags & CALLOUT_DEFRESTART) != 0) { - /* - * MPSAFE callouts should not return they were - * cancelled when the callback is scheduled - * for completion. Even if a deferred callback - * was actually stopped. This helps MPSAFE - * clients decide when they have a pending - * callback or not. - */ cc_exec_cancel(cc, direct) = true; - if (c->c_lock == NULL) - cancelled = CALLOUT_RET_NORMAL; - else - cancelled = CALLOUT_RET_CANCELLED; + cancelled = CALLOUT_RET_CANCELLED; } else { cancelled = CALLOUT_RET_NORMAL; }