lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yyx1wv06cL0pkQ6H@hirez.programming.kicks-ass.net>
Date:   Thu, 22 Sep 2022 16:48:34 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Namhyung Kim <namhyung@...nel.org>
Cc:     Ingo Molnar <mingo@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Song Liu <songliubraving@...com>,
        Ravi Bangoria <ravi.bangoria@....com>,
        Stephane Eranian <eranian@...gle.com>,
        Kan Liang <kan.liang@...ux.intel.com>
Subject: Re: [PATCH 1/2] perf: Use sample_flags for addr

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?


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ