From owner-freebsd-mips@FreeBSD.ORG Tue Jun 4 12:53:03 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CC94DF18; Tue, 4 Jun 2013 12:53:03 +0000 (UTC) (envelope-from aduane@juniper.net) Received: from tx2outboundpool.messaging.microsoft.com (tx2ehsobe001.messaging.microsoft.com [65.55.88.11]) by mx1.freebsd.org (Postfix) with ESMTP id 7B4971013; Tue, 4 Jun 2013 12:53:03 +0000 (UTC) Received: from mail142-tx2-R.bigfish.com (10.9.14.226) by TX2EHSOBE015.bigfish.com (10.9.40.35) with Microsoft SMTP Server id 14.1.225.23; Tue, 4 Jun 2013 12:22:44 +0000 Received: from mail142-tx2 (localhost [127.0.0.1]) by mail142-tx2-R.bigfish.com (Postfix) with ESMTP id 99B2A240091; Tue, 4 Jun 2013 12:22:44 +0000 (UTC) X-Forefront-Antispam-Report: CIP:66.129.224.51; KIP:(null); UIP:(null); IPV:NLI; H:P-EMHUB02-HQ.jnpr.net; RD:none; EFVD:NLI X-SpamScore: -4 X-BigFish: PS-4(zz98dI9371I542I1432Izz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6hzz8275ch17326ah8275dhz31h2a8h683h839h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh15d0h162dh1631h1758h18e1h1946h19b5h19ceh1ad9h1b0ah1d07h1d0ch1d2eh1d3fh1de9h1dfeh1dffh1155h) Received-SPF: softfail (mail142-tx2: transitioning domain of juniper.net does not designate 66.129.224.51 as permitted sender) client-ip=66.129.224.51; envelope-from=aduane@juniper.net; helo=P-EMHUB02-HQ.jnpr.net ; -HQ.jnpr.net ; X-Forefront-Antispam-Report-Untrusted: CIP:157.56.244.213; KIP:(null); UIP:(null); (null); H:CH1PRD0510HT002.namprd05.prod.outlook.com; R:internal; EFV:INT Received: from mail142-tx2 (localhost.localdomain [127.0.0.1]) by mail142-tx2 (MessageSwitch) id 13703485634494_30393; Tue, 4 Jun 2013 12:22:43 +0000 (UTC) Received: from TX2EHSMHS008.bigfish.com (unknown [10.9.14.234]) by mail142-tx2.bigfish.com (Postfix) with ESMTP id E7B10440050; Tue, 4 Jun 2013 12:22:42 +0000 (UTC) Received: from P-EMHUB02-HQ.jnpr.net (66.129.224.51) by TX2EHSMHS008.bigfish.com (10.9.99.108) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 4 Jun 2013 12:22:40 +0000 Received: from P-CLDFE02-HQ.jnpr.net (172.24.192.60) by P-EMHUB02-HQ.jnpr.net (172.24.192.36) with Microsoft SMTP Server (TLS) id 8.3.213.0; Tue, 4 Jun 2013 05:22:39 -0700 Received: from o365mail.juniper.net (207.17.137.149) by o365mail.juniper.net (172.24.192.60) with Microsoft SMTP Server id 14.1.355.2; Tue, 4 Jun 2013 05:22:38 -0700 Received: from ch1outboundpool.messaging.microsoft.com (216.32.181.183) by o365mail.juniper.net (207.17.137.149) with Microsoft SMTP Server (TLS) id 14.1.355.2; Tue, 4 Jun 2013 05:25:48 -0700 Received: from mail57-ch1-R.bigfish.com (10.43.68.240) by CH1EHSOBE019.bigfish.com (10.43.70.76) with Microsoft SMTP Server id 14.1.225.23; Tue, 4 Jun 2013 12:22:38 +0000 Received: from mail57-ch1 (localhost [127.0.0.1]) by mail57-ch1-R.bigfish.com (Postfix) with ESMTP id 41C33E0161; Tue, 4 Jun 2013 12:22:38 +0000 (UTC) Received: from mail57-ch1 (localhost.localdomain [127.0.0.1]) by mail57-ch1 (MessageSwitch) id 1370348556289141_8751; Tue, 4 Jun 2013 12:22:36 +0000 (UTC) Received: from CH1EHSMHS014.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.244]) by mail57-ch1.bigfish.com (Postfix) with ESMTP id 43FFE2C00F9; Tue, 4 Jun 2013 12:22:36 +0000 (UTC) Received: from CH1PRD0510HT002.namprd05.prod.outlook.com (157.56.244.213) by CH1EHSMHS014.bigfish.com (10.43.70.14) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 4 Jun 2013 12:22:34 +0000 Received: from CH1PRD0510MB392.namprd05.prod.outlook.com ([169.254.6.109]) by CH1PRD0510HT002.namprd05.prod.outlook.com ([10.255.150.37]) with mapi id 14.16.0311.000; Tue, 4 Jun 2013 12:22:34 +0000 From: Andrew Duane To: Juli Mallett , Adrian Chadd Subject: RE: Kernelspace C11 atomics for MIPS Thread-Topic: Kernelspace C11 atomics for MIPS Thread-Index: AQHOYINHGC9M8xF/6kiJf8fnnz6uaJkk2jUAgAATWwCAAIsx4A== Date: Tue, 4 Jun 2013 12:22:33 +0000 Message-ID: <477C1270D3E5484DA2303CEBE274C9E13210A1C0@CH1PRD0510MB392.namprd05.prod.outlook.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [66.129.232.2] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% X-FOPE-CONNECTOR: Id%12219$Dn%FREEBSD.ORG$RO%2$TLS%5$FQDN%onpremiseedge-1018244.customer.frontbridge.com$TlsDn%o365mail.juniper.net X-FOPE-CONNECTOR: Id%12219$Dn%80386.NL$RO%2$TLS%5$FQDN%onpremiseedge-1018244.customer.frontbridge.com$TlsDn%o365mail.juniper.net X-OriginatorOrg: juniper.net Cc: Ed Schouten , "freebsd-mips@FreeBSD.org" , FreeBSD-arch X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jun 2013 12:53:03 -0000 > -----Original Message----- > From: owner-freebsd-mips@freebsd.org [mailto:owner-freebsd- > mips@freebsd.org] On Behalf Of Juli Mallett > Sent: Monday, June 03, 2013 11:55 PM > To: Adrian Chadd > Cc: Ed Schouten; freebsd-mips@FreeBSD.org; FreeBSD-arch > Subject: Re: Kernelspace C11 atomics for MIPS >=20 > On Mon, Jun 3, 2013 at 7:45 PM, Adrian Chadd wrote: >=20 > > Speaking of this; any idea why the SYNC operators have 8 NOPs following > > them? > > > > I noticed that when going through disassemblies of various mips24k .o > > files. > > >=20 > To drain the pipeline on certain deficient (and mostly older) CPUs by way > of guesswork and a little vague magic. Most CPUs we support, I would > guess, do not need this, and it continues to exist solely for > hysterical reasons. >=20 > I've certainly gotten rid of them and some other cargo cult synchronizati= on > on Octeon for testing and had it survive under considerable load, and > occasionally with some slight speedups (for some more commonly-used or > slower things than Just a Bunch Of NOPs.) >=20 > The trouble is that proving they aren't necessary requires being rigorous > and careful in understanding documentation and errata, and FUD about thei= r > possible necessity is somewhat-intimidating. It's not an easy kind of > corruption/unreliability/etc., to prove the lack of empirically. The various CPU types are supposed to specify exactly how many NOPs are nee= ded, what kind of barrier is needed and where, and which type of NOP is nee= ded (Alpha had at least two). The barriers are designed to insure correct o= peration ordering across the memory architectures including write buffers, = DMA hardware, L1/L2[/L3] caches and their connections to the cores. The CPU= should specify exactly what is needed where, and why. It should never be "= superstition". There is an exact hardware reason for every sync/barrier ope= ration, and every NOP needed, just like the COP0 hazards. Given that, Juli's last paragraph is right on point. The documentation can = be dense and difficult to understand, since it's usually written by hardwar= e engineers :-) And since getting it wrong can make for some really subtle,= intermittent, and incredibly hard to diagnose problems, it's easier to err= on the side of caution. It also happens that different CPUs included in a = certain compile switch may have different requirements, so you have to use = worst case. >=20 > Juli. > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" >=20 .................................... Andrew L. Duane Resident Architect - AT&T Technical Lead m +1 603.770.7088 o +1 408.933.6944 (2-6944) skype: andrewlduane aduane@juniper.net