mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonas Oberhauser <jonas.oberhauser@huaweicloud.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: paulmck@kernel.org, parri.andrea@gmail.com, will@kernel.org,
	peterz@infradead.org, boqun.feng@gmail.com, npiggin@gmail.com,
	dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr,
	akiyks@gmail.com, dlustig@nvidia.com, joel@joelfernandes.org,
	urezki@gmail.com, quic_neeraju@quicinc.com, frederic@kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCHv2 0/4] tools/memory-model: Define more of LKMM in tools/memory-model
Date: Wed, 5 Jun 2024 21:58:42 +0200	[thread overview]
Message-ID: <bbc3bd10-3bf5-4b1a-a275-dd328c42e307@huaweicloud.com> (raw)
In-Reply-To: <88c1ebc8-4805-4d1d-868a-889043899979@rowland.harvard.edu>



Am 6/4/2024 um 7:56 PM schrieb Alan Stern:
> On Tue, Jun 04, 2024 at 05:29:18PM +0200, Jonas Oberhauser wrote:
>> Currently, the effect of several tag on operations is defined only in
>> the herd7 tool's OCaml code as syntax transformations, while the effect
>> of all other tags is defined in tools/memory-model.
>> This asymmetry means that two seemingly analogous definitions in
>> tools/memory-model behave quite differently because the generated
>> representation is sometimes modified by hardcoded behavior in herd7.
>>
>> It also makes it hard to see that the behavior of the formalization
>> matches the intuition described in explanation.txt without delving into
>> the implementation of herd7.
>>
>> Furthermore, this hardcoded behavior is hard to maintain inside herd7 and
>> other tools implementing WMM, and has caused several bugs and confusions
>> with the tool maintainers, e.g.:
>>
>>    https://github.com/MPI-SWS/genmc/issues/22
>>    https://github.com/herd/herdtools7/issues/384#issuecomment-1132859904
>>    https://github.com/hernanponcedeleon/Dat3M/issues/254
>>
>> It also means that potential future extensions of LKMM with new tags may
>> not work without changing internals of the herd7 tool.
>>
>> In this patch series, we first emulate the effect of herd7 transformations
>> in tools/memory-model through explicit rules in .cat and .bell files that
>> reference the transformed tags.
>> These transformations do not have any immediate effect with the current
>> herd7 implementation, because they apply after the syntax transformations
>> have already modified those tags.
>>
>> In a second step, we then distinguish between syntactic tags (that are
>> placed by the programmer on operations, e.g., an 'ACQUIRE tag on both the
>> read and write of an xchg_acquire() operation) and sets of events (that
>> would be defined after the (emulated) transformations, e.g., an Acquire
>> set that includes only on the read of the xchg_acquire(), but "has been
>> removed" from the write).
>>
>> This second step is incompatible with the current herd7 implementation,
>> since herd7 uses hardcoded tag names to decide what to do with LKMM;
>> therefore, the newly introduced syntactic tags will be ignored or
>> processed incorrectly by herd7.
> 
> The patches look good to me.
> 
> Just to clarify: Your first step encompasses patches 1 - 3, and the
> second step is patch 4.  The first three patches can be applied now, but
> the last one needs to wait until herd7 has been updated.  Is this all
> correct?

Exactly.


  reply	other threads:[~2024-06-05 19:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-04 15:29 Jonas Oberhauser
2024-06-04 16:00 ` [PATCHv2 1/4] tools/memory-model: Legitimize current use of tags in LKMM macros Jonas Oberhauser
2024-06-04 16:04 ` [PATCHv2 2/4] tools/memory-model: Define applicable tags on operation in tools/ Jonas Oberhauser
2024-06-05  4:25   ` Boqun Feng
2024-06-05  9:54     ` Jonas Oberhauser
2024-06-04 16:04 ` [PATCHv2 3/4] tools/memory-model: Define effect of Mb tags on RMWs " Jonas Oberhauser
2024-06-05  4:28   ` Boqun Feng
2024-06-05 13:40     ` Alan Stern
2024-06-05 19:56     ` Jonas Oberhauser
2024-06-17 22:43       ` Boqun Feng
2024-06-04 16:05 ` [PATCHv2 4/4] tools/memory-model: Distinguish between syntactic and semantic tags Jonas Oberhauser
2024-06-04 17:56 ` [PATCHv2 0/4] tools/memory-model: Define more of LKMM in tools/memory-model Alan Stern
2024-06-05 19:58   ` Jonas Oberhauser [this message]
2024-06-06 16:37     ` Paul E. McKenney
2024-06-10  8:04       ` Jonas Oberhauser
2024-06-10 15:21         ` Paul E. McKenney
2024-06-08  1:00     ` Alan Stern
2024-06-10  8:38       ` Hernan Ponce de Leon
2024-07-12  8:06         ` Hernan Ponce de Leon
2024-07-29 13:30           ` Hernan Ponce de Leon
2024-07-29 14:45             ` Jonas Oberhauser
2024-07-29 15:19               ` Hernan Ponce de Leon
2024-07-29 15:44                 ` Jonas Oberhauser
2024-07-29 15:53                   ` Hernan Ponce de Leon
2024-07-29 16:05                     ` Jonas Oberhauser
2024-06-10  9:08       ` Jonas Oberhauser

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=bbc3bd10-3bf5-4b1a-a275-dd328c42e307@huaweicloud.com \
    --to=jonas.oberhauser@huaweicloud.com \
    --cc=akiyks@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=dlustig@nvidia.com \
    --cc=frederic@kernel.org \
    --cc=j.alglave@ucl.ac.uk \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.maranget@inria.fr \
    --cc=npiggin@gmail.com \
    --cc=parri.andrea@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=quic_neeraju@quicinc.com \
    --cc=stern@rowland.harvard.edu \
    --cc=urezki@gmail.com \
    --cc=will@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

all inboxes | Powered by JetHome®