From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2965113E3F5 for ; Thu, 27 Jun 2024 10:39:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719484741; cv=none; b=b/z9JIIqWYd6pp2fI13MOgtLXc/lDiRx0TrjIWb95ts/VL9cTC8k4ENwuYov4m15eKOz8RNbhf1TSi2ahDq5IU6IfFdvp/UQXai7G0EttGFedSIuGkdbzv4XbtvyIyFRIkpJ8LGgpA6zbmJe92ot9laUgqX4yeBnXT2LOiS+5To= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719484741; c=relaxed/simple; bh=WubQr97XkKQxDef1ONFTgfZ93YpzYjUnPEIOIt//c7k=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=Sm7NFk8erjpnYjNo3d+kxRzW//iursQ2rFR/uNv4bJ9BNomYa92dqcwCsMPFj0V8u452UHfb4aZmRP8ZcENnwzy/OM67bZ9A2+J5wGDuVKgfOSzlS/e7BBTPqFpycAiVx4QHi9tyccOlFPC5LCrf7K/NWf6kWDrZMnIvDBdWzq0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ME56jqv2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ME56jqv2" 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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.