Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1273015

Re: [PATCH] clocksource: Store reg field within struct clocksource

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH] clocksource: Store reg field within struct clocksource
Date 2015-11-19 11:40 +0100
Message-ID <qwuNc-85h-7@gated-at.bofh.it> (permalink)
References <qwbhv-3zI-5@gated-at.bofh.it> <qweIq-60C-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Russell,

On Wed, 18 Nov 2015, Russell King - ARM Linux wrote:

> On Wed, Nov 18, 2015 at 02:43:34PM +0100, Marc Gonzalez wrote:
> > Since 'struct clocksource' is ____cacheline_aligned, gcc must insert
> > a lot of padding between reg and clksrc in 'struct clocksource_mmio'
> > (for example, L1_CACHE_BYTES = 64 on ARMv7).
> > 
> > Storing reg within 'struct clocksource' removes unnecessary padding,
> > and reg can then be grouped with other hot data. A nice side-effect
> > of this patch is making container_of() unnecessary, which makes the
> > code a bit simpler.
> > 
> > On 32-bit platforms, reg fits in the padding between read and mask,
> > meaning no downside from storing it there.
> 
> Just swap the order of 'reg' and 'clksrc'.

That might reduce the memory footprint, but it does not bring the
iomem pointer closer to the other hotpath clocksource data. So we
still need to touch at minimum two cache lines for reading the time.

With Marcs change we have all hotpath data in a single cacheline.

Thanks,

	tglx


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] clocksource: Store reg field within struct clocksource Marc Gonzalez <marc_gonzalez@sigmadesigns.com> - 2015-11-18 14:50 +0100
  Re: [PATCH] clocksource: Store reg field within struct clocksource Måns Rullgård <mans@mansr.com> - 2015-11-18 15:00 +0100
  Re: [PATCH] clocksource: Store reg field within struct clocksource Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-11-18 18:30 +0100
    Re: [PATCH] clocksource: Store reg field within struct clocksource Marc Gonzalez <marc_gonzalez@sigmadesigns.com> - 2015-11-19 10:40 +0100
      Re: [PATCH] clocksource: Store reg field within struct clocksource Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-11-19 11:40 +0100
        Re: [PATCH] clocksource: Store reg field within struct clocksource Thomas Gleixner <tglx@linutronix.de> - 2015-11-19 11:40 +0100
          Re: [PATCH] clocksource: Store reg field within struct clocksource Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-11-19 11:50 +0100
    Re: [PATCH] clocksource: Store reg field within struct clocksource Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-11-19 11:40 +0100
      Re: [PATCH] clocksource: Store reg field within struct clocksource Thomas Gleixner <tglx@linutronix.de> - 2015-11-19 11:50 +0100
        Re: [PATCH] clocksource: Store reg field within struct clocksource Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-11-19 12:10 +0100
          Re: [PATCH] clocksource: Store reg field within struct clocksource Thomas Gleixner <tglx@linutronix.de> - 2015-11-19 12:20 +0100
            Re: [PATCH] clocksource: Store reg field within struct clocksource Marc Gonzalez <marc_gonzalez@sigmadesigns.com> - 2015-11-19 13:30 +0100
              Re: [PATCH] clocksource: Store reg field within struct clocksource Thomas Gleixner <tglx@linutronix.de> - 2015-11-19 15:00 +0100
                Re: [PATCH] clocksource: Store reg field within struct clocksource Marc Gonzalez <marc_gonzalez@sigmadesigns.com> - 2015-11-24 13:40 +0100
            [tip:timers/core] timekeeping:   Lift clocksource cacheline restriction tip-bot for Thomas Gleixner <tipbot@zytor.com> - 2015-11-25 22:40 +0100
      Re: [PATCH] clocksource: Store reg field within struct clocksource Marc Gonzalez <marc_gonzalez@sigmadesigns.com> - 2015-11-19 12:00 +0100
        Re: [PATCH] clocksource: Store reg field within struct clocksource Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-11-19 12:30 +0100
          Re: [PATCH] clocksource: Store reg field within struct clocksource Marc Gonzalez <marc_gonzalez@sigmadesigns.com> - 2015-11-19 13:50 +0100
    Re: [PATCH] clocksource: Store reg field within struct clocksource Thomas Gleixner <tglx@linutronix.de> - 2015-11-19 11:40 +0100

csiph-web