From patchwork Wed Nov 2 18:33:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 13028811 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B845C4167B for ; Wed, 2 Nov 2022 18:37:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231340AbiKBShk (ORCPT ); Wed, 2 Nov 2022 14:37:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231531AbiKBShS (ORCPT ); Wed, 2 Nov 2022 14:37:18 -0400 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 D7D3C2FFCB for ; Wed, 2 Nov 2022 11:34:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667414079; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ncRDq/BlJOAFd1lZE2ZJuHKc4OomK+HPZ50zPzXYcKQ=; b=Ju4vKNdWwzNjA8G2EsWoTPsL+SJjJ4fO1yqOHJKNSEUTDcajUOsxc/GCsrxbgwjICmOTLJ 1+LUkNnPwQVkv55KBbA0S1QFPP0H8EHeVm52fHhLU2IRn2dhZfyscCW0OrT8uKb94R6Ql9 wL2nTSiEu+LeYbCZnRlyOZ1NsGMcb5s= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-193-SZA2qtQeOUyS9iPvcmM6mA-1; Wed, 02 Nov 2022 14:34:36 -0400 X-MC-Unique: SZA2qtQeOUyS9iPvcmM6mA-1 Received: by mail-qv1-f69.google.com with SMTP id z18-20020a0cfed2000000b004bc28af6f7dso981823qvs.4 for ; Wed, 02 Nov 2022 11:34:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ncRDq/BlJOAFd1lZE2ZJuHKc4OomK+HPZ50zPzXYcKQ=; b=OrUfW4vA8WVWMawj1NFrMZZppAclS1xYIPaILEMUiJAkxHurna1iF5KGFUvqTBspF0 CSuYmtz+f0zjgcjOHMaQKFVAqatKYTqFI64REnu+cBGhol0fxAmiOFlmNwGFWAigDRv8 oqjyNx7solzLq+DF2/R4nCkAzlkVh6x59rYgUVdAOqjG4bTPUtMeKRnNc+FAJM+BSlfj QFODXvaatba+/Xl00Is4iet/Ls68k+2HeDl0XAKtVZptuoQbLq1CQ4mlSRbXW0KGdeBS NnnPPWGZfwlnZ57f3d122giMo+RnOtu0X2cbDosLkXPYPIBPrbTkR2/2no/RsmEgKAhB MYDw== X-Gm-Message-State: ACrzQf18gacRVQ8kEgdLip/Nqg0Lc97FEcEGktG2J0HBa4+XqyooE3Cj dlfUhV9kjFR0CcvzGGgyWF+OO6TR9mxg5dhaxStq7JAQU96eV2tJa0oAayLO+3YWivxDnuOMbPN 5W/3VSXzJXx4PIjZ65Xc= X-Received: by 2002:a05:622a:248c:b0:3a5:15f9:57a5 with SMTP id cn12-20020a05622a248c00b003a515f957a5mr18914921qtb.48.1667414075616; Wed, 02 Nov 2022 11:34:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4FNihlWG52eEaddlVJ4IcxN5GuBU/ct7sDYakGhS8G9lm88SJZYPQReqCWBc6NZ/CtMAHrgg== X-Received: by 2002:a05:622a:248c:b0:3a5:15f9:57a5 with SMTP id cn12-20020a05622a248c00b003a515f957a5mr18914895qtb.48.1667414075423; Wed, 02 Nov 2022 11:34:35 -0700 (PDT) Received: from vschneid.remote.csb ([149.71.65.94]) by smtp.gmail.com with ESMTPSA id w187-20020a3794c4000000b006eed47a1a1esm8757820qkd.134.2022.11.02.11.34.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 11:34:34 -0700 (PDT) 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: [RFC PATCH v2 7/8] smp: reword smp call IPI comment Date: Wed, 2 Nov 2022 18:33:35 +0000 Message-Id: <20221102183336.3120536-6-vschneid@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221102182949.3119584-1-vschneid@redhat.com> References: <20221102182949.3119584-1-vschneid@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org 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 44fa4b9b1f46b..b96579fe08f09 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -503,9 +503,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