Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: jseigh Newsgroups: comp.arch Subject: Re: arm ldxr/stxr vs cas Date: Thu, 5 Sep 2024 07:33:23 -0400 Organization: A noiseless patient Spider Lines: 33 Message-ID: References: <07d60bd0a63b903820013ae60792fb7a@www.novabbs.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 05 Sep 2024 13:33:23 +0200 (CEST) Injection-Info: dont-email.me; posting-host="b906cc1d9c010c5924a8284161c2d580"; logging-data="347324"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WypFCU5+IvkP/DsqFphjA" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:GeVKTPIYImn65JwO+fqHoNuow3Q= In-Reply-To: <07d60bd0a63b903820013ae60792fb7a@www.novabbs.org> Content-Language: en-US Bytes: 2409 On 9/4/2024 5:27 PM, MitchAlsup1 wrote: > On Mon, 2 Sep 2024 17:27:57 +0000, jseigh wrote: > >> I read that arm added the cas instruction because they didn't think >> ldxr/stxr would scale well.  It wasn't clear to me as to why that >> would be the case.  I would think the memory lock mechanism would >> have really low overhead vs cas having to do an interlocked load >> and store.  Unless maybe the memory lock size might be large >> enough to cause false sharing issues.  Any ideas? > > A pipeline lock between the LD part of a CAS and the ST part of a > CAS is essentially FREE. But the same is true for LL followed by > a later SC. > > Older machines with looser than sequential consistency memory models > and running OoO have a myriad of problems with LL - SC. This is > why My 66000 architecture switches from causal consistency to > sequential consistency when it encounters LL and > switches bac after seeing SC. > > No Fences necessary with causal consistency. > I'm not sure I entirely follow. I was thinking of the effects on cache. In theory the SC could fail without having get the current cache line exclusive or at all. CAS has to get it exclusive before it can definitively fail. Whenever they get around to making arm desktops without the OS tax so I can install linux I can compare the 2. Joe Seigh