From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 26 13:54:43 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05F92106566B; Fri, 26 Nov 2010 13:54:43 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 1E4D68FC0A; Fri, 26 Nov 2010 13:54:41 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA25430; Fri, 26 Nov 2010 15:54:40 +0200 (EET) (envelope-from avg@freebsd.org) Message-ID: <4CEFBC20.3090407@freebsd.org> Date: Fri, 26 Nov 2010 15:54:40 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.12) Gecko/20101029 Lightning/1.0b2 Thunderbird/3.1.6 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <4CEB6039.2040700@freebsd.org> <4CEBC11F.9000402@freebsd.org> In-Reply-To: <4CEBC11F.9000402@freebsd.org> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=x-viet-vps Content-Transfer-Encoding: 7bit Cc: "Robert N. M. Watson" Subject: Re: dtrace/cyclic deadlock X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Nov 2010 13:54:43 -0000 on 23/11/2010 15:26 Andriy Gapon said the following: > on 23/11/2010 08:33 Andriy Gapon said the following: >> I think that this is quite similar to what we do for per-CPU caches in UMA and >> so the same approach should work here. >> That is, as in (Open)Solaris, the data should be accessed only from the owning >> CPU and spinlock_enter()/spinlock_exit() should be used to prevent races between >> non-interrupt code and nested interrupt code. > > Here's a patch that makes our version of cyclic.c a little bit closer to the > upstream version whilst implementing the above idea: > http://people.freebsd.org/~avg/cyclic-deadlock.diff > > All accesses to per-CPU cyclics data are performed strictly from the corresponding > CPUs in an interrupt or interrupt-like context. "Upcalls" occur in event timer's > interrupt filter and all down calls are performed via smp_rendezvous_cpus(). > > I will appreciate reviews and testing. Should I wait for any pending comments? Otherwise I am confident enough in the patch to commit it. -- Andriy Gapon