mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Mans Rullgard <mans@mansr.com>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Nicolas Pitre <nico@linaro.org>, Tony Lindgren <tony@atomide.com>,
	Sebastian Frias <sebastian_frias@sigmadesigns.com>
Subject: Re: [PATCH] clocksource: Store reg field within struct clocksource
Date: Thu, 19 Nov 2015 12:14:01 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.11.1511191209000.3898@nanos> (raw)
In-Reply-To: <20151119110842.GX8644@n2100.arm.linux.org.uk>

On Thu, 19 Nov 2015, Russell King - ARM Linux wrote:

> On Thu, Nov 19, 2015 at 11:42:48AM +0100, Thomas Gleixner wrote:
> > On Thu, 19 Nov 2015, Russell King - ARM Linux wrote:
> > > The basic cause of this problem is the ____cacheline_aligned annotation
> > > which effectively prevents wrapping struct clocksource to provide
> > > implementation specific data.
> > >
> > > Maybe your idea is that struct clocksource should be bloated with all
> > > implementation specific data in the long term?
> > 
> > Certainly not. That mmio use case is sane enough, but you are right,
> > that we should try to lift that ____cacheline_aligned restriction.
> 
> I don't think the cache line alignment of struct clocksource matters
> anymore - the core timekeeping code no longer uses struct clocksource
> but instead uses struct timekeeper, which caches much of the data from
> struct clocksource.  The only member of struct clocksource which it
> does access is max_cycles, which is more than 32 bytes into struct
> clocksource.
>
> So, I see no reason to waste memory with all these struct clocksources
> being bloated out to cacheline alignments.  In addition, once
> ____cacheline_aligned is removed, I see no reason for Marc's change
> either.

Right. I completely forgot that I rewrote the core part some time
ago. I'm older than 50, so I'm entitled to use the beginning Alzheimer
excuse. :)

So yes, the alignment of the clocksource struct is not longer
relevant. The case where we access clocksource->max_cycles is when
CONFIG_DEBUG_TIMEKEEPING is enabled, which imposes worse performance
problems to timekeeping than the extra cacheline.

So the simple solution for this issue is indeed the one liner below.

Thanks,

	tglx

8<-------------------

--- tip.orig/include/linux/clocksource.h
+++ tip/include/linux/clocksource.h
@@ -95,7 +95,7 @@ struct clocksource {
 	cycle_t wd_last;
 #endif
 	struct module *owner;
-} ____cacheline_aligned;
+}
 
 /*
  * Clock source flags bits::


  reply	other threads:[~2015-11-19 11:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-18 13:43 Marc Gonzalez
2015-11-18 13:51 ` Måns Rullgård
2015-11-18 17:21 ` Russell King - ARM Linux
2015-11-19  9:27   ` Marc Gonzalez
2015-11-19 10:33     ` Russell King - ARM Linux
2015-11-19 10:36       ` Thomas Gleixner
2015-11-19 10:40         ` Russell King - ARM Linux
2015-11-19 10:33   ` Thomas Gleixner
2015-11-19 10:36     ` Russell King - ARM Linux
2015-11-19 10:42       ` Thomas Gleixner
2015-11-19 11:08         ` Russell King - ARM Linux
2015-11-19 11:14           ` Thomas Gleixner [this message]
2015-11-19 12:26             ` Marc Gonzalez
2015-11-19 13:57               ` Thomas Gleixner
2015-11-24 12:36                 ` Marc Gonzalez
2015-11-25 21:33             ` [tip:timers/core] timekeeping: Lift clocksource cacheline restriction tip-bot for Thomas Gleixner
2015-11-19 10:55       ` [PATCH] clocksource: Store reg field within struct clocksource Marc Gonzalez
2015-11-19 11:21         ` Russell King - ARM Linux
2015-11-19 12:41           ` Marc Gonzalez

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=alpine.DEB.2.11.1511191209000.3898@nanos \
    --to=tglx@linutronix.de \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mans@mansr.com \
    --cc=marc_gonzalez@sigmadesigns.com \
    --cc=nico@linaro.org \
    --cc=sebastian_frias@sigmadesigns.com \
    --cc=tony@atomide.com \
    --cc=viresh.kumar@linaro.org \
    /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®