From owner-svn-src-all@FreeBSD.ORG Wed Aug 11 15:05:20 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 AB2EF1065674; Wed, 11 Aug 2010 15:05:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 3F7178FC12; Wed, 11 Aug 2010 15:05:19 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o7BF5GCh019778 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 11 Aug 2010 18:05:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o7BF5GEI080718; Wed, 11 Aug 2010 18:05:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o7BF5Gfc080717; Wed, 11 Aug 2010 18:05:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 11 Aug 2010 18:05:16 +0300 From: Kostik Belousov To: Attilio Rao Message-ID: <20100811150516.GM2396@deviant.kiev.zoral.com.ua> References: <201008111051.o7BApRp4028538@svn.freebsd.org> <20100811105739.GJ2396@deviant.kiev.zoral.com.ua> <20100811123430.GK2396@deviant.kiev.zoral.com.ua> <20100811144646.GL2396@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cEobB2knsyc5ebfU" Content-Disposition: inline In-Reply-To: <20100811144646.GL2396@deviant.kiev.zoral.com.ua> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-2.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Jeff Roberson , John Baldwin 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 15:05:20 -0000 --cEobB2knsyc5ebfU Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 11, 2010 at 05:46:46PM +0300, Kostik Belousov wrote: > On Wed, Aug 11, 2010 at 04:29:21PM +0200, Attilio Rao wrote: > > 2010/8/11 Kostik Belousov : > > > On Wed, Aug 11, 2010 at 01:21:46PM +0200, Attilio Rao wrote: > > >> 2010/8/11 Kostik Belousov : > > >> > On Wed, Aug 11, 2010 at 10:51:27AM +0000, 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: > > >> >> =9A IPI handlers may run generally with interrupts disabled becau= se they > > >> >> =9A are served via an interrupt gate. > > >> >> > > >> >> =9A However, that doesn't explicitly prevent preemption and thread > > >> >> =9A migration thus scheduler pinning may be necessary in some han= dlers. > > >> >> =9A Fix that. > > >> > > > >> > How the preemption is supposed to happen ? Aside from the explicit > > >> > calls to mi_switch() from e.g. critical_exit(). > > >> > > >> IIRC it should be hardclock() willing to schedule the softclock(). It > > >> is the critical_exit() in the thread_unlock() that may trigger it > > >> (sorry for not digging more, it was a while back that I hacked this > > >> part, but I guess you can verify on your own). > > >> We already have other points within the kernel that take care of > > >> dealing with preemption/migration like lapic_handle_timer(), for > > >> example. > > > > > > Right, and if the interrupts are indeed disabled, I do not see how > > > the preemption may be triggered in the fragments like > > > =9A =9A =9A =9Acpu =3D PCPU_GET(cpuid); > > > =9A =9A =9A =9Acpumask =3D PCPU_GET(cpumask); > >=20 > > I don't recall all the details and I have no time to dig now. However, > > also spinlock_enter() does disable explicitly preemption via > > critical_enter() after have disabled the interrupts. > > Let me CC jhb as he implemented spinlock_enter() and may have a clue > > about how preemption can happen with interrupts disabled. >=20 > spinlock_enter() disables preemption to handle the recursive > calls to spinlock_enter/leave, I think, to prevent switch on > leave. >=20 > I do understand the reason for your change. do _not_ understand. sorry. --cEobB2knsyc5ebfU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkxivCsACgkQC3+MBN1Mb4icRgCgxR/NthiQ+9cjbpaneO5HvWlA urcAoKBdnAcmts4h2LZd5Sjw75SC5PJj =cDZm -----END PGP SIGNATURE----- --cEobB2knsyc5ebfU--