Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6506487rwn; Tue, 13 Sep 2022 05:24:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR5MsW2z95JQT9JPKxfij70OhcBrFfLx4duy0f5UQG5v01qejdSDbqpnd2hmx/z219i8EB+y X-Received: by 2002:a17:903:11c9:b0:172:6ea1:b727 with SMTP id q9-20020a17090311c900b001726ea1b727mr31567010plh.78.1663071850258; Tue, 13 Sep 2022 05:24:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663071850; cv=pass; d=google.com; s=arc-20160816; b=mdLKXv7bunI1UQuL1WQMGT7RxjRqWG/i1dASyjZwIqw7Fsr8hAv8rPcLpHztZrTFvp SCaeQD6yttpb4eoCEcvMRQJxnCiuAncbQnr4a+1JS8qvYAOrJyKPeN6E3ikK+dkjLJA0 8BRGAiAy6ZPvNi9+3gjgN1ta5zvqvq0m5dABymCIEX6NwwjE/3ZUaRZWpWyuBoJbuFSd XoNROLgFs98BGmVqMbRZsLX/I2mmoRjkxR5X/iDALfred4Pjx1Mdny9CHDAf/NeIwuTg JIukbBV//QZLDNVaL7T0AVV2zOHFV/oL+Cz/GNuiQNeWovhXAqJ2wPE9M6kdv6QjW6w9 i1IA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=3TtMl/a0EKCOXIeIHU2V22xEwbiagDH43GtTHvmPq4w=; b=vXZuAI7IGfomaGKR97pZGNd6fV+Q9qPSq2vwTMwe+5xKLCXXr09OANaRaVDbbYgxAl e7+CiWqrLeeoIP8emmSDqyp+GLYKgfC+kIwyYmfPdI6O/pZSKt8oYxo+qQSGqJDB0Awt IoeMkhAzrJftmBtTXEi/XL/Lv5Rbx1dkjcGTJsCp7rBJ8gPs5Vtx7ZEI4O3TXsLw2YEG MoFqjiWuxvgEz3n19FLUXyPwnz08HpasmyGxJZQ53bnhKaYNmVsO/i4iheaN2Npt2941 eB474+wiSkpHo4QGExXLy6kehxSXEHwADlryYlCj3exZrd0NZ8gpdC2MANe6eHTG5lec gwEQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=lU5yyi6+; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 207-20020a6301d8000000b00438efb8072asi6820257pgb.339.2022.09.13.05.23.58; Tue, 13 Sep 2022 05:24:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=lU5yyi6+; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231447AbiIMMVR (ORCPT + 99 others); Tue, 13 Sep 2022 08:21:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229876AbiIMMVO (ORCPT ); Tue, 13 Sep 2022 08:21:14 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2068.outbound.protection.outlook.com [40.107.223.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 554532C647; Tue, 13 Sep 2022 05:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GEHfI3iE+w2VkYhq7p+U/zUOMjdW3pRbeFpy3d5zsg3+vzttvWPBsbxD7vkdMnixF2/odEecqPsdnpQV4+Jyo8ceowZ79ifHp0VIOvHbvHwZ9vCgw1Z+B4glA+xlluaRgERARm9zufQOP4wZcmqlN775NQQSMBfzpiJrqt9YDOit9GaaH06t2SHzyOnMF0hCu/CKa+f2D8UBcf8IVGG3Sy+PbxA1H5Z8YZUnTtOMRRh9gwv8bEJS7tb2L4h1DrMGTK3b1IecqYJqGZ0cgukUm11+yis+2ilb/W3cHpRHdbkXjRDT59v2kEvSudwQca7kkSIQuMPEdLiZ0KPLvbn5gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3TtMl/a0EKCOXIeIHU2V22xEwbiagDH43GtTHvmPq4w=; b=jy2ywbNQY4LFCRA8b/cM41Sgznwl7y7Ovm9ccEzB5HbCRTz9Rs7PNhd1iYz2RFbI6EDKG1N0SU0qnA0UXOQIEuWsQ0O9HTiNNjLYBYDkahChGNWZhonVrmBr7MP55k8BmQV7f6JfdJlNh5U3oZrfNK55WxUlbf8aSG847nGIaiqt3W2JvCtxkhNOt2ZM7bwV6EBeJjXg67yk0pthddlDWT1EQW9oTjhUryM7i5V360oCI/DWTb/ngIlP4yLnP89ux69pHi+NJr6pqwijaq7SKRoYOL42GBxigQ9nayNpM8OEJ4/c0QIDLLdrK1mSm57yKb3LpewAM0F7M4475uutZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3TtMl/a0EKCOXIeIHU2V22xEwbiagDH43GtTHvmPq4w=; b=lU5yyi6+dqrlKepaGamcF/SFDXYIYcrRPb2rLHj2ac/7MnmUO3obriPIdXN1b0h9ruflbmDNd/TIieacicb03M4HSUpYmVKVYaeqeEmAdRrIC6bmf0W6+Ndgcusci47sbFt3hB+yEB4TQ8Wy/omYHV1taWLT50efxU1+PlxJgg5is7EKcRf/2sOm5obc20tDOeLS5Cxkv6PDxzSijkzvkyeVcR8PE7iFHImbtst7uo3T8UH+d15ahV4WNMeRjJ6moKfN/Da0WuLrzOo4erKrl6/1R8kh/2AL/vq5fOQgX8zP87KSBlkWNlEn6VxN9mSqfdrky3faALion0DZklfzog== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BYAPR12MB3432.namprd12.prod.outlook.com (2603:10b6:a03:ac::22) by LV2PR12MB5749.namprd12.prod.outlook.com (2603:10b6:408:17f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Tue, 13 Sep 2022 12:21:09 +0000 Received: from BYAPR12MB3432.namprd12.prod.outlook.com ([fe80::99b2:edac:3ee3:64bc]) by BYAPR12MB3432.namprd12.prod.outlook.com ([fe80::99b2:edac:3ee3:64bc%5]) with mapi id 15.20.5588.012; Tue, 13 Sep 2022 12:21:09 +0000 Message-ID: Date: Tue, 13 Sep 2022 08:21:02 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: "Verifying and Optimizing Compact NUMA-Aware Locks on Weak Memory Models" Content-Language: en-US To: Will Deacon , "Paul E. McKenney" Cc: Alan Stern , Peter Zijlstra , parri.andrea@gmail.com, boqun.feng@gmail.com, npiggin@gmail.com, dhowells@redhat.com, j.alglave@ucl.ac.uk, luc.maranget@inria.fr, akiyks@gmail.com, joel@joelfernandes.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org References: <20220826124812.GA3007435@paulmck-ThinkPad-P17-Gen-1> <20220826204219.GX6159@paulmck-ThinkPad-P17-Gen-1> <20220913112416.GC3752@willie-the-truck> From: Dan Lustig In-Reply-To: <20220913112416.GC3752@willie-the-truck> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: MN2PR10CA0009.namprd10.prod.outlook.com (2603:10b6:208:120::22) To BYAPR12MB3432.namprd12.prod.outlook.com (2603:10b6:a03:ac::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1f5651c2-45e9-471f-4f1e-08da95827034 X-MS-TrafficTypeDiagnostic: LV2PR12MB5749:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dOcg1XkfBPLYM9fAy57+FS8T1W+L7JOVAjk9qtdoO3oFN5GBlaLxKP2OuTxJhcCfcpSdUSJeicEpiEPvBze23DH3pNLKI/in9kz7vTIxZVrGpAl+vRJVoxpL2b5Cv2N/Euy9TrDegygWGOS+b6aes3yTvKuIUPG5xPqs46nUjEE7kT2NnplpUFIVK+S8ytAki9sqcPe8iHVbSwm+9wnLpEnxHzfBac9CrORSpIn4oK20I08DphmchXmWe6+3qoS+CmINJUoq9d8o2SM9/Kj/dF0c1T/0x32nNMRMh7CQ203EJi13gHA8+YcTTYv7w1fAd0zDowpv2+/8yan8Y2xLUfDbQXiWlXerkptl5oDTIVlNABJHWnmQRyUdkgHEMW8HW+aYCAqAX2QL8y7XvO4xMq5CxVNtZSb3RcVVD70MgZthPuvudLJwyngpLufQX1Bl40nHmEL014c4ELdmkddRXr1/mCbCofxT64oj2DCYxjZY1vi2MV+8tgtAYusqmSzNLmraz4O/l47y+Wx7JdwKiSB4oLfd7sLR92NJC77OBqrlmMxaztCOD5jLCxcZBE8i+rL5UJa3lrdYmyAk/4R10WWD8nTdIla/i7E3TvkI5nuBcdsuCorZCguSaL7nKjrY8TmbG8H3VWmADtsWSDbicmTJeeHOMoZuZL7J1T5gCGoJFHxPauLYsAR4UBR5sdN6pDJEkaQM9XUFL2hf9u5xfRegjpqfJm6HgM4smJwmSFtMpWWRHZvymospEfdtsAf1ZhBhhIXAPB3Kw9mzADeQvlZfpIEhOcbjygpDESv038hdXD3jBDS+P4FhWp/AdQu0PIAnhYZ3ATCGvpGC4J+RBJbuDtGGedhiouWVF6aARF9TNK9MCuZa6JLI8aWJAqBt X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR12MB3432.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(396003)(346002)(376002)(366004)(136003)(39860400002)(451199015)(186003)(2616005)(66574015)(6512007)(26005)(53546011)(36756003)(15650500001)(316002)(8936002)(66556008)(6506007)(6666004)(5660300002)(478600001)(966005)(6486002)(110136005)(86362001)(31686004)(38100700002)(66946007)(41300700001)(66476007)(83380400001)(4326008)(2906002)(7416002)(54906003)(31696002)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VEkvTTR0ZXlwTlhLWWhsUGVOYzhYUkFNa0pDVjdqY21CdXdWQ0RhZ2VJem5W?= =?utf-8?B?Nk14eVNuOTRWcUNQOGt0MEtyVWE5SUpGMnVrSjNwMlkrYkR4bTlCbVpFVlFx?= =?utf-8?B?d1d5cm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pMEUwZXpDT2cza1ZIVGhmRlZz?= =?utf-8?B?Q3p3aytrai9BanJZcER4OW9nOG5Fd1ZySVFTeUpSbnJMdjlPMldXSllOZ3g5?= =?utf-8?B?T2ZKQ1NBNFdxSEVqYlNCZFdqc2VGV0YwUzFTcjYrZUdzQ1JkZGlpQkF3ZzJQ?= =?utf-8?B?WFBPRExjS2NESWR4WUkzdmtWbWtEWHpQc1ZJY3R4VllFSXA1bSt5MEs3RGs0?= =?utf-8?Q?Z/KWO+wWwtjOa5r9qN/B/TejT?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f5651c2-45e9-471f-4f1e-08da95827034 X-MS-Exchange-CrossTenant-AuthSource: BYAPR12MB3432.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2022 12:21:08.9609 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EQ8ofEUABn8prQaeRszDrd3TasIawRWXuYCSOMKr+35MTw6aLeLwUoUIFZHO09Zn4qneNz7kug5rmJq88zm7UA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5749 X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/13/2022 7:24 AM, Will Deacon wrote: > On Fri, Aug 26, 2022 at 01:42:19PM -0700, Paul E. McKenney wrote: >> On Fri, Aug 26, 2022 at 01:10:39PM -0400, Alan Stern wrote: >>> On Fri, Aug 26, 2022 at 06:23:24PM +0200, Peter Zijlstra wrote: >>>> On Fri, Aug 26, 2022 at 05:48:12AM -0700, Paul E. McKenney wrote: >>>>> Hello! >>>>> >>>>> I have not yet done more than glance at this one, but figured I should >>>>> send it along sooner rather than later. >>>>> >>>>> "Verifying and Optimizing Compact NUMA-Aware Locks on Weak >>>>> Memory Models", Antonio Paolillo, Hernán Ponce-de-León, Thomas >>>>> Haas, Diogo Behrens, Rafael Chehab, Ming Fu, and Roland Meyer. >>>>> https://arxiv.org/abs/2111.15240 >>>>> >>>>> The claim is that the queued spinlocks implementation with CNA violates >>>>> LKMM but actually works on all architectures having a formal hardware >>>>> memory model. >>>>> >>>>> Thoughts? >>>> >>>> So the paper mentions the following defects: >>>> >>>> - LKMM doesn't carry a release-acquire chain across a relaxed op >>> >>> That's right, although I'm not so sure this should be considered a >>> defect... >>> >>>> - some babbling about a missing propagation -- ISTR Linux if stuffed >>>> full of them, specifically we require stores to auto propagate >>>> without help from barriers >>> >>> Not a missing propagation; a late one. >>> >>> Don't understand what you mean by "auto propagate without help from >>> barriers". >>> >>>> - some handoff that is CNA specific and I've not looked too hard at >>>> presently. >>>> >>>> >>>> I think we should address that first one in LKMM, it seems very weird to >>>> me a RmW would break the chain like that. >>> >>> An explicitly relaxed RMW (atomic_cmpxchg_relaxed(), to be precise). >>> >>> If the authors wanted to keep the release-acquire chain intact, why not >>> use a cmpxchg version that has release semantics instead of going out of >>> their way to use a relaxed version? >>> >>> To put it another way, RMW accesses and release-acquire accesses are >>> unrelated concepts. You can have one without the other (in principle, >>> anyway). So a relaxed RMW is just as capable of breaking a >>> release-acquire chain as any other relaxed operation is. >>> >>>> Is there actual hardware that >>>> doesn't behave? >>> >>> Not as far as I know, although that isn't very far. Certainly an >>> other-multicopy-atomic architecture would make the litmus test succeed. >>> But the LKMM does not require other-multicopy-atomicity. >> >> My first attempt with ppcmem suggests that powerpc does -not- behave >> this way. But that surprises me, just on general principles. Most likely >> I blew the litmus test shown below. >> >> Thoughts? >> >> Thanx, Paul >> >> ------------------------------------------------------------------------ >> >> PPC MP+lwsyncs+atomic >> "LwSyncdWW Rfe LwSyncdRR Fre" >> Cycle=Rfe LwSyncdRR Fre LwSyncdWW >> { >> 0:r2=x; 0:r4=y; >> 1:r2=y; 1:r5=2; >> 2:r2=y; 2:r4=x; >> } >> P0 | P1 | P2 ; >> li r1,1 | lwarx r1,r0,r2 | lwz r1,0(r2) ; >> stw r1,0(r2) | stwcx. r5,r0,r2 | lwsync ; >> lwsync | | lwz r3,0(r4) ; >> li r3,1 | | ; >> stw r3,0(r4) | | ; >> exists (1:r1=1 /\ 2:r1=2 /\ 2:r3=0) > > Just catching up on this, but one possible gotcha here is if you have an > architecture with native load-acquire on P2 and then you move P2 to the end > of P1. e.g. at a high-level: > > > P0 P1 > Wx = 1 RmW(y) // xchg() 1 => 2 > WyRel = 1 RyAcq = 2 > Rx = 0 > > arm64 forbids this, but it's not "natural" to the hardware and I don't > know what e.g. risc-v would say about it. > > Will RISC-V doesn't currently have native load-acquire instructions other than load-reserve-acquire, but if it did, it would forbid this outcome as well. To the broader question, RISC-V is other-multi-copy-atomic, so questions about propagation order and B-cumulativity and so on aren't generally problematic, just like they generally aren't an issue for ARMv8. Dan