From: Mark Rutland <mark.rutland@arm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: keescook@chromium.org, x86@kernel.org,
linux-kernel@vger.kernel.org, juri.lelli@redhat.com,
vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
bristot@redhat.com, akpm@linux-foundation.org,
zhengqi.arch@bytedance.com, linux@armlinux.org.uk,
catalin.marinas@arm.com, will@kernel.org, mpe@ellerman.id.au,
paul.walmsley@sifive.com, palmer@dabbelt.com, hca@linux.ibm.com,
gor@linux.ibm.com, borntraeger@de.ibm.com,
linux-arch@vger.kernel.org, ardb@kernel.org
Subject: Re: [PATCH 5/7] powerpc, arm64: Mark __switch_to() as __sched
Date: Fri, 22 Oct 2021 18:40:11 +0100 [thread overview]
Message-ID: <20211022174011.GI86184@C02TD0UTHF1T.local> (raw)
In-Reply-To: <20211022152104.419533274@infradead.org>
On Fri, Oct 22, 2021 at 05:09:38PM +0200, Peter Zijlstra wrote:
> Unlike most of the other architectures, PowerPC and ARM64 have
> __switch_to() as a C function which remains on the stack.
For clarity, could we say:
Unlike most of the other architectures, PowerPC and ARM64 have
__switch_to() as a C function which is visible when unwinding from
their assembly switch function.
... since both arm64 and powerpc are branch-and-link architectures, and
this isn't stacked; it's in the GPR context saved by the switch
assembly.
> Their
> respective __get_wchan() skips one stack frame unconditionally,
> without testing is_sched_functions().
and similarly s/stack frame/caller/ here.
>
> Mark them __sched such that we can forgo that special case.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
> arch/arm64/kernel/process.c | 4 ++--
> arch/powerpc/kernel/process.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> --- a/arch/arm64/kernel/process.c
> +++ b/arch/arm64/kernel/process.c
> @@ -490,8 +490,8 @@ void update_sctlr_el1(u64 sctlr)
> /*
> * Thread switching.
> */
> -__notrace_funcgraph struct task_struct *__switch_to(struct task_struct *prev,
> - struct task_struct *next)
> +__notrace_funcgraph __sched
> +struct task_struct *__switch_to(struct task_struct *prev, struct task_struct *next)
As this only matters for the call to our cpu_switch_to() assembly, this
looks sufficient to me. This only changes the placement of the function
and doesn't affect the existing tracing restrictions, so I don't think
this should have any adverse effect.
For testing, this doesn't adversly affect the existing unwinder (which
should obviously be true since we skip the entry anyway, but hey..).
Regardless of the commit message wording:
Reviewed-by: Mark Rutland <mark.rutland@arm.com> [arm64]
Tested-by: Mark Rutland <mark.rutland@arm.com> [arm64]
Thanks,
Mark.
> {
> struct task_struct *last;
>
> --- a/arch/powerpc/kernel/process.c
> +++ b/arch/powerpc/kernel/process.c
> @@ -1201,8 +1201,8 @@ static inline void restore_sprs(struct t
>
> }
>
> -struct task_struct *__switch_to(struct task_struct *prev,
> - struct task_struct *new)
> +__sched struct task_struct *__switch_to(struct task_struct *prev,
> + struct task_struct *new)
> {
> struct thread_struct *new_thread, *old_thread;
> struct task_struct *last;
>
>
next prev parent reply other threads:[~2021-10-22 17:40 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-22 15:09 [PATCH 0/7] arch: More wchan fixes Peter Zijlstra
2021-10-22 15:09 ` [PATCH 1/7] x86: Fix __get_wchan() for !STACKTRACE Peter Zijlstra
2021-10-22 16:25 ` Kees Cook
2021-10-26 19:16 ` [tip: sched/core] " tip-bot2 for Peter Zijlstra
2021-10-22 15:09 ` [PATCH 2/7] stacktrace,sched: Make stack_trace_save_tsk() more robust Peter Zijlstra
2021-10-22 16:25 ` Kees Cook
2021-10-22 16:45 ` Peter Zijlstra
2021-10-22 16:57 ` Mark Rutland
2021-10-22 16:54 ` Mark Rutland
2021-10-22 17:01 ` Peter Zijlstra
2021-10-25 20:38 ` Peter Zijlstra
2021-10-25 20:52 ` Kees Cook
2021-10-26 9:33 ` Mark Rutland
2021-10-25 16:27 ` Peter Zijlstra
2021-10-22 15:09 ` [PATCH 3/7] ARM: implement ARCH_STACKWALK Peter Zijlstra
2021-10-22 16:18 ` Kees Cook
2021-10-22 15:09 ` [PATCH 4/7] arch: Make ARCH_STACKWALK independent of STACKTRACE Peter Zijlstra
2021-10-22 16:18 ` Kees Cook
2021-10-22 16:36 ` Peter Zijlstra
2021-10-22 17:06 ` Mark Rutland
2021-10-22 15:09 ` [PATCH 5/7] powerpc, arm64: Mark __switch_to() as __sched Peter Zijlstra
2021-10-22 16:15 ` Kees Cook
2021-10-22 17:40 ` Mark Rutland [this message]
2021-10-22 15:09 ` [PATCH 6/7] arch: __get_wchan() || ARCH_STACKWALK Peter Zijlstra
2021-10-22 16:13 ` Kees Cook
2021-10-22 17:52 ` Mark Rutland
2021-10-22 15:09 ` [PATCH 7/7] selftests: proc: Make sure wchan works when it exists Peter Zijlstra
2021-10-22 15:27 ` [PATCH 0/7] arch: More wchan fixes Peter Zijlstra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211022174011.GI86184@C02TD0UTHF1T.local \
--to=mark.rutland@arm.com \
--cc=akpm@linux-foundation.org \
--cc=ardb@kernel.org \
--cc=borntraeger@de.ibm.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=catalin.marinas@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=juri.lelli@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mgorman@suse.de \
--cc=mpe@ellerman.id.au \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=vincent.guittot@linaro.org \
--cc=will@kernel.org \
--cc=x86@kernel.org \
--cc=zhengqi.arch@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®