Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp917527rwd; Thu, 15 Jun 2023 04:04:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ64Cgnbpw1NqSM1tTVxZC0nmjpH5gkacd4TuqozCgVFm8g6FHf5j61trwaFCBvxe7ftlLGk X-Received: by 2002:a17:90a:f018:b0:25c:a96:93ca with SMTP id bt24-20020a17090af01800b0025c0a9693camr5765998pjb.15.1686827081673; Thu, 15 Jun 2023 04:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686827081; cv=none; d=google.com; s=arc-20160816; b=0+U2zZ1mlaU9XXr00w6jmEjrYIN4306oqA08uHREI+ekGXZt70w45Y8FaxJr4/Qdw4 U5FhYvef/0dSEw0X1+4Tqc9KKQ17OtQZr406+BlqbbZJ8NrIAESuCxKm6LgzQEdZJt78 4Y2VL98SlcEwDKUzjaG6g1bkMXvv7xcEz/MpSMGOTvsTFxYxd29hc/Ze9dCqqmvegy84 MkB0cFhZrSoke5jzI822yjpP0oPsBM7dNdT2zPfczxl3iYb5quv7jbPiH/iMkVRgpAQc JJyqo0zINY+FIyomgGASQ84Glg0P4ECL2jaWZvymMhwvaR2QpYwRzwBZduDwyakhtVjB 9VRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=xg+KmiB2qeRLE7ZrjzFtf6vdLQX6U7TxQqVVMe4Gw7U=; b=RBl7bGoo/4RdPqy0Tkvy+57msZvuGDd4/qDHLRDTNxcizPOCw4fy1ix6nagzPX/W8H bcOQYe/6VskcraCYHSgCgqkQoGG8jsgz8ZaSjKSrFYX1GX9txy7qI89JnvzdbIDHnC3X FkqGE9UyQhtIrfcde4uEp9eWgPViLkRtIN++f8PkROUF522BztToUR2o0pbxJoCtsqD1 aCZkhlAGUhNm6IGeaSU03b8kJimCe97ItUDzQrXmQcGSz0OchdV4C3dMibtmMIOSvHsd iDqXE9uxz5IZkITgUCqoZtoGGNNIo25I/Y9Z4sJyXhrFCMc57LUN2tDPtKibqJs50xMw 1Dng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=o1LRosGx; dkim=neutral (no key) header.i=@linutronix.de; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pi2-20020a17090b1e4200b0022c9cb7662csi15249115pjb.159.2023.06.15.04.04.28; Thu, 15 Jun 2023 04:04:41 -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=@linutronix.de header.s=2020 header.b=o1LRosGx; dkim=neutral (no key) header.i=@linutronix.de; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240548AbjFOK5t (ORCPT + 99 others); Thu, 15 Jun 2023 06:57:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240508AbjFOK5q (ORCPT ); Thu, 15 Jun 2023 06:57:46 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C1AE1FE4 for ; Thu, 15 Jun 2023 03:57:45 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686826664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xg+KmiB2qeRLE7ZrjzFtf6vdLQX6U7TxQqVVMe4Gw7U=; b=o1LRosGxzVcv13shcC7WuDak9twSuJhZ97F4x02wv6+4s4KEtIjyjerU0nM09IqqIbcL8H qoyNmx+WUcdmFKuNhJHtujb/P96a3begDsnUFTQawha2MnU9XHwBxKvo0loajFIYCmSDUs vRWo1ME/txaLEh+KJy0ANzD/qmMjOtGSHG39mcHl40KKJQjJNdzSov/BGHoGpd81hHHB8u TTAXQHuBiUrBu194kSVBCf4uyoZt/eOeYvzFAgPM1Oz394Nmpbx4cd34vjaK9jM35Kh8uK fuNElcQMahDJh5L2ZdM6WEYXojs7f/Ym8kxqbyBL+yafijLDPIr9lpCNl0C5aw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686826664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=xg+KmiB2qeRLE7ZrjzFtf6vdLQX6U7TxQqVVMe4Gw7U=; b=zxM+xm/dRWYaNIGAF4wqlBFlWMDH2hI1jUxWHgXm9r2Evy1BD7K5Z+bfIu8KH4yJ7KZxMy w6G22YJJO2aqaBBg== To: Peter Zijlstra 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() In-Reply-To: <20230615085828.GC1683497@hirez.programming.kicks-ass.net> References: <20230613115353.599087484@linutronix.de> <20230613121615.762734722@linutronix.de> <20230615085828.GC1683497@hirez.programming.kicks-ass.net> Date: Thu, 15 Jun 2023 12:57:43 +0200 Message-ID: <874jn9802g.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain 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_PASS,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 Thu, Jun 15 2023 at 10:58, Peter Zijlstra wrote: > 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. Duh, yes. > 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. Correct.