Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3149839rdg; Tue, 17 Oct 2023 06:15:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEG/GNAMwdQ3JLGGZGkK+urqgCYPjljjqhyqEkw2YhVy6xwWjUM2QyyqMZhWe0XWsc8fWzd X-Received: by 2002:a05:6a00:22c4:b0:6bb:b574:4f60 with SMTP id f4-20020a056a0022c400b006bbb5744f60mr2184394pfj.15.1697548557694; Tue, 17 Oct 2023 06:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697548557; cv=none; d=google.com; s=arc-20160816; b=FAdfoQbb7R/4d5MYzwYtFushyhjvVj+YJcVyc7guAHdA81qz4WbbLIdUnevxuLWgBO uNxR5ob7X8ZpGtTA9rOnZTms1kK4p+OD7+uR2HfiwfDvhk/gTizuGCL4xdcjr0IjxJPD zQkCAM2i9PEDf2YYhdoijeN/D+gEq2Su5BIIwFuxBGaSA5YXSvFgOlxcVgkm2dAm01iJ vmpxP0ysDzzSVC3y/Aw5BccnhDtwIzkdpwh8Ai51z3otEFiMmTa9exkeY671B9dyjxI4 ev6E6ER0f1N3R/8U/D9BDREG3M8bIoL9pEKbrkhOcA4vrXe8hqmjCefyT3TQeYJbtHfZ zlOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8fU76jL3XwMugPoWuiJp0vehmzP8csx8b1SF7Bd35mM=; fh=oPs17mchlce/Lph6uzuHsj8omNpAIfxmxFYZGMctGqk=; b=EldGWq+xcVGAAy/3HXDR0C3xBLMp4COBdr4Pn9l1pdMTb27s5xSoHVLogvr6r31WOe itKwvehKCN7o/Lc15gYqFBlBK4UxPtFmQoV2X1X0+pfLBW9pUTnGm72IQCtvgRbbDEi8 CMW5amqEI1K8sosIjlasDE2sd5fLp7eKL1dOOgmZ2QaeiN5KnSzfubCXkusDTQGZN39/ XAshQX5Suo4tz/1zfxVUGLZbcjHQZC40YmIobxqqZXwPSMCgu1I6Ow+4T7xwHGi0EDGu xzjuZl+LJs8Gkh/yddElYLUhjlEEmdnbe1Mi7SqDDzaKvbR2oY/iJ1AYhhDWh7V8yk8I VNhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=mvI+vpVc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id b2-20020a056a00114200b0068e2b901138si1621485pfm.158.2023.10.17.06.15.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Oct 2023 06:15:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=mvI+vpVc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 098DE807E83D; Tue, 17 Oct 2023 06:15:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343536AbjJQNO7 (ORCPT + 99 others); Tue, 17 Oct 2023 09:14:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233940AbjJQNO6 (ORCPT ); Tue, 17 Oct 2023 09:14:58 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98F1CEA for ; Tue, 17 Oct 2023 06:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=8fU76jL3XwMugPoWuiJp0vehmzP8csx8b1SF7Bd35mM=; b=mvI+vpVcDMxJKtRLXtiEPETSEI f3GgJT+T9FkK01c17an/AuT677JHslw/3wkmE/A9rkv2zwUzAc7aq3BgObWx/UCBUn4akJ204HCX9 r+x3XXQREiXt/Fi7wqeI1g/KzaCueZHk/qy+CQLb5TZF/NOIaqLv9RSndiFyoKpHOIGzPBECAHaDs w8y1mbrXyF4/tsj9gZQUvJDD/F8PUzpPZZ8lld5Rhhw9RP5n5nw8/Rw/QCfB3Cn1Qz7C7YMZpqzgD iG0Cxf6cgmknhckmcvrQSLSoiddUd4eo6Meif8X0AuhZyJxBbGYn+r1aaiiO8yTDSnxxuaqGoNoEX +o2pk/LA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qsju8-0077PD-17; Tue, 17 Oct 2023 13:14:36 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 066F030047C; Tue, 17 Oct 2023 15:14:36 +0200 (CEST) Date: Tue, 17 Oct 2023 15:14:35 +0200 From: Peter Zijlstra To: Mark Rutland Cc: Rong Tao , elver@google.com, tglx@linutronix.de, Rong Tao , open list Subject: Re: [PATCH] stop_machine: Avoid potential race behaviour of multi_stop_data::state Message-ID: <20231017131435.GA1599@noisy.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 17 Oct 2023 06:15:15 -0700 (PDT) On Tue, Oct 17, 2023 at 11:24:40AM +0100, Mark Rutland wrote: > That said, if we really want to avoid the non-atomic read, it's probably better > to have multi_cpu_stop() pass curstate as a paramter to ack_state. That or fold > ack_state() into multi_cpu_stop() and use curstate directly. Right. Also, that smp_wmb() needs a comment. Or perhaps smp_store_release().