From owner-svn-src-all@FreeBSD.ORG Wed Aug 11 17:47:11 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 712A6106564A; Wed, 11 Aug 2010 17:47:11 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id C039F8FC23; Wed, 11 Aug 2010 17:47:10 +0000 (UTC) Received: by qwg5 with SMTP id 5so453125qwg.13 for ; Wed, 11 Aug 2010 10:47:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=eUzAz1wFxTgXBV2PQkxVT7OXHsGYR6f28zzwSu8OVY8=; b=Wf19hYGqPXCOxX4CSoE2Kw/z6B3+SwDb31piue+g2ZPzr2SgzXFbDTF2Af4Pa2L76J x7m2ITVVhMUlBBQ3+63oOi0MpQSls/O/nPV20csKLV0AU13b/C834Ro2dZ41B9G7dnhQ tH+GbStkqHxcfq6wfK7mL954C3hq7pRSqqtSY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=qbzwcbCgFDUq0J23OI7E/VtvRH827yAPL1IGVcf5AMK0E4qEMrV6sQOKiWrl8rpllD iZCKzBLEgB7n6jgDOfk2A/HMdFxPDY544nxXKzFnnglXgyZ4Pc3RyFSvjjifbfZe+9Bh FgbOrt1xkQNUkaRS5GYYIm8prz9GdKCWx4ruA= MIME-Version: 1.0 Received: by 10.229.221.203 with SMTP id id11mr5297821qcb.222.1281548829892; Wed, 11 Aug 2010 10:47:09 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.229.251.6 with HTTP; Wed, 11 Aug 2010 10:47:09 -0700 (PDT) In-Reply-To: <4C62E112.5090206@FreeBSD.org> References: <201008111051.o7BApRp4028538@svn.freebsd.org> <4C62DADF.1000202@FreeBSD.org> <4C62E112.5090206@FreeBSD.org> Date: Wed, 11 Aug 2010 19:47:09 +0200 X-Google-Sender-Auth: 1EQ-CBoL428DPC4UcVSvZVW8uDk Message-ID: From: Attilio Rao To: John Baldwin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2010 17:47:11 -0000 2010/8/11 John Baldwin : > 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: >>>> =C2=A0IPI handlers may run generally with interrupts disabled because = they >>>> =C2=A0are served via an interrupt gate. >>>> =C2=A0 However, that doesn't explicitly prevent preemption and thread >>>> =C2=A0migration thus scheduler pinning may be necessary in some handle= rs. >>>> =C2=A0Fix that. >>>> =C2=A0 Tested by: =C2=A0gianni >>>> =C2=A0MFC after: =C2=A0 =C2=A01 month >>> >>> Actually that does prevent preemption if you do not call any code that >>> would >>> schedule a thread. =C2=A0I 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. =C2=A0The critical section there is just to= ensure > that the preemption to softclock happens after all of the clock interrupt > handlers have finished. =C2=A0However, PCPU_GET() does not call sched_add= (), so > it does not need to be protected. Oh, sorry, was looking at the -CURRENT code which had no explicit call to hardclock (it uses the new timer infrastructure, so that was not so obvious). I understand now, so I will rever the change asap. Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein