From owner-svn-src-projects@FreeBSD.ORG Fri May 13 19:36:55 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55F37106566B; Fri, 13 May 2011 19:36:55 +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 DC9658FC19; Fri, 13 May 2011 19:36:54 +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 p4DJaoUQ068364 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 May 2011 22:36:50 +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 p4DJaoJc055921; Fri, 13 May 2011 22:36:50 +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 p4DJaodu055920; Fri, 13 May 2011 22:36:50 +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: Fri, 13 May 2011 22:36:50 +0300 From: Kostik Belousov To: Attilio Rao Message-ID: <20110513193650.GY48734@deviant.kiev.zoral.com.ua> References: <20110513221936.X1161@besplex.bde.org> <20110513154349.GV48734@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3uxt9koO+4Cm8N9x" Content-Disposition: inline In-Reply-To: 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=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, 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: src-committers@freebsd.org, Artem Belevich , Oleksandr Tymoshenko , Bruce Evans , svn-src-projects@freebsd.org, Warner Losh Subject: Re: svn commit: r221614 - projects/largeSMP/sys/powerpc/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2011 19:36:55 -0000 --3uxt9koO+4Cm8N9x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 13, 2011 at 05:45:52PM +0200, Attilio Rao wrote: > 2011/5/13 Kostik Belousov : > > On Fri, May 13, 2011 at 03:50:47PM +0200, Attilio Rao wrote: > >> The per-cpu stuff also, is read only. The pm_active objects are > >> protected by VM locks. > > > > pm_active is not protected by any vm lock. It is set and cleared > > unlocked in the context switch code. But, the ctx switch only needs > > to set and clear a single bit at the time of switch, that makes > > the atomic operations sufficient for consistency. > > > > I had a WIP on the Intel PCID, were such protection was not enough, > > unfortunately. >=20 > You are indeed right, sorry. >=20 > What trouble were you having in your case, just for the sake of my > curiosity, if you can share? PCID is a feature where the cpu tag each TLB entry with some process ID (not Unix PID). When doing context switch, reload of %cr3 does not invalidate the TLB on the core, but instead rewrite the "current ID" value to use for tag fetch and store. For each pmap, when page entry is modified, we need to clear the TLB entry on all cores (threads) that could have the mapping in TLB. So each pmap grows additional cpu set which indicates such cores. In the microbenchmark, use of PCID gives two times speed increase of context switch. I do not remember exact details right now, but I did need a NAND operation on cpu sets with both operands potentially having more then one bit active. Currently the work is stalled, I lost access to the Westmere machine for testing. --3uxt9koO+4Cm8N9x Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk3NiFIACgkQC3+MBN1Mb4j5IgCgu4wBygxLffJPbfMIZMZntHBJ cywAn3nL5gYkbGlHV6KjN+xybAaHYJCW =ruJX -----END PGP SIGNATURE----- --3uxt9koO+4Cm8N9x--