All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Kui-Feng Lee <thinker.li@gmail.com>
Cc: martin.lau@linux.dev, kernel-team@meta.com, andrii@kernel.org,
	linux-trace-kernel@vger.kernel.org, bpf@vger.kernel.org,
	daniel@iogearbox.net, sinquersw@gmail.com, kuifeng@meta.com,
	John Fastabend <john.fastabend@gmail.com>
Subject: Re: [PATCH v2] rethook: Remove warning messages printed for finding return address of a frame.
Date: Tue, 9 Apr 2024 09:22:28 +0900	[thread overview]
Message-ID: <20240409092228.c8dbe901a0143f580346756b@kernel.org> (raw)
In-Reply-To: <20240408175140.60223-1-thinker.li@gmail.com>

On Mon,  8 Apr 2024 10:51:40 -0700
Kui-Feng Lee <thinker.li@gmail.com> wrote:

> The function rethook_find_ret_addr() prints a warning message and returns 0
> when the target task is running and is not the "current" task in order to
> prevent the incorrect return address, although it still may return an
> incorrect address.
> 
> However, the warning message turns into noise when BPF profiling programs
> call bpf_get_task_stack() on running tasks in a firm with a large number of
> hosts.
> 
> The callers should be aware and willing to take the risk of receiving an
> incorrect return address from a task that is currently running other than
> the "current" one. A warning is not needed here as the callers are intent
> on it.
> 

OK, looks good to me. Let me pick it to probes/for-next. Thanks!

> Acked-by: Andrii Nakryiko <andrii@kernel.org>
> Acked-by: John Fastabend <john.fastabend@gmail.com>
> Signed-off-by: Kui-Feng Lee <thinker.li@gmail.com>
> 
> ---
> Changes from v1:
> 
>  - Rephrased the commit log.
> 
>    - Removed the confusing last part of the first paragraph.
> 
>    - Removed "frequently" from the 2nd paragraph, replaced by "a firm with
>      a large number of hosts".
> 
> v1: https://lore.kernel.org/all/20240401191621.758056-1-thinker.li@gmail.com/
> ---
>  kernel/trace/rethook.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/rethook.c b/kernel/trace/rethook.c
> index fa03094e9e69..4297a132a7ae 100644
> --- a/kernel/trace/rethook.c
> +++ b/kernel/trace/rethook.c
> @@ -248,7 +248,7 @@ unsigned long rethook_find_ret_addr(struct task_struct *tsk, unsigned long frame
>  	if (WARN_ON_ONCE(!cur))
>  		return 0;
>  
> -	if (WARN_ON_ONCE(tsk != current && task_is_running(tsk)))
> +	if (tsk != current && task_is_running(tsk))
>  		return 0;
>  
>  	do {
> -- 
> 2.34.1
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

      reply	other threads:[~2024-04-09  0:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08 17:51 [PATCH v2] rethook: Remove warning messages printed for finding return address of a frame Kui-Feng Lee
2024-04-09  0:22 ` Masami Hiramatsu [this message]

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=20240409092228.c8dbe901a0143f580346756b@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=andrii@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kernel-team@meta.com \
    --cc=kuifeng@meta.com \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sinquersw@gmail.com \
    --cc=thinker.li@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.