Received: by 2002:a89:2d5:0:b0:1ef:f8eb:5d24 with SMTP id d21csp67247lqs; Sun, 17 Mar 2024 10:48:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWVLJcmnaT5RrHz8GlzageFLPKhXJzMjCLfSLB0+Z1IFzq8jxMZO2Xw1CV3L7L5XO5AgTp5zYA8LjqkWmNQjAwAvu5J3F3Su0eG3HckEw== X-Google-Smtp-Source: AGHT+IElNd9EXrkwoJCg4zJg3UAk8zWIcPt09S7+s7prbz5ZcYu2hYYInmo5WqN8BJ4oVH31fGdd X-Received: by 2002:a05:6214:972:b0:690:c73a:db09 with SMTP id do18-20020a056214097200b00690c73adb09mr10015446qvb.24.1710697688127; Sun, 17 Mar 2024 10:48:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710697688; cv=pass; d=google.com; s=arc-20160816; b=mVx0tfKtQmNva8B5FELcEUmjvyMBXxVmAYpfPRPzEJlunpVm0ogvD17AwvVKiIad4O H2U9uZNS6aflJ71KeyxjG0C+qVVrNEHzOrCQoHGCB2vpiOCcyn916ny91hj83gNxE2Ch /O1Mtv7ZipDBJdZM6yDiMjSz7mO8r7Axr0JuiQ5vh32Ah6mUKcYAQjdIsbhs64V2J08Z VjA5u9BriwgyqOZjsSzTTpuewcOqISbP/nDp+pw2WIODIATljKdLAvNJDh/JAC2gAaNz Lb6mwkD9X2vw7zWRf2OU4HmY3H2MD3SEt7NdidpZfwkAiVexTt6KOCNL81Fo6HA+gBbc nbSg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:date:message-id:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:content-transfer-encoding:from :dkim-signature; bh=/nUQ6ib1+zRvwxKYZbx2Zz20+PnydyUeEfxBg3tXRtk=; fh=5WtW8XML8xXyOA+LfsQOxRWOesV34sgMZ5sBuU5Cckc=; b=hlfxgIrPQTQUbvCLT+2dpvEXHwN3LTb5dmkAEGfc2OI5FRlL23k2bo8F/DXGJ7HXyE HI6pewO+1u/RjwT60EnuwucSrN5LtVsAIg2iWNZZhpYLajsbfl7zg932KiIz0HWMe16b s2LblixUg+NGlvi51qFnXYbUyBleX3DEOl2CeZRplegIddIEPHM7nCcBrD+s2TenZXHm PaB7nbOCgAwDJ24m3M1yv1PbM3MysdD3IXHULn9UX1dv1UACW8gO0YBrupIP0q3iqXW9 pU9gGaDmF/ltk5qtMxh8cjCjx7BD8ijtMdRoOoYiiFU6kFKA6LaHIIGor5flDlfLmPy4 5Hgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=CErTCt+h; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-105485-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105485-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c3-20020ad45ae3000000b006960f8a6024si1703210qvh.361.2024.03.17.10.48.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Mar 2024 10:48:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105485-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=CErTCt+h; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-105485-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105485-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D3E3E1C20A87 for ; Sun, 17 Mar 2024 17:48:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D2AD91CF9B; Sun, 17 Mar 2024 17:48:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CErTCt+h" Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3B551CD3C; Sun, 17 Mar 2024 17:47:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710697681; cv=none; b=mUBl/GrCLWCQTcm/tPRaoKY8GW9a5/v9Ua/Z3PD4tlJsuewGuKiJjhoMwhqF9fe6bzY4tuzD5PHfariBFIU84opiW9MuvkPit+RB4ChH7o53hicXgzMmnke9dh6AtKcKA/v04MghYGB2U45I7jjh2SSpjUtkF+oezuhUeMXvahU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710697681; c=relaxed/simple; bh=iFgr+b97KAvPfCR6ghGNye2kCkDZc+J9IWrRuv7n9io=; h=From:Content-Type:Mime-Version:Subject:Message-Id:Date:To; b=Vh/R2Ki3QE9JVabIEWPEUayZ1Vu58t3/Nms0AxSkSZu307++WB2Q4IyG9A9Ndz96ZO10lfoBi1it/44R/8WgqZHyVbtpxuKllCw7cED8Orus9gh7LmzPNWZ1mKR6lZ8iHvG5y4niFe5D136N8S/nc9POcti7Pno6iHHVNwHNE1E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CErTCt+h; arc=none smtp.client-ip=209.85.167.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-3c37970b52aso1472491b6e.0; Sun, 17 Mar 2024 10:47:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710697678; x=1711302478; darn=vger.kernel.org; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=/nUQ6ib1+zRvwxKYZbx2Zz20+PnydyUeEfxBg3tXRtk=; b=CErTCt+hFtHB4HKizyA9CHMXN6cONeSohumsxv8EumhoK24/jESl1f2u15CMZcckn+ S0NUePM9tGz3kgAJlFPBtUpNuPjqGGwRb1HP//C4j1gLze5V5jRk80RXPFb1ZhGr637f lpL6WNwfUGbeOczo4zXFnkpXKPc78Gjqs/TK/K5Hq66xhmFSCcgQ/JTKhB/OyXk3s3cN 2dncy84c7fbILGSLNXNETPGEkx9fWbK6ef28Er2yBGvK75BxcWsrmLvu3O89Gk+6vpIa 4Wf6Bj03HPXWcg4kpmgfiRzyt63VGw9F6qWUJoNVi/aQI6Ybbubyfeuw/UbhDglz4DDU EYZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710697678; x=1711302478; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/nUQ6ib1+zRvwxKYZbx2Zz20+PnydyUeEfxBg3tXRtk=; b=LO11AQlWJh4+wZ1lEdjWxW1GRez1UWDgz9RrGWSlFfJPDTt0wJGJKRjrgbAt9Wm7so SCgjaqLTmJ2tqA/m+kasiUQ2cnL4XcSZDSpDoZ3cwv+WumF3mztXFObgvROc3w94XSQO GXYVL/b88s4bhSCHOn5jaMIx0GwejGKyPq/+oB0yn+/wJoBQnvnPqCr8dw+btGZewI0i Fn4HZ+2kTkZYpVSVWp5UbVeJjZMTvw0rxsJUd7Ujmt/51KJozVd1iGwHGPgWK+BjGmqM D/aO6XGuVmbCI6zmWBoo8JGzJlHKcG5i5TCl9rhXGe8pek4qhQfqE6KdBHlIJ9M9peJc xZ2A== X-Forwarded-Encrypted: i=1; AJvYcCXRBTJ4rzJqdssCthT/cUby4k14kt9DZaTakjPqa2MxadJJSgMzmwDXYQOkZ3avnjn8vJA0bUOqXmGl0i07W1W/rUSRbZRJhp7WOeJ160v8jCUXw2sOrSwTxSjO9W4/qA== X-Gm-Message-State: AOJu0YwJYCwMkZxfuDrdcQOKS7GUVWiFEl2dzfFsPNx+pxyoFP4QV0o3 q8krcDHz+Ng5PWjV4pvZzIU3Owsbvh4BBjPQsU4+87zL1PqVfxOyShbPbbgeMNQ= X-Received: by 2002:a05:6871:60e:b0:220:be2c:6083 with SMTP id w14-20020a056871060e00b00220be2c6083mr12261987oan.49.1710697678171; Sun, 17 Mar 2024 10:47:58 -0700 (PDT) Received: from smtpclient.apple ([2402:d0c0:11:86::1]) by smtp.gmail.com with ESMTPSA id u22-20020a62d456000000b006e6c10fc87fsm6730122pfl.46.2024.03.17.10.47.56 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Mar 2024 10:47:57 -0700 (PDT) From: Alan Huang Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Subject: Question about ISA2+pooncelock+pooncelock+pombonce litmus Message-Id: <12E5C279-ADB1-463E-83E2-0A4F5D193754@gmail.com> Date: Mon, 18 Mar 2024 01:47:43 +0800 To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, rcu@vger.kernel.org X-Mailer: Apple Mail (2.3774.300.61.1.2) Hi, I=E2=80=99m playing with the LKMM, then I saw the = ISA2+pooncelock+pooncelock+pombonce. The original litmus is as follows: ------------------------------------------------------ P0(int *x, int *y, spinlock_t *mylock) { spin_lock(mylock); WRITE_ONCE(*x, 1); WRITE_ONCE(*y, 1); spin_unlock(mylock); } P1(int *y, int *z, spinlock_t *mylock) { int r0; spin_lock(mylock); r0 =3D READ_ONCE(*y); WRITE_ONCE(*z, 1); spin_unlock(mylock); } P2(int *x, int *z) { int r1; int r2; r2 =3D READ_ONCE(*z); smp_mb(); r1 =3D READ_ONCE(*x); } exists (1:r0=3D1 /\ 2:r2=3D1 /\ 2:r1=3D0) ------------------------------------------------------ Of course, the result is Never.=20 But when I delete P0=E2=80=99s spin_lock and P1=E2=80=99s spin_unlock: ------------------------------------------------------- P0(int *x, int *y, spinlock_t *mylock) { WRITE_ONCE(*x, 1); WRITE_ONCE(*y, 1); spin_unlock(mylock); } P1(int *y, int *z, spinlock_t *mylock) { int r0; spin_lock(mylock); r0 =3D READ_ONCE(*y); WRITE_ONCE(*z, 1); } P2(int *x, int *z) { int r1; int r2; r2 =3D READ_ONCE(*z); smp_mb(); r1 =3D READ_ONCE(*x); } exists (1:r0=3D1 /\ 2:r2=3D1 /\ 2:r1=3D0) ------------------------------------------------------ Then herd told me the result is Sometimes. Is this expected?=20