From patchwork Thu Jan 19 14:36:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 45811 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp365122wrn; Thu, 19 Jan 2023 06:43:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXt72HGMZEIKXOZPezVUio32myy8sD3vF7z7MBXywTuZ3IXT+6uV0Q2CpL8xAh8i56Iu4ZLe X-Received: by 2002:a05:6402:430c:b0:49e:50e:1553 with SMTP id m12-20020a056402430c00b0049e050e1553mr14332027edc.3.1674139431878; Thu, 19 Jan 2023 06:43:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674139431; cv=none; d=google.com; s=arc-20160816; b=NifiqBCzxsEy/mHil+JNeHXmL/eA6STep1dy9t+7zUqPN52e8mYsC5es99k1hjGNLz RKL21Y6SL/Y4aQKsHTY2MY2xtaUWhGVvPB5ijvkXNH8xACOCD+lM9tZBH5Ab6KP2nsM0 cXTOb6FJbCmYAPwiiRyLmIEYgCbjT2SZx5whYMyY5cXVwOvAD+WtKVftvgKeZzCpE3lo XAHmdeNPJWbc9vLS5txR2jtEXYKID1pP26/mVK7NcQb2sasgQzhOI78z0inJ1LG8gciW 4E5wl+xv9kiwmgiDhDIoaPCKNgJn4S/pkXajL26/sLurHlYzGm2BqeK1zW8DRXDkmnwy 5RLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QbSxuBYwyBhZhp7hgOeOy88U7e5YyI7vjVO9jj/5+zE=; b=HQ5p7oWg/tR5MxSR5hixZALRcxsr2r2N62z8oJEk9iCpjJxJVM4J/iYH+9CZ2nrAhy TRpL4BEbdSapGPxvOj4QrLGp4BPqB2BdcBH7olxYDDv3FpNga4vUj4hhJbyt0Fex6lyb sTXNa8jjtvM6+76UAskpk59cwgK74vPs1pBlBjInKFXYugx2sciknvpNkiYA7DA7/+do G1lFXKz8+aMoQDll9WMQ5CI402pbBHhbE7UCKYXgVGn8t9RBLIuTJiX4WeWQrL8Zq58k /SVsUkj/kXUcVRnoq682NzVRjmk9ciNilAuOrSfRDnlp3jyiI00E+mlB0qcv5WudFWgW R3Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cIaODmZj; 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=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id en25-20020a056402529900b00459b51c2b25si38062550edb.438.2023.01.19.06.43.28; Thu, 19 Jan 2023 06:43:51 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=cIaODmZj; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230255AbjASOlK (ORCPT + 99 others); Thu, 19 Jan 2023 09:41:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231775AbjASOkK (ORCPT ); Thu, 19 Jan 2023 09:40:10 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20D227F9BB for ; Thu, 19 Jan 2023 06:37:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674139051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QbSxuBYwyBhZhp7hgOeOy88U7e5YyI7vjVO9jj/5+zE=; b=cIaODmZjHsrk0doTBJy5VEcbL1cU0NUMjDz0J6GckMS3DpV8k2FFmY1xUbLAOSlUrM+GNb NA//F8jwmNg1mfcVxiYh5qcmxvDW3+jb1G1WuMTFHPz30jqMi58MtW+Ias+rxfFe1+aIoG 3d4q648ayhWPcnSonjfFijQaRZnTwC0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-567-l4TS9XtFOxaf2EwwHWgw-g-1; Thu, 19 Jan 2023 09:37:29 -0500 X-MC-Unique: l4TS9XtFOxaf2EwwHWgw-g-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 07306857A88; Thu, 19 Jan 2023 14:37:27 +0000 (UTC) Received: from vschneid.remote.csb (unknown [10.33.36.13]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9C6872026D68; Thu, 19 Jan 2023 14:37:22 +0000 (UTC) From: Valentin Schneider To: linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, openrisc@lists.librecores.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org, x86@kernel.org Cc: "Paul E. McKenney" , Steven Rostedt , Peter Zijlstra , Thomas Gleixner , Sebastian Andrzej Siewior , Juri Lelli , Daniel Bristot de Oliveira , Marcelo Tosatti , Frederic Weisbecker , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Marc Zyngier , Mark Rutland , Russell King , Nicholas Piggin , Guo Ren , "David S. Miller" Subject: [PATCH v4 6/7] smp: reword smp call IPI comment Date: Thu, 19 Jan 2023 14:36:18 +0000 Message-Id: <20230119143619.2733236-7-vschneid@redhat.com> In-Reply-To: <20230119143619.2733236-1-vschneid@redhat.com> References: <20230119143619.2733236-1-vschneid@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755462428861782416?= X-GMAIL-MSGID: =?utf-8?q?1755462428861782416?= Accessing the call_single_queue hasn't involved a spinlock since 2014: 6897fc22ea01 ("kernel: use lockless list for smp_call_function_single") The llist operations (namely cmpxchg() and xchg()) provide similar ordering guarantees, update the comment to lessen confusion. Signed-off-by: Valentin Schneider --- kernel/smp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/smp.c b/kernel/smp.c index 93b4386cd3096..821b5986721ac 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -495,9 +495,10 @@ void __smp_call_single_queue(int cpu, struct llist_node *node) #endif /* - * The list addition should be visible before sending the IPI - * handler locks the list to pull the entry off it because of - * normal cache coherency rules implied by spinlocks. + * The list addition should be visible to the target CPU when it pops + * the head of the list to pull the entry off it in the IPI handler + * because of normal cache coherency rules implied by the underlying + * llist ops. * * If IPIs can go out of order to the cache coherency protocol * in an architecture, sufficient synchronisation should be added