All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Liang, Kan" <kan.liang@intel.com>
Cc: "mingo@redhat.com" <mingo@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"acme@kernel.org" <acme@kernel.org>,
	"jolsa@redhat.com" <jolsa@redhat.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"eranian@google.com" <eranian@google.com>,
	"ak@linux.intel.com" <ak@linux.intel.com>
Subject: Re: [PATCH V5] perf: Add PERF_SAMPLE_PHYS_ADDR
Date: Tue, 22 Aug 2017 20:21:01 +0200	[thread overview]
Message-ID: <20170822182101.GM32112@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F0775378A2C0@SHSMSX103.ccr.corp.intel.com>

On Tue, Aug 22, 2017 at 05:58:34PM +0000, Liang, Kan wrote:

> It looks there is still one room in cacheline 1.

> > So this is very unfortunate...
> > 
> > struct perf_sample_data {
> >         u64                        addr;                 /*     0     8 */
> >         struct perf_raw_record *   raw;                  /*     8     8 */
> >         struct perf_branch_stack * br_stack;             /*    16     8 */
> >         u64                        period;               /*    24     8 */
> >         u64                        weight;               /*    32     8 */
> >         u64                        txn;                  /*    40     8 */
> >         union perf_mem_data_src    data_src;             /*    48     8 */
> >         u64                        type;                 /*    56     8 */

You mean @type, right? That is unconditionally used by the output code.

> >         /* --- cacheline 1 boundary (64 bytes) --- */
> >         u64                        ip;                   /*    64     8 */
> >         struct {
> >                 u32                pid;                  /*    72     4 */
> >                 u32                tid;                  /*    76     4 */
> >         } tid_entry;                                     /*    72     8 */
> >         u64                        time;                 /*    80     8 */
> >         u64                        id;                   /*    88     8 */
> >         u64                        stream_id;            /*    96     8 */
> >         struct {
> >                 u32                cpu;                  /*   104     4 */
> >                 u32                reserved;             /*   108     4 */
> >         } cpu_entry;                                     /*   104     8 */
> >         struct perf_callchain_entry * callchain;         /*   112     8 */
> >         struct perf_regs           regs_user;            /*   120    16 */
> >         /* --- cacheline 2 boundary (128 bytes) was 8 bytes ago --- */
> >         struct pt_regs             regs_user_copy;       /*   136   168 */
> >         /* --- cacheline 4 boundary (256 bytes) was 48 bytes ago --- */
> >         struct perf_regs           regs_intr;            /*   304    16 */
> >         /* --- cacheline 5 boundary (320 bytes) --- */
> >         u64                        stack_user_size;      /*   320     8 */
> > 
> >         /* size: 384, cachelines: 6, members: 19 */
> >         /* padding: 56 */
> > };

Now, I was hoping, that if you move the entire thing into generic code
(PPC also support PERF_SAMPLE_DATA) then we can avoid the init here and
rely on perf_sample_prepare().

  reply	other threads:[~2017-08-22 18:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-17 18:17 [PATCH V5] perf: Add PERF_SAMPLE_PHYS_ADDR kan.liang
2017-08-22 16:56 ` Peter Zijlstra
2017-08-22 17:58   ` Liang, Kan
2017-08-22 18:21     ` Peter Zijlstra [this message]
2017-08-22 17:07 ` Peter Zijlstra
2017-08-22 17:15   ` Liang, Kan
2017-08-22 17:31   ` Andi Kleen

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=20170822182101.GM32112@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=eranian@google.com \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    /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.