From owner-p4-projects@FreeBSD.ORG Mon Sep 29 17:41:40 2014 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C9065D33; Mon, 29 Sep 2014 17:41:40 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F976D31 for ; Mon, 29 Sep 2014 17:41:40 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682: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 5B8B3C3E for ; Mon, 29 Sep 2014 17:41:40 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.9/8.14.9) with ESMTP id s8THfe9T087437 for ; Mon, 29 Sep 2014 17:41:40 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.9/8.14.9/Submit) id s8THfeXP087434 for perforce@freebsd.org; Mon, 29 Sep 2014 17:41:40 GMT (envelope-from jhb@freebsd.org) Date: Mon, 29 Sep 2014 17:41:40 GMT Message-Id: <201409291741.s8THfeXP087434@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 1200927 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18-1 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2014 17:41:41 -0000 http://p4web.freebsd.org/@@1200927?ac=10 Change 1200927 by jhb@jhb_ralph on 2014/09/29 17:40:42 Various fixes. Submitted by: wblock (mostly) Affected files ... .. //depot/projects/smpng/share/man/man9/timeout.9#15 edit Differences ... ==== //depot/projects/smpng/share/man/man9/timeout.9#15 (text+ko) ==== @@ -171,18 +171,17 @@ .Fa rm , or .Fa rw -parameter, respectively. +parameter. The callout subsystem acquires the associated lock before calling the callout function. The subsystem then checks if the pending callout was cancelled while it waited for the associated lock. -If it was, +If the callout was cancelled, the callout function is not called and the associated lock is released. -If it was not, +If the callout was not cancelled, the callout function is called and the associated lock is released by the subsystem after the callout function returns. -In addition, -the callout must only be cancelled or rescheduled while holding the +The callout must only be cancelled or rescheduled while holding the associated lock. This guarantees that stopping or rescheduling a callout associated with a lock will not race with the callout function itself. @@ -205,7 +204,7 @@ cannot be used with callouts because sleeping is not permitted in the callout subsystem. .Pp -The following +These .Fa flags may be specified for .Fn callout_init_mtx , @@ -298,7 +297,7 @@ .Fa flags arguments provide more control over the scheduled time including support for higher resolution times, -specifying a precision of the scheduled time, +specifying the precision of the scheduled time, and setting an absolute deadline instead of a relative timeout. The callout is scheduled to execute in a time window which begins at the time specified in @@ -312,9 +311,9 @@ A non-zero value for .Fa pr allows the callout subsystem to coalesce callouts scheduled close to each -other into fewer timer interrupts reducing processing overhead and power -consumption. -The following +other into fewer timer interrupts, +reducing processing overhead and power consumption. +These .Fa flags may be specified to adjust the interpretation of .Fa sbt @@ -346,17 +345,17 @@ .Pq which result in larger time intervals allow the callout subsystem to aggregate more events in one timer interrupt. .It Dv C_HARDCLOCK -Align the timeouts to -.Fn hardclock +Align the timeouts to +.Fn hardclock calls if possible. .El .Pp The .Fn callout_reset -functions specify the function to be called when the time expires via the +functions accept a .Fa func -argument. -It should be a pointer to a function that takes a +argument which identifies the function to be called when the time expires. +It must be a pointer to a function that takes a single .Fa void * argument. Upon invocation, @@ -381,27 +380,34 @@ .Fn callout_schedule functions can be used. .Pp -Normally callouts are scheduled to execute on the softclock thread they -were associated with previously. -Callouts that have not been scheduled are associated with the softclock -thread for CPU 0. +The callout subsystem provides a softclock thread for each CPU in the system. +Callouts are assigned to a single CPU and are executed by the softclock thread +for that CPU. +Initially, +callouts are assigned to CPU 0. The .Fn callout_reset_on , .Fn callout_reset_sbt_on , and .Fn callout_schedule_on -functions accept an additional argument which associates the callout with -the softclock thread for CPU +functions assign the callout to CPU .Fa cpu . The .Fn callout_reset_curcpu , .Fn callout_reset_sbt_curpu , and .Fn callout_schedule_curcpu -functions associate the callout with the softclock thread for the current CPU. +functions assign the callout to the current CPU. +The +.Fn callout_reset , +.Fn callout_reset_sbt , +and +.Fn callout_schedule +functions schedule the callout to execute in the softclock thread of the CPU +it is currently assigned to. .Pp The softclock threads are not pinned to their respective CPUs by default. -The softclock thread for CPU 0 can be pinned to CPU by setting the +The softclock thread for CPU 0 can be pinned to CPU 0 by setting the .Va kern.pin_default_swi loader tunable to a non-zero value. The softclock threads for CPUs other than zero can be pinned to their @@ -454,7 +460,8 @@ .Ss "Avoiding Race Conditions" The callout subsystem invokes callout functions from its own thread context. -Without some kind of synchronization it is possible that a callout +Without some kind of synchronization, +it is possible that a callout function will be invoked concurrently with an attempt to stop or reset the callout by another thread. In particular, since callout functions typically acquire a lock as @@ -463,8 +470,8 @@ tries to reset or stop the callout. .Pp One of the following approaches can be used to address these -synchronization concerns, though the first approach is preferred when -possible as it is the simplest: +synchronization concerns. +The first approach is preferred as it is the simplest: .Bl -enum -offset indent .It Callouts can be associated with a specific lock when they are initialized @@ -476,9 +483,10 @@ When a callout is associated with a lock, the callout subsystem acquires the lock before the callout function is invoked. -This allows the callout subsystem to handle races between callout cancellation, +This allows the callout subsystem to transparently handle races between +callout cancellation, scheduling, -and execution transparently. +and execution. Note that the associated lock must be acquired before calling .Fn callout_stop or one of the @@ -497,15 +505,18 @@ If .Va Giant is held when cancelling or rescheduling the callout, -then it's use will prevent races with the callout function. +then its use will prevent races with the callout function. .It The return value from .Fn callout_stop -and the +.Po +or the .Fn callout_reset and .Fn callout_schedule -function families indicate whether or not the callout was removed. +function families +.Pc +indicates whether or not the callout was removed. If it is known that the callout was set and the callout function has not yet executed, then a return value of .Dv FALSE From owner-p4-projects@FreeBSD.ORG Mon Sep 29 19:31:39 2014 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8E302A13; Mon, 29 Sep 2014 19:31:39 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F2C9A11 for ; Mon, 29 Sep 2014 19:31:39 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682: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 3BDAFACE for ; Mon, 29 Sep 2014 19:31:39 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.9/8.14.9) with ESMTP id s8TJVddm015820 for ; Mon, 29 Sep 2014 19:31:39 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.9/8.14.9/Submit) id s8TJVduX015817 for perforce@freebsd.org; Mon, 29 Sep 2014 19:31:39 GMT (envelope-from jhb@freebsd.org) Date: Mon, 29 Sep 2014 19:31:39 GMT Message-Id: <201409291931.s8TJVduX015817@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 1200929 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18-1 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Sep 2014 19:31:39 -0000 http://p4web.freebsd.org/@@1200929?ac=10 Change 1200929 by jhb@jhb_ralph on 2014/09/29 19:31:34 More edits. Affected files ... .. //depot/projects/smpng/share/man/man9/timeout.9#16 edit Differences ... ==== //depot/projects/smpng/share/man/man9/timeout.9#16 (text+ko) ==== @@ -132,8 +132,8 @@ This is normally done by rescheduling the subsequent call within the called function. .Pp -Callout functions are not permitted to sleep. -They may not acquire any sleepable locks, +Callout functions must not sleep. +They may not acquire sleepable locks, wait on condition variables, perform blocking allocation requests, or invoke any other action that might sleep. @@ -172,19 +172,16 @@ or .Fa rw parameter. +The associated lock must be held while stopping or rescheduling the +callout. The callout subsystem acquires the associated lock before calling the -callout function. -The subsystem then checks if the pending callout was cancelled -while it waited for the associated lock. -If the callout was cancelled, +callout function and releases it after the function returns. +If the callout was cancelled while the callout subsystem waited for the +associated lock, the callout function is not called and the associated lock is released. -If the callout was not cancelled, -the callout function is called and the associated lock is released by the -subsystem after the callout function returns. -The callout must only be cancelled or rescheduled while holding the -associated lock. -This guarantees that stopping or rescheduling a callout associated with a -lock will not race with the callout function itself. +This guarantees that stopping or rescheduling the callout will not race with +the callout function itself because the associated lock must be held to +stop or reschedule the callout. .Pp Only regular mutexes may be used with .Fn callout_init_mtx ; From owner-p4-projects@FreeBSD.ORG Tue Sep 30 18:00:07 2014 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C446FA46; Tue, 30 Sep 2014 18:00:07 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85944A44 for ; Tue, 30 Sep 2014 18:00:07 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682: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 726AC13E for ; Tue, 30 Sep 2014 18:00:07 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.9/8.14.9) with ESMTP id s8UI070W063921 for ; Tue, 30 Sep 2014 18:00:07 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.9/8.14.9/Submit) id s8UI07XN063918 for perforce@freebsd.org; Tue, 30 Sep 2014 18:00:07 GMT (envelope-from jhb@freebsd.org) Date: Tue, 30 Sep 2014 18:00:07 GMT Message-Id: <201409301800.s8UI07XN063918@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 1200964 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18-1 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2014 18:00:08 -0000 http://p4web.freebsd.org/@@1200964?ac=10 Change 1200964 by jhb@jhb_jhbbsd on 2014/09/30 17:59:30 Stash this patch here. Affected files ... .. //depot/projects/smpng/sys/kern/uipc_socket.c#161 edit Differences ... ==== //depot/projects/smpng/sys/kern/uipc_socket.c#161 (text+ko) ==== @@ -3003,7 +3003,12 @@ { int revents = 0; - SOCKBUF_LOCK(&so->so_snd); + if (events & (POLLOUT | POLLWRNORM)) + SOCKBUF_LOCK(&so->so_snd); + /* + * The so_rcv lock doubles as SOCK_LOCK so it it is needed for + * all requests. + */ SOCKBUF_LOCK(&so->so_rcv); if (events & (POLLIN | POLLRDNORM)) if (soreadabledata(so)) @@ -3038,7 +3043,8 @@ } SOCKBUF_UNLOCK(&so->so_rcv); - SOCKBUF_UNLOCK(&so->so_snd); + if (events & (POLLOUT | POLLWRNORM)) + SOCKBUF_UNLOCK(&so->so_snd); return (revents); } From owner-p4-projects@FreeBSD.ORG Tue Sep 30 19:28:44 2014 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9A98EBF8; Tue, 30 Sep 2014 19:28:44 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5BA3ABF6 for ; Tue, 30 Sep 2014 19:28:44 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682: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 47CD5E1E for ; Tue, 30 Sep 2014 19:28:44 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.9/8.14.9) with ESMTP id s8UJSiKe087465 for ; Tue, 30 Sep 2014 19:28:44 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.9/8.14.9/Submit) id s8UJSieX087462 for perforce@freebsd.org; Tue, 30 Sep 2014 19:28:44 GMT (envelope-from jhb@freebsd.org) Date: Tue, 30 Sep 2014 19:28:44 GMT Message-Id: <201409301928.s8UJSieX087462@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 1200967 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18-1 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2014 19:28:44 -0000 http://p4web.freebsd.org/@@1200967?ac=10 Change 1200967 by jhb@jhb_jhbbsd on 2014/09/30 19:27:58 A patch I posted to the lists that probably isn't needed. It tries to make agp handle multiple agp devices sanely, but that shouldn't really happen. Affected files ... .. //depot/projects/smpng/sys/dev/agp/agp.c#20 edit Differences ... ==== //depot/projects/smpng/sys/dev/agp/agp.c#20 (text+ko) ==== @@ -212,6 +212,7 @@ agp_generic_attach(device_t dev) { struct agp_softc *sc = device_get_softc(dev); + struct cdev *cdev; int i; u_int memsize; @@ -232,7 +233,7 @@ /* * Work out an upper bound for agp memory allocation. This - * uses a heurisitc table from the Linux driver. + * uses a heuristic table from the Linux driver. */ memsize = ptoa(realmem) >> 20; for (i = 0; i < agp_max_size; i++) { @@ -257,8 +258,9 @@ sc->as_nextid = 1; sc->as_devnode = make_dev(&agp_cdevsw, - 0, UID_ROOT, GID_WHEEL, 0600, "agpgart"); + 0, UID_ROOT, GID_WHEEL, 0600, "%s", device_get_nameunit(dev)); sc->as_devnode->si_drv1 = dev; + make_dev_alias_p(MAKEDEV_CHECKNAME, &cdev, sc->as_devnode, "agpgart"); return 0; } From owner-p4-projects@FreeBSD.ORG Tue Sep 30 20:13:33 2014 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 82F518F0; Tue, 30 Sep 2014 20:13:33 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 438EB8EE for ; Tue, 30 Sep 2014 20:13:33 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682: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 300AC6A8 for ; Tue, 30 Sep 2014 20:13:33 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.9/8.14.9) with ESMTP id s8UKDX2x000586 for ; Tue, 30 Sep 2014 20:13:33 GMT (envelope-from jmg@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.9/8.14.9/Submit) id s8UKDX4K000583 for perforce@freebsd.org; Tue, 30 Sep 2014 20:13:33 GMT (envelope-from jmg@freebsd.org) Date: Tue, 30 Sep 2014 20:13:33 GMT Message-Id: <201409302013.s8UKDX4K000583@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jmg@freebsd.org using -f From: John-Mark Gurney Subject: PERFORCE change 1200968 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18-1 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2014 20:13:33 -0000 http://p4web.freebsd.org/@@1200968?ac=10 Change 1200968 by jmg@jmg_carbon2 on 2014/09/30 20:13:09 specify digest size.. state that it's the descriptor... Sponsored by: FreeBSD Foundation Sponsored by: Netgate Affected files ... .. //depot/projects/opencrypto/share/man/man7/crypto.7#6 edit Differences ... ==== //depot/projects/opencrypto/share/man/man7/crypto.7#6 (text+ko) ==== @@ -63,6 +63,8 @@ 1 .It Key size : 16, 24 or 32 +.It Digest size : +16 .El .Pp This algorithm implements Galois/Counter Mode. @@ -73,11 +75,12 @@ .Dv CRYPTO_AES_128_NIST_GMAC , .Dv CRYPTO_AES_192_NIST_GMAC or -.Dv CRYPTO_AES_256_NIST_GMAC . +.Dv CRYPTO_AES_256_NIST_GMAC , +that corresponds with the number of bits in the key that you are using. .Pp The associated data (if any) must be provided by the authentication mode op. -The authentication tag will be read/written from/to the offset crd_inject of -the authentication mode. +The authentication tag will be read/written from/to the offset crd_inject +specified in the descriptor for the authentication mode. .Pp Note: You must provide an IV on every call. .It Dv CRYPTO_AES_ICM From owner-p4-projects@FreeBSD.ORG Thu Oct 2 20:59:34 2014 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 532C1309; Thu, 2 Oct 2014 20:59:34 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13F9A307 for ; Thu, 2 Oct 2014 20:59:34 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682: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 00B93FD4 for ; Thu, 2 Oct 2014 20:59:34 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.9/8.14.9) with ESMTP id s92KxXOS070148 for ; Thu, 2 Oct 2014 20:59:33 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.9/8.14.9/Submit) id s92KxX7a070145 for perforce@freebsd.org; Thu, 2 Oct 2014 20:59:33 GMT (envelope-from jhb@freebsd.org) Date: Thu, 2 Oct 2014 20:59:33 GMT Message-Id: <201410022059.s92KxX7a070145@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 1201064 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18-1 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2014 20:59:34 -0000 http://p4web.freebsd.org/@@1201064?ac=10 Change 1201064 by jhb@jhb_jhbbsd on 2014/10/02 20:58:49 More fixes. Submitted by: wblock Affected files ... .. //depot/projects/smpng/share/man/man9/timeout.9#17 edit Differences ... ==== //depot/projects/smpng/share/man/man9/timeout.9#17 (text+ko) ==== @@ -463,10 +463,10 @@ the callout by another thread. In particular, since callout functions typically acquire a lock as their first action, the callout function may have already been invoked, -but be blocked waiting for that lock at the time that another thread +but is blocked waiting for that lock at the time that another thread tries to reset or stop the callout. .Pp -One of the following approaches can be used to address these +There are three main techniques for addressing these synchronization concerns. The first approach is preferred as it is the simplest: .Bl -enum -offset indent From owner-p4-projects@FreeBSD.ORG Thu Oct 2 21:19:57 2014 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 172F5E68; Thu, 2 Oct 2014 21:19:57 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AAD28E5F for ; Thu, 2 Oct 2014 21:19:56 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682: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 980CA29F for ; Thu, 2 Oct 2014 21:19:56 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.9/8.14.9) with ESMTP id s92LJuGt076063 for ; Thu, 2 Oct 2014 21:19:56 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.9/8.14.9/Submit) id s92LJugb076060 for perforce@freebsd.org; Thu, 2 Oct 2014 21:19:56 GMT (envelope-from jhb@freebsd.org) Date: Thu, 2 Oct 2014 21:19:56 GMT Message-Id: <201410022119.s92LJugb076060@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 1201066 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18-1 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2014 21:19:57 -0000 http://p4web.freebsd.org/@@1201066?ac=10 Change 1201066 by jhb@jhb_jhbbsd on 2014/10/02 21:19:34 These are fine to be p_cansee(). Affected files ... .. //depot/projects/smpng/sys/kern/sys_process.c#86 edit Differences ... ==== //depot/projects/smpng/sys/kern/sys_process.c#86 (text+ko) ==== @@ -1376,7 +1376,7 @@ if (p->p_state == PRS_NEW) error = ESRCH; else - error = p_cansched(td, p); + error = p_cansee(td, p); if (error == 0) error = kern_procctl_single(td, p, com, data); PROC_UNLOCK(p); @@ -1398,7 +1398,7 @@ first_error = 0; LIST_FOREACH(p, &pg->pg_members, p_pglist) { PROC_LOCK(p); - if (p->p_state == PRS_NEW || p_cansched(td, p) != 0) { + if (p->p_state == PRS_NEW || p_cansee(td, p) != 0) { PROC_UNLOCK(p); continue; } From owner-p4-projects@FreeBSD.ORG Fri Oct 3 19:34:23 2014 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 05120E39; Fri, 3 Oct 2014 19:34:23 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9CC9E37 for ; Fri, 3 Oct 2014 19:34:22 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682: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 A6AACBF1 for ; Fri, 3 Oct 2014 19:34:22 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.9/8.14.9) with ESMTP id s93JYMIc030965 for ; Fri, 3 Oct 2014 19:34:22 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.9/8.14.9/Submit) id s93JYM3a030962 for perforce@freebsd.org; Fri, 3 Oct 2014 19:34:22 GMT (envelope-from jhb@freebsd.org) Date: Fri, 3 Oct 2014 19:34:22 GMT Message-Id: <201410031934.s93JYM3a030962@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 1201096 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18-1 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Oct 2014 19:34:23 -0000 http://p4web.freebsd.org/@@1201096?ac=10 Change 1201096 by jhb@jhb_ralph on 2014/10/03 19:33:34 More fixes. Submitted by: wblock Affected files ... .. //depot/projects/smpng/share/man/man9/timeout.9#18 edit Differences ... ==== //depot/projects/smpng/share/man/man9/timeout.9#18 (text+ko) ==== @@ -178,7 +178,8 @@ callout function and releases it after the function returns. If the callout was cancelled while the callout subsystem waited for the associated lock, -the callout function is not called and the associated lock is released. +the callout function is not called, +and the associated lock is released. This guarantees that stopping or rescheduling the callout will not race with the callout function itself because the associated lock must be held to stop or reschedule the callout. @@ -401,13 +402,13 @@ and .Fn callout_schedule functions schedule the callout to execute in the softclock thread of the CPU -it is currently assigned to. +to which it is currently assigned. .Pp -The softclock threads are not pinned to their respective CPUs by default. +Softclock threads are not pinned to their respective CPUs by default. The softclock thread for CPU 0 can be pinned to CPU 0 by setting the .Va kern.pin_default_swi loader tunable to a non-zero value. -The softclock threads for CPUs other than zero can be pinned to their +Softclock threads for CPUs other than zero can be pinned to their respective CPUs by setting the .Va kern.pin_pcpu_swi loader tunable to a non-zero value.