Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp446138pxb; Mon, 25 Oct 2021 11:21:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1pGiq29YsXtmujrBX+6o2jdZAMTeWAQf0Sx+nR84Iyi8OEq7VoO2iVt+bzwBpapMVw+Oo X-Received: by 2002:aa7:cd66:: with SMTP id ca6mr17825833edb.37.1635186078266; Mon, 25 Oct 2021 11:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635186078; cv=none; d=google.com; s=arc-20160816; b=YgvD2TWgtLAjnQUYYakJFWR3LJBRHd2hTyrSmE3WdAgax0wZVMtxMZDPsyxjqGbvRx LLT/a4AeVOgPjHVDl+LmkqRH7VzlGrHqI4QhyWtoadqY5S9N7VXlS+TBdHnQdJAAOVif n8AoK3UzH7p1RJQFyRJs+UrDqiiJgg8XKu58SkT2nbayOLjMIRlBYwHQ0QUf1dwEMM6u VkDTdpHBBeJugAxL8W19m0/5veGLYrNNjNQIhT1j8JDCmrHvWWJjsccNDLHg68zOEuK0 5fwK2eV/Oj/Hfwi7vFp5cvO4EguVxET/gbggqV5ZKQ8/EMFh9H9dzpseoKgOBbdKgVvN dCXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=+lhcq3mtoqVS+aHWU0W9BXR1xARM/S8unL7B46ETl5A=; b=Fz43OdgFTKxTWerQtYUVrzesBneqyG2wyIarR+IO9hS9xjGhNowcQAw0tbJ8ASdK2H cJFTlzlnUNlXgQrEgUnvWM7zeqCxa3teNWcC+BoueGR8VaUT3y5myZrPxicih8o7mvy9 1cGjLHtYtpiVowlJwxLIALvpwX1fp9lE9hcBiA0NCq5zOr48HTwPhN7SAAvRBTnrmbuT UMerFIqvES4asL8Qz2YMybcy6ctfLCQ0UlIKkHLdD00ydHKK86xNHtEBqA0uerSqqxe3 i9wydT2gJxQY4dQrQfInLNoiUUpR0EZ4PRjza15Rogjtl+6LfXR+tzYL5oiDT53RBmTS LCKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eubAxmKN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h9si34551680ede.393.2021.10.25.11.20.53; Mon, 25 Oct 2021 11:21:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eubAxmKN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233527AbhJYO5Z (ORCPT + 99 others); Mon, 25 Oct 2021 10:57:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233002AbhJYO5Y (ORCPT ); Mon, 25 Oct 2021 10:57:24 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CEE07C061745; Mon, 25 Oct 2021 07:55:01 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id v17so10549751qtp.1; Mon, 25 Oct 2021 07:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+lhcq3mtoqVS+aHWU0W9BXR1xARM/S8unL7B46ETl5A=; b=eubAxmKNf0HGfyvCVJaJcBGu3LC/0zm6EM5SL47XSI+2kMoZ5hYfDNgv5xKK7/llki CWYHSNa2kva472UlnrI1JLjqNvBQlbr42lpepor2zK3LX1ewz8rL1nchV6oq+gJKM6qz 8BijkyhohWnD5Dwj2rfTXBQwAC1+Uj2prtXaPD4aJFmIaJdvbAAdhx9jDeiOn1L1/tJh axHQvPqiNOeJwY75NqdDV+SsOagS5GOPnaO3Ro4O6RRLtiHGapmEoiMLtuCYEq+E6kW9 1tDztmMMF3Xn6Pyj2wqibMtVGwNFAswwUcIQLPRhVsSawGrjWSjhRf2WbfwaJ2qVXt+0 z+nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=+lhcq3mtoqVS+aHWU0W9BXR1xARM/S8unL7B46ETl5A=; b=VBwLaxYAwjD7nEu3rSVbktHiFOqaY8Go1i3cL60Mu86zElBaj3n8Yac6xHxRH/JJcT XGxHWpPM4JM+JPfmzWp/C7pXOBFmz+KQZ1EgGBlqENfK/ksWaqgghkYD22yBDCbcUV9Y kxjZ40o8Z4Xr0sJ2f2iLFHeW8RlQTZiI3yTQWp4JM2BRdfykyJ+6V4nCoMtIhlOoHLw5 zVOyLWuUDrZHmc0xebtlVLxN1rU+tlmoVhri67pzKbC5uNcMlxHsbc/f6B6w4QG38rRh PhrWcA4mQz4qt+6bskleryysNeeSmQf7AYN5BFXZWYhgJZSst/qAR0CmafGLn6caCArN OKvw== X-Gm-Message-State: AOAM531CfU8UmU5w9jKr1VD8cUXrEhzsiDQBiu2HvttJsyIDZRzq7Nf3 /+iWqp0E19hsrh7HBd3R+sk= X-Received: by 2002:ac8:42dd:: with SMTP id g29mr18193067qtm.168.1635173700971; Mon, 25 Oct 2021 07:55:00 -0700 (PDT) Received: from auth1-smtp.messagingengine.com (auth1-smtp.messagingengine.com. [66.111.4.227]) by smtp.gmail.com with ESMTPSA id n2sm9080420qtk.8.2021.10.25.07.54.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 07:55:00 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id A918A27C0054; Mon, 25 Oct 2021 10:54:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 25 Oct 2021 10:54:58 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdefhedgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne goufhorhhtvggutfgvtghiphdvucdlgedtmdenucfjughrpefhvffufffkofgggfestdek redtredttdenucfhrhhomhepuehoqhhunhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgse hgmhgrihhlrdgtohhmqeenucggtffrrghtthgvrhhnpeeiueevjeelheduteefveeflefg jeetfeehvdekudekgfegudeghfduhfetveejudenucffohhmrghinhepkhgvrhhnvghlrd horhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep sghoqhhunhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqieelvdeghedtie egqddujeejkeehheehvddqsghoqhhunhdrfhgvnhhgpeepghhmrghilhdrtghomhesfhhi gihmvgdrnhgrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 25 Oct 2021 10:54:55 -0400 (EDT) From: Boqun Feng To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org Cc: "Paul E . McKenney " , Dan Lustig , Will Deacon , Peter Zijlstra , Linus Torvalds , Alexander Shishkin , Peter Anvin , Andrea Parri , Ingo Molnar , Vince Weaver , Thomas Gleixner , Jiri Olsa , Arnaldo Carvalho de Melo , Stephane Eranian , palmer@dabbelt.com, paul.walmsley@sifive.com, mpe@ellerman.id.au, Jonathan Corbet , Boqun Feng Subject: [RFC v2 0/3] memory model: Make unlock(A)+lock(B) on the same CPU RCtso Date: Mon, 25 Oct 2021 22:54:13 +0800 Message-Id: <20211025145416.698183-1-boqun.feng@gmail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Just a new version trying to make forward progress on this ;-) v1: https://lore.kernel.org/lkml/20210930130823.2103688-1-boqun.feng@gmail.com/ Changes since v1: * Split the patch into three to help resolve the litmus test addition discussion. * Add some explanation in patch #2 on the requirement of tests in litmus-tests directory. To summarize the change in memory model, we now guarantee in the following code: spin_unlock(A); spin_lock(B); M is ordered against N unless M is a store and N is a load. More detailed examples of this guarantee can be found in patch #3. Architecture maintainers, appreciate it that you can take a look at patch #3 and rest of whole set to confirm this guarantee works on your architectures. Alan, I split the patchset into three patches because I do think we need some sort of patch #2 so that we can have consensus about whether merge patch #3 or not. I know you want to keep litmus-tests directory as simple as possible, but it won't hurt to document the requirement. Looking forwards to your thoughts ;-) Suggestion and comments are welcome! Regards, Boqun Boqun Feng (3): tools/memory-model: Provide extra ordering for unlock+lock pair on the same CPU tools/memory-model: doc: Describe the requirement of the litmus-tests directory tools/memory-model: litmus: Add two tests for unlock(A)+lock(B) ordering .../Documentation/explanation.txt | 44 +++++++++++-------- tools/memory-model/README | 12 +++++ tools/memory-model/linux-kernel.cat | 6 +-- ...LB+unlocklockonceonce+poacquireonce.litmus | 33 ++++++++++++++ ...unlocklockonceonce+fencermbonceonce.litmus | 33 ++++++++++++++ tools/memory-model/litmus-tests/README | 8 ++++ 6 files changed, 114 insertions(+), 22 deletions(-) create mode 100644 tools/memory-model/litmus-tests/LB+unlocklockonceonce+poacquireonce.litmus create mode 100644 tools/memory-model/litmus-tests/MP+unlocklockonceonce+fencermbonceonce.litmus -- 2.33.0