From owner-freebsd-current@FreeBSD.ORG Mon Jan 30 16:43:25 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70686106566C for ; Mon, 30 Jan 2012 16:43:25 +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 02F148FC0A for ; Mon, 30 Jan 2012 16:43:24 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q0UGhGkk036453 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 30 Jan 2012 18:43:17 +0200 (EET) (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.5/8.14.5) with ESMTP id q0UGhG8K097150; Mon, 30 Jan 2012 18:43:16 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q0UGhGZO097149; Mon, 30 Jan 2012 18:43:16 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 30 Jan 2012 18:43:16 +0200 From: Kostik Belousov To: Paul Ambrose Message-ID: <20120130164316.GW2726@deviant.kiev.zoral.com.ua> References: <20120130063607.GV2726@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QWIFStbFpmlD00Pf" 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.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-current Subject: Re: Does anyone try kib's Sandy Bridge PCID patch (pcid.2.patch)? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jan 2012 16:43:25 -0000 --QWIFStbFpmlD00Pf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 30, 2012 at 07:08:13PM +0800, Paul Ambrose wrote: > ?? 2012??1??30?? ????2:36??Kostik Belousov ?????? > > On Mon, Jan 30, 2012 at 10:15:51AM +0800, Paul Ambrose wrote: > >> I have two boxes, one is AMD Athlon 610e 2.4G with FreeBSD-current > >> patched with pcid.2.patch? It works well without other issue and it > >> seem the pcid patch > >> does not affect other part of the kernel. The other one is Sandy > > Athlons do not have PCID and probably will never implement it. They use > > other tricks to get similar optimizations, transparently to the OS. > > > Just curious, is this AMD similar optimizations > Address Space Number (ASN) and Global flag > US Patent 6,604,187. > http://www.chip-architect.com/news/2003_09_21_Detailed_Architecture_of_AM= Ds_64bit_Core.html This and the same-important next item 'The TLB Flush Filter' is what I referred to. > I did not found anything about ASN in the AMD manual It is a transparent optimization, which does not require any OS support. Intel PCID is completely different, it shall be explicitely handled by OS. It is some consequence of the nested pages support, AFAIU. >=20 > >> Bridge i5-2300 with FreeBSD 9 release patched with pcid.1.patch( the > >> pcid.2.patch seems > >> dependent on AVX and XSAVE stuffs which is available on -current). But > >> it hangs up just in a few minutes. I doubt the nvidia-driver which is > >> not recompiled with > >> patched kernel is the root, I will check this out later, but does > >> anyone meet similar problem? > > There are two many variations compared to the config I did tested. > > I do not see anything obvious in the changes between HEAD and stable/9 > > which could be blamed. Nvidia driver might be bigger suspect, but again, > > I am not aware of anything wrong with it. > > > >> > >> I have two question about the pcid.2.patch > > > > Item 2 is clean, I fixed it. > > > > For the item 1, I was only able to decipher the proposal to optimize > > the global shootdown handler to restore the %cr3 with bit 64 set to not > > invalidate current PCID. Is there some more changes ? > > > yes, that is what I meant. I was wondering using another way that each > process has different > pcid in each active processor, just as the freebsd mips and powerpc > uses. But obviously this way > is more friendly to non-pcid x86 processor. Each vmspace (or pmap) has unique PCID with the patch, at least until PCID space (12bit) is not exhausted. To really exhaust it, you need 4095 processes, so it is unlikely but possible event with the current settings. --QWIFStbFpmlD00Pf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk8myKQACgkQC3+MBN1Mb4gcxgCgkQBCUHUve1s8BKEET8Y/r6hy F4QAoM0OxgMI27N4VsxVftKKqBeu7eWG =Oobf -----END PGP SIGNATURE----- --QWIFStbFpmlD00Pf--