lkmm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Hernan Ponce de Leon <hernan.poncedeleon@huaweicloud.com>
To: Andrea Parri <parri.andrea@gmail.com>
Cc: puranjay@kernel.org, paulmck@kernel.org, bpf@vger.kernel.org,
	lkmm@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: Some observations (results) on BPF acquire and release
Date: Fri, 25 Oct 2024 17:00:20 +0200	[thread overview]
Message-ID: <727cbf48-0135-de6b-6d05-a6f8f7b4b853@huaweicloud.com> (raw)
In-Reply-To: <Zxuq2Zvpn7ap4ZR5@andrea>

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
>>


  reply	other threads:[~2024-10-25 15:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-23 17:47 Some observations (results) on BPF acquire and release Andrea Parri
2024-10-24  4:25 ` Paul E. McKenney
2024-10-24 11:13   ` Andrea Parri
2024-10-25 13:56     ` Andrea Parri
2024-11-13 19:25       ` Andrea Parri
2024-11-13 22:59         ` Puranjay Mohan
2024-11-14 14:56           ` Andrea Parri
2024-10-24 11:44 ` Jonas Oberhauser
2024-10-24 12:11   ` Puranjay Mohan
2024-10-24 12:21     ` Jonas Oberhauser
2024-10-24 14:42       ` Paul E. McKenney
2024-10-25  9:32 ` Hernan Ponce de Leon
2024-10-25 13:15   ` Andrea Parri
2024-10-25 13:28     ` Hernan Ponce de Leon
2024-10-25 13:44       ` Andrea Parri
2024-10-25 13:57         ` Hernan Ponce de Leon
2024-10-25 14:27           ` Andrea Parri
2024-10-25 15:00             ` Hernan Ponce de Leon [this message]
2024-10-25 23:26           ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=727cbf48-0135-de6b-6d05-a6f8f7b4b853@huaweicloud.com \
    --to=hernan.poncedeleon@huaweicloud.com \
    --cc=bpf@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkmm@lists.linux.dev \
    --cc=parri.andrea@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=puranjay@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).