[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ea6a8150-aaaa-4108-af8b-fb5088e25016@huaweicloud.com>
Date: Tue, 7 Jan 2025 12:02:38 +0100
From: Jonas Oberhauser <jonas.oberhauser@...weicloud.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: paulmck@...nel.org, stern@...land.harvard.edu, parri.andrea@...il.com,
will@...nel.org, boqun.feng@...il.com, npiggin@...il.com,
dhowells@...hat.com, j.alglave@....ac.uk, luc.maranget@...ia.fr,
akiyks@...il.com, dlustig@...dia.com, joel@...lfernandes.org,
urezki@...il.com, quic_neeraju@...cinc.com, frederic@...nel.org,
linux-kernel@...r.kernel.org, lkmm@...ts.linux.dev,
hernan.poncedeleon@...weicloud.com
Subject: Re: [RFC] tools/memory-model: Rule out OOTA
Am 1/7/2025 um 11:06 AM schrieb Peter Zijlstra:
> On Mon, Jan 06, 2025 at 10:40:03PM +0100, Jonas Oberhauser wrote:
>
>> We first discuss why the more standard definition does not work well for
>> language models like LKMM. For example, consider
>>
>> r1 = *a;
>> *b = 1;
>> if (*a == 1)
>
> if (r1 == 1)
>
> ?
>
>> *b = 1;
>> *c = *b;
>>
>> In the execution where r1 == 1, there is a control dependency from
>> the load of *a to the second store to *b, from which the load to *b reads,
>> and the store to *c has a data dependency on this load from *b. Nevertheless
>> there is no semantic dependency from the load of *a to the store to *c; the
>> compiler could easily replace the last line with *c = 1 and move this line to
>> the top as follows:
>>
>> *c = 1;
>> r1 = *a;
>> *b = 1;
>>
>> Since there is no order imposed by this sequence of syntactic dependencies
>> and reads, syntactic dependencies can not by themselves form an acyclic
>> relation.
>>
>> In turn, there are some sequences of syntactic dependencies and reads that do
>> form semantic dependencies, such as
>>
>> r1 = *a;
>> *b = 2;
>> if (*a == 1)
>
> r1 again?
>
>> *b = 1;
>> *c = *b;
>>
>> Here we would consider that the store to *c has a semantic data dependency on
>> the read from *a, given that depending on the result of that read, we store
>> either the value 1 or 2 to *c.
Yes on both counts, thanks!
jonas
Powered by blists - more mailing lists