From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 28966C2BD09 for ; Thu, 27 Jun 2024 11:46:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MSHE3Bkm0ez9fQKditN8eKTQYWN7hVI+EURCncReUos=; b=kG5I8ULSVynoJPk7dfXXmI4nhX DONjHaAo5Rot0VyzjZKc9yYTXy4nfkrXks9Hjo09hOFIAoipNqYcbTysLcGUFd8d9YYlcIIO7POng ZloEfetfUjcyrFEa+eKYBStkW/MWaGccDdHZ9mt3w97fYryyFjiltl2rNyzoSrbx4Zc0zjX3Y+0hB ++yLOPUs0gOZZiczo3eNhTri965RdQVI6u8lbRycPK8xBXmS7vwP7H/fn+hqqP/4EVb6DagJ34DJd wJdXFnQll6O4QCJahei/4r8YnJ8h5kmWmcjyQedJlH0NFC3mRceGCyVjwxSc/zlcZ6TBcPRRd8NkT 0LG75hhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMnaM-0000000ACrZ-2GEc; Thu, 27 Jun 2024 11:46:42 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sMmWu-00000009zqz-48b7 for linux-arm-kernel@lists.infradead.org; Thu, 27 Jun 2024 10:39:11 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id C5CB5CE2D59; Thu, 27 Jun 2024 10:39:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEED8C2BBFC; Thu, 27 Jun 2024 10:39:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719484741; bh=WubQr97XkKQxDef1ONFTgfZ93YpzYjUnPEIOIt//c7k=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ME56jqv29QoKGjg5W1KoJJ1bfR/2/VlPpc55dL9F3+lIHqFYxxK3WDv8aSwGs0s+a krS/Xzcr4dMlmqo51nq4g3TWKTh+GRJDzlk5n/hQo2AbIm56ZQsK3tDtDv2EiFsro9 CDUsmZBk0Q1EnCuMD0/Ry+fAVhCTiTAHoZlWoJMzXyIbXKw0v3dtULUCBcvCRnN4m7 pIlcNeFDzJTWbZETLBw1MwbvBeGabMSgvU2SMk108rdQE6Qh33UryVKQigx7AzEcnF 2HOxIVqrVeh/1ESPYg3FMMCAX4sMsPuCNrumo12sf/TGcXb988XGA0Xk+x36wQw84y k6GD0iTsAqhsQ== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sMmWo-007lfM-LL; Thu, 27 Jun 2024 11:38:58 +0100 Date: Thu, 27 Jun 2024 11:38:58 +0100 Message-ID: <86pls2isal.wl-maz@kernel.org> From: Marc Zyngier To: richard clark Cc: Mark Rutland , will@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, "Russell King (Oracle)" , Steven Rostedt , Linus Torvalds Subject: Re: Will smp_call_function_single(cpu, ...) broadcast IPI to all other cpus? In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: richard.xnu.clark@gmail.com, mark.rutland@arm.com, will@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux@armlinux.org.uk, rostedt@goodmis.org, torvalds@linux-foundation.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240627_033905_934534_CACA06C4 X-CRM114-Status: GOOD ( 15.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 27 Jun 2024 10:26:05 +0100, richard clark wrote: > > Hi, > There's a smp_call_function_single(10, ipi_cb_func, &data_info, 1) > called by the init function of my kmod, then I ipi traces this > smp_call_function_single(...) with below cmdline: > > # echo 0 > /sys/kernel/debug/tracing/tracing_on; echo > > /sys/kernel/debug/tracing/trace; echo 'reason=="Function call > interrupts"' > /sys/kernel/debug/tracing/events/ipi/filter; echo 1 > > /sys/kernel/debug/tracing/events/ipi/ipi_raise/enable; echo 1 > > /sys/kernel/debug/tracing/events/ipi/ipi_entry/enable; echo 1 > > /sys/kernel/debug/tracing/tracing_on; taskset -c 0 insmod > /kmods/ipi_test.ko; echo 0 > /sys/kernel/debug/tracing/tracing_on; > echo 0 > /sys/kernel/debug/tracing/events/ipi/ipi_raise/enable; echo 0 > > /sys/kernel/debug/tracing/events/ipi/ipi_entry/enable; echo > > /sys/kernel/debug/tracing/events/ipi/filter; cat > /sys/kernel/debug/tracing/trace > > The trace output as below: > > # tracer: nop > # > # entries-in-buffer/entries-written: 28/28 #P:12 > # > # _-------=> irqs-off/BH-disabled > # / _------=> need-resched > # | / _-----=> need-resched-lazy > # || / _----=> hardirq/softirq > # ||| / _---=> preempt-depth > # |||| / _--=> preempt-lazy-depth > # ||||| / _-=> migrate-disable > # |||||| / delay > # TASK-PID CPU# ||||||| TIMESTAMP FUNCTION > # | | | ||||||| | | > > -0 [009] dn.h2.. 555.400822: ipi_raise: > target_mask=00000000,00000002 (Function call interrupts) > -0 [001] d..h1.. 555.400832: ipi_entry: > (Function call interrupts) > insmod-1644 [000] ....1.. 555.401628: ipi_raise: > target_mask=00000000,00000ffe (Function call interrupts) > -0 [001] d..h1.. 555.401630: ipi_entry: > (Function call interrupts) > -0 [009] d..h1.. 555.401631: ipi_entry: > (Function call interrupts) > -0 [011] d..h1.. 555.401633: ipi_entry: > (Function call interrupts) > -0 [003] d..h1.. 555.401633: ipi_entry: > (Function call interrupts) > -0 [008] d..h1.. 555.401633: ipi_entry: > (Function call interrupts) > -0 [002] d..h1.. 555.401634: ipi_entry: > (Function call interrupts) > -0 [010] d..h1.. 555.401634: ipi_entry: > (Function call interrupts) > -0 [004] d..h1.. 555.401635: ipi_entry: > (Function call interrupts) > -0 [005] d..h1.. 555.401635: ipi_entry: > (Function call interrupts) > -0 [006] d..h1.. 555.401635: ipi_entry: > (Function call interrupts) > -0 [007] d..h1.. 555.401635: ipi_entry: > (Function call interrupts) > insmod-1644 [000] ....1.. 555.401643: ipi_raise: > target_mask=00000000,00000ffe (Function call interrupts) > -0 [001] d..h1.. 555.401644: ipi_entry: > (Function call interrupts) > -0 [002] d..h1.. 555.401645: ipi_entry: > (Function call interrupts) > -0 [003] d..h1.. 555.401645: ipi_entry: > (Function call interrupts) > -0 [004] d..h1.. 555.401645: ipi_entry: > (Function call interrupts) > -0 [006] d..h1.. 555.401645: ipi_entry: > (Function call interrupts) > -0 [005] d..h1.. 555.401645: ipi_entry: > (Function call interrupts) > -0 [007] d..h1.. 555.401645: ipi_entry: > (Function call interrupts) > -0 [008] d..h1.. 555.401645: ipi_entry: > (Function call interrupts) > -0 [009] d..h1.. 555.401645: ipi_entry: > (Function call interrupts) > -0 [010] d..h1.. 555.401645: ipi_entry: > (Function call interrupts) > -0 [011] d..h1.. 555.401646: ipi_entry: > (Function call interrupts) > insmod-1644 [000] ....1.. 555.401908: ipi_raise: > target_mask=00000000,00000400 (Function call interrupts) > -0 [010] d..h1.. 555.401911: ipi_entry: > (Function call interrupts) > > I am curious why there're two IPI broadcasts to all the other > cpus(1-11) before the real smp_call_function_single(10) trace > event(the last two lines of the above trace output), any comments > about that? You may want to enable stack trace recording and find out for yourself where these ipi_raise() calls are coming from. M. -- Without deviation from the norm, progress is not possible.