[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <727cbf48-0135-de6b-6d05-a6f8f7b4b853@huaweicloud.com>
Date: Fri, 25 Oct 2024 17:00:20 +0200
From: Hernan Ponce de Leon <hernan.poncedeleon@...weicloud.com>
To: Andrea Parri <parri.andrea@...il.com>
Cc: puranjay@...nel.org, paulmck@...nel.org, bpf@...r.kernel.org,
lkmm@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: Some observations (results) on BPF acquire and release
On 10/25/2024 4:27 PM, Andrea Parri wrote:
>> I am particularly interested in tests using lwarx and stwcx instructions
>> (this is what I understood would be used if one follows [1] to compile the
>> tests in this thread).
>>
>> I have not yet check the cambridge website, but due to the timeline, I don't
>> expect to find tests with those instructions. The same is true with [2].
>>
>> I have limited experience with diy7, but I remember that it had some
>> limitations to generate RMW instructions, at least for C [3].
>
> Oh, I'm sure there are, though I'd also not consider myself the 'expert'
> when it comes to diy7 internals. ;-) Here's an example use of diy7 /
> diyone7 generating lwarx and stwcx and reflecting the previous pattern:
>
> $ diyone7 -arch PPC LwSyncdWW Coe SyncdWRPA SyncdRRAP Fre
> PPC A
> "LwSyncdWW Coe SyncdWRNaA SyncdRRANa Fre"
> Generator=diyone7 (version 7.57+1)
> Prefetch=0:x=F,0:y=W,1:y=F,1:x=T
> Com=Co Fr
> Orig=LwSyncdWW Coe SyncdWRNaA SyncdRRANa Fre
> {
> 0:r2=x; 0:r4=y;
> 1:r2=y; 1:r3=z; 1:r6=x;
> }
> P0 | P1 ;
> li r1,1 | li r1,2 ;
> stw r1,0(r2) | stw r1,0(r2) ;
> lwsync | sync ;
> li r3,1 | Loop00: ;
> stw r3,0(r4) | lwarx r4,r0,r3 ;
> | stwcx. r4,r0,r3 ;
> | bne Loop00 ;
> | sync ;
> | lwz r5,0(r6) ;
> exists ([y]=2 /\ 1:r5=0)
That is exactly what I was looking for. Thanks Andrea!
Hernan
>
> But again, I'd probably have to defer to proper herdtools7 developers
> and maintainers for any diy7 bug or misbehavior you'd have to discover.
>
> Andrea
>
>
>>
>> Hernan
>>
>> [1] https://github.com/torvalds/linux/blob/master/arch/powerpc/net/bpf_jit_comp32.c
>> [2] https://github.com/herd/herdtools7/tree/master/catalogue/herding-cats/ppc/tests/campaign
>> [3] https://github.com/herd/herdtools7/issues/905
>>
Powered by blists - more mailing lists