mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Jiri Olsa <jolsa@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
	Song Liu <songliubraving@fb.com>,
	Ravi Bangoria <ravi.bangoria@amd.com>,
	Stephane Eranian <eranian@google.com>,
	Kan Liang <kan.liang@linux.intel.com>
Subject: Re: [PATCH 1/2] perf: Use sample_flags for addr
Date: Thu, 22 Sep 2022 16:48:34 +0200	[thread overview]
Message-ID: <Yyx1wv06cL0pkQ6H@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20220921220032.2858517-1-namhyung@kernel.org>

On Wed, Sep 21, 2022 at 03:00:31PM -0700, Namhyung Kim wrote:
> Use the new sample_flags to indicate whether the addr field is filled by
> the PMU driver.  As most PMU drivers pass 0, it can set the flag only if
> it has a non-zero value.  And use 0 in perf_sample_output() if it's not
> filled already.

So no objection to the general idea; just a question

> diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
> index 368bdc4f563f..f4a13579b0e8 100644
> --- a/include/linux/perf_event.h
> +++ b/include/linux/perf_event.h
> @@ -1028,7 +1028,6 @@ struct perf_sample_data {
>  	 * minimize the cachelines touched.
>  	 */
>  	u64				sample_flags;
> -	u64				addr;
>  	struct perf_raw_record		*raw;
>  	u64				period;
>  
> @@ -1040,6 +1039,7 @@ struct perf_sample_data {
>  	union perf_sample_weight	weight;
>  	union  perf_mem_data_src	data_src;
>  	u64				txn;
> +	u64				addr;
>  
>  	u64				type;
>  	u64				ip;

Is there a reason you placed the variable where you did?

I'm thinking we should look at what perf-tool thinks is the common set
of SAMPLE flags and make sure those fields are grouped in as little
cachelines as possible.

Things like @ip and @type, which are basically *always* set, should
definitely be on top, no?



  parent reply	other threads:[~2022-09-22 14:48 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-21 22:00 Namhyung Kim
2022-09-21 22:00 ` [PATCH 2/2] perf: Use sample_flags for raw_data Namhyung Kim
2022-09-28  6:57   ` [tip: perf/core] " tip-bot2 for Namhyung Kim
2022-10-06 16:00     ` [PATCH] " Sumanth Korikkar
2022-10-06 17:12       ` Namhyung Kim
2022-10-06 18:58       ` Jiri Olsa
2022-10-07  8:13         ` [PATCH] bpf: fix sample_flags for bpf_perf_event_output Sumanth Korikkar
2022-10-07  9:45           ` Jiri Olsa
2022-10-07 15:18             ` Peter Zijlstra
2022-10-19  4:57               ` Alexei Starovoitov
2022-10-21  1:36                 ` Alexei Starovoitov
2022-10-23  1:16                   ` bpf+perf is still broken. Was: " Alexei Starovoitov
2022-10-23 16:55                     ` Linus Torvalds
2022-10-23 17:19                       ` Linus Torvalds
2022-10-23 17:28                         ` Alexei Starovoitov
2022-10-17 14:45           ` [tip: perf/urgent] bpf: Fix " tip-bot2 for Sumanth Korikkar
2022-10-17 19:27           ` [PATCH] bpf: fix " SeongJae Park
2022-10-17 22:52             ` Namhyung Kim
2022-10-17 23:35               ` SeongJae Park
2022-10-19 10:44     ` [tip: perf/core] perf: Use sample_flags for raw_data Athira Rajeev
2022-09-22 14:48 ` Peter Zijlstra [this message]
2022-09-22 16:32   ` [PATCH 1/2] perf: Use sample_flags for addr Namhyung Kim
2022-09-22 20:55     ` [PATCH] perf: Change the layout of perf_sample_data Namhyung Kim
2022-09-23  7:45     ` [PATCH 1/2] perf: Use sample_flags for addr Peter Zijlstra
2022-09-28  6:57 ` [tip: perf/core] " tip-bot2 for Namhyung Kim

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=Yyx1wv06cL0pkQ6H@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=ravi.bangoria@amd.com \
    --cc=songliubraving@fb.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®