From: Valentin Schneider 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> References: <20221102182949.3119584-1-vschneid@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ovP3Cm5BEyZntnNHbylAJrczRnos9geFSJ1cdVOGEdU=; b=xvM1CUs/S+2S84 8lHAht4Uh64AE16pM2Mhs97XpePiM15Am/+l8qMXRJGxewrlypOPXthhj695aBozmsCU4ndjwYOka snjwBgMMrz6SjpQjcEYWtsE3kqmnkvwqfdKAFN03rRixl+oJK6WYmXIiLM9gHcMR7Opp+qOqeMZvy zCiqZ91S2g8wasb2e80+UWDGSEeYTcMcsG39BphnubWQu7E2TglbeOb+iai+3WMaIkqoflSov0Rca I8djTtv0cm410LUpIr+YFdkBa4iaU5LHqe5OnGn9v5GZlMIMA+lYFhewgDKkMabWmEmqf60NI7SZO 8KIuItyp5uJ01fm9Qx/g==; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667414077; 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=Ymt8DXTxbHCw+G1nrAnPR1ViwCgBKVOYVdGinkcO0Dj5PIiL8r65EjiiL2CdB386NsTERJ cKIP4XaLd14WRTbDi57Zkf119jQKxN44I2KieqYmflqKpftt+w20sgROInrU6mZ9/BNqOq xYnId/9jV1XKdPpz+mc6GuvGwYwSsx0= In-Reply-To: <20221102182949.3119584-1-vschneid@redhat.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+glpr-linux-riscv=m.gmane-mx.org@lists.infradead.org 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" 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 -- 2.31.1