Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp814905rwd; Thu, 15 Jun 2023 02:23:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5at7FLlPLUJh9b1Rm3VEQ3vQh2IgYq2Sg3Nk8Rs5Sta5QeW4x9Ziosb0rCRayLuWTFjEM0 X-Received: by 2002:a17:90b:610:b0:25e:8b7a:c48 with SMTP id gb16-20020a17090b061000b0025e8b7a0c48mr2743908pjb.1.1686820994194; Thu, 15 Jun 2023 02:23:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686820994; cv=none; d=google.com; s=arc-20160816; b=VVt9snH5pB4phQ2z6RaORqPooZ+RySomE3r5ZHbkJUchFmUKX/LTcpOFdV83Ki5Zyc 4leZSro8Zt+qhT5jxJ+8xebDgOywyzlbluXAO8Jc0bPT4ps8I0LTf5pPiu26VHP+EBCy z5dvRlOiT2UoiAzXwuyYl0P450ohbm9CFSLgvTAhFncOHNsuATiTPMK6JSBeBxiG9EeT RMg2fdgi8In87qmLwjMt0e6+bfcZCLYEp5khR0vaPnnK9tIm/xCOcUeom807AnzJb+pE mExRCJn/rZhqeiDlrje8UvylZvaIx7i+aIJlEvFVsjzcPCNX9N4lTQbU5Z1X7B9i7cTI gjrg== 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=0MN/5b29jWXDxiDwyt3AOfbJjNfxk4ZF1WmdtESE9lU=; b=qAB404fc8LcvbanEYWXJWgZarP+zh24jKmFaiWpcy84QIpHLRJ/blypdtv+TZSiguL x4pr/xWY1MQr1w459HY1vO4R1VLHf24HvqxpKXggG1CW5+mpXXRu5mXGQ90smc5zxSzY S4qQitrAHp9YsVuNxsoIQ4Xo8FH3HhFHLEqO+NroE6EwXgquKGKbItDswhs0KPIKc2hQ da9+/yvfYor/YQBqv5cuQnu3a1vI0QbD6S5tKhnUR8EmFWu8+uvRtVTBXe39YReTwORA WEPQZToFXpc7eLrthlMW/0l6GR/++V5m6w4zgvPk8rHwaRcrBvuHsrwcVb3X2Lbbm1Zi KvTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=lXVPsvUy; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o4-20020a17090ac70400b0025c21e4bb48si4470976pjt.47.2023.06.15.02.23.02; Thu, 15 Jun 2023 02:23:14 -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=@infradead.org header.s=desiato.20200630 header.b=lXVPsvUy; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240971AbjFOJAu (ORCPT + 99 others); Thu, 15 Jun 2023 05:00:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240530AbjFOJAr (ORCPT ); Thu, 15 Jun 2023 05:00:47 -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 DFD521FCC for ; Thu, 15 Jun 2023 02:00:45 -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=0MN/5b29jWXDxiDwyt3AOfbJjNfxk4ZF1WmdtESE9lU=; b=lXVPsvUyKJ0NSRqdBz47nM4zMY B68CamOx9wmcVQMNRC97zxaphk7FE1IX0Nh5BRfFDDmf7p9raqM5D3kGIWJXubpAil6xXv4ucIhVU QU524VCgeK/OIp12aZl7WjFiKYyg+kOZAfxWk3PY+wufBitQqoGFiam9PLrUy7bjrP4gF58EpXMWf v6j88Mlh3BwdttPMCzLVdeh9SdHHgLeVJACOTK9Cn5Jc8PKXfoI3BR82oW9I4nkbImiXeDaxSQR9p tzBpTPNUb2y5URvqW5gZiv0CvXAcKmhOjp8FBMHCIXo/vHlXfQrdyGvdtYC9AbePnLiKtuUaZPb3n kyobITxw==; 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 1q9ioH-00Bl0w-2s; Thu, 15 Jun 2023 09:00:30 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id F3976300188; Thu, 15 Jun 2023 10:58:28 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id DA79C2456F421; Thu, 15 Jun 2023 10:58:28 +0200 (CEST) Date: Thu, 15 Jun 2023 10:58:28 +0200 From: Peter Zijlstra To: Thomas Gleixner Cc: LKML , x86@kernel.org, Mario Limonciello , Tom Lendacky , Tony Battersby , Ashok Raj , Tony Luck , Arjan van de Veen , Eric Biederman , Ashok Raj Subject: Re: [patch V2 3/8] x86/smp: Remove pointless wmb() from native_stop_other_cpus() Message-ID: <20230615085828.GC1683497@hirez.programming.kicks-ass.net> References: <20230613115353.599087484@linutronix.de> <20230613121615.762734722@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230613121615.762734722@linutronix.de> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Tue, Jun 13, 2023 at 02:17:58PM +0200, Thomas Gleixner wrote: > The wmb() after the successfull atomic_cmpxchg() is complete voodoo along > with the comment stating "sync above data before sending IRQ". > > There is no "above" data except for the atomic_t stopping_cpu which has > just been acquired. The reboot IPI handler does not check any data and > unconditionally disables the CPU. > > Remove this cargo cult barrier. > > Signed-off-by: Thomas Gleixner > Reviewed-by: Ashok Raj > --- > arch/x86/kernel/smp.c | 3 --- > 1 file changed, 3 deletions(-) > > --- a/arch/x86/kernel/smp.c > +++ b/arch/x86/kernel/smp.c > @@ -174,9 +174,6 @@ static void native_stop_other_cpus(int w > > atomic_set(&stop_cpus_count, num_online_cpus() - 1); > > - /* sync above data before sending IRQ */ > - wmb(); > - > apic_send_IPI_allbutself(REBOOT_VECTOR); There's a second one a little below. That too should go. More to the point, the apic_send_*() functions should be the ones that ensure this if required etc.. See for example weak_wrmsr_fence() for x2apic.