From owner-svn-src-head@FreeBSD.ORG Wed Aug 11 17:42:45 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93D71106566B; Wed, 11 Aug 2010 17:42:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 650638FC16; Wed, 11 Aug 2010 17:42:45 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 1C0A646B4C; Wed, 11 Aug 2010 13:42:45 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (75-48-78-116.lightspeed.cncrca.sbcglobal.net [75.48.78.116]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B26398A03C; Wed, 11 Aug 2010 13:42:43 -0400 (EDT) Message-ID: <4C62E112.5090206@FreeBSD.org> Date: Wed, 11 Aug 2010 13:42:42 -0400 From: John Baldwin User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: Attilio Rao References: <201008111051.o7BApRp4028538@svn.freebsd.org> <4C62DADF.1000202@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 11 Aug 2010 13:42:44 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_DYNAMIC autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211176 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2010 17:42:45 -0000 Attilio Rao wrote: > 2010/8/11 John Baldwin : >> Attilio Rao wrote: >>> Author: attilio >>> Date: Wed Aug 11 10:51:27 2010 >>> New Revision: 211176 >>> URL: http://svn.freebsd.org/changeset/base/211176 >>> >>> Log: >>> IPI handlers may run generally with interrupts disabled because they >>> are served via an interrupt gate. >>> However, that doesn't explicitly prevent preemption and thread >>> migration thus scheduler pinning may be necessary in some handlers. >>> Fix that. >>> Tested by: gianni >>> MFC after: 1 month >> Actually that does prevent preemption if you do not call any code that would >> schedule a thread. I think this change is all safe to revert. > > Do you recall, then, why lapic_handle_timer() does critical section? > It seems to be catered by interrupt gate as well, and I don't see any > point re-enabling them explicitly. Because hardclock() explicitly calls sched_add() via swi_sched() when scheduling the softclock swi. The critical section there is just to ensure that the preemption to softclock happens after all of the clock interrupt handlers have finished. However, PCPU_GET() does not call sched_add(), so it does not need to be protected. -- John Baldwin