From: marc_gonzalez@sigmadesigns.com (Marc Gonzalez)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_init
Date: Fri, 13 Nov 2015 16:39:10 +0100 [thread overview]
Message-ID: <5646041E.4040209@sigmadesigns.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1511131025140.3903@nanos>
On 13/11/2015 16:26, Thomas Gleixner wrote:
> On Fri, 13 Nov 2015, Marc Gonzalez wrote:
>> On 13/11/2015 15:16, Daniel Lezcano wrote:
>>> For example:
>>>
>>> struct clockcommon {
>>> u32 mult;
>>> u32 shift;
>>> int rating;
>>> void __iomem *base;
>>> char *name;
>>> int irq;
>>> };
>>>
>>> struct clocksource {
>>> struct clockcommon common; /* MUST be the first field */
>>> cycle_t (*read)(struct clocksource *cs);
>>> cycle_t mask;
>>> ...
>>> };
>>
>> According to my notes, commit 369db4c952 grouped hot-path data
>> into a single cache line (hence ____cacheline_aligned).
>>
>> (AFAIR, ARMv7 ARCH_MULTIPLATFORM assumes CACHE_LINE=64)
>>
>> Not sure how to make the two concepts (common base struct and
>> grouping hot data) play nicely, without wasting a lot of space
>> on padding.
>
> It wont play well. We are not going to change the layout of struct
> clocksource because it will hurt the sane use cases for no reason.
You are referring to Daniel's proposed reorg, right?
What about my proposal? I inserted reg after maxadj, but it may be
inserted anywhere in the struct.
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 278dd279a7a8..03807ca0d54e 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -74,6 +74,9 @@ struct clocksource {
u32 shift;
u64 max_idle_ns;
u32 maxadj;
+#ifdef CONFIG_CLKSRC_MMIO
+ void __iomem *reg;
+#endif
#ifdef CONFIG_ARCH_CLOCKSOURCE_DATA
struct arch_clocksource_data archdata;
#endif
WARNING: multiple messages have this Message-ID (diff)
From: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>,
LKML <linux-kernel@vger.kernel.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH] clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_init
Date: Fri, 13 Nov 2015 16:39:10 +0100 [thread overview]
Message-ID: <5646041E.4040209@sigmadesigns.com> (raw)
In-Reply-To: <alpine.DEB.2.11.1511131025140.3903@nanos>
On 13/11/2015 16:26, Thomas Gleixner wrote:
> On Fri, 13 Nov 2015, Marc Gonzalez wrote:
>> On 13/11/2015 15:16, Daniel Lezcano wrote:
>>> For example:
>>>
>>> struct clockcommon {
>>> u32 mult;
>>> u32 shift;
>>> int rating;
>>> void __iomem *base;
>>> char *name;
>>> int irq;
>>> };
>>>
>>> struct clocksource {
>>> struct clockcommon common; /* MUST be the first field */
>>> cycle_t (*read)(struct clocksource *cs);
>>> cycle_t mask;
>>> ...
>>> };
>>
>> According to my notes, commit 369db4c952 grouped hot-path data
>> into a single cache line (hence ____cacheline_aligned).
>>
>> (AFAIR, ARMv7 ARCH_MULTIPLATFORM assumes CACHE_LINE=64)
>>
>> Not sure how to make the two concepts (common base struct and
>> grouping hot data) play nicely, without wasting a lot of space
>> on padding.
>
> It wont play well. We are not going to change the layout of struct
> clocksource because it will hurt the sane use cases for no reason.
You are referring to Daniel's proposed reorg, right?
What about my proposal? I inserted reg after maxadj, but it may be
inserted anywhere in the struct.
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 278dd279a7a8..03807ca0d54e 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -74,6 +74,9 @@ struct clocksource {
u32 shift;
u64 max_idle_ns;
u32 maxadj;
+#ifdef CONFIG_CLKSRC_MMIO
+ void __iomem *reg;
+#endif
#ifdef CONFIG_ARCH_CLOCKSOURCE_DATA
struct arch_clocksource_data archdata;
#endif
next prev parent reply other threads:[~2015-11-13 15:39 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-13 10:58 [PATCH] clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_init Daniel Lezcano
2015-11-13 12:20 ` Marc Gonzalez
2015-11-13 12:20 ` Marc Gonzalez
2015-11-13 14:16 ` Daniel Lezcano
2015-11-13 14:16 ` Daniel Lezcano
2015-11-13 14:39 ` Marc Gonzalez
2015-11-13 14:39 ` Marc Gonzalez
2015-11-13 15:26 ` Thomas Gleixner
2015-11-13 15:26 ` Thomas Gleixner
2015-11-13 15:39 ` Marc Gonzalez [this message]
2015-11-13 15:39 ` Marc Gonzalez
2015-11-17 12:22 ` Daniel Lezcano
2015-11-17 12:22 ` Daniel Lezcano
2015-11-17 12:48 ` Marc Gonzalez
2015-11-17 12:48 ` Marc Gonzalez
2015-11-17 13:08 ` Måns Rullgård
2015-11-17 13:08 ` Måns Rullgård
2015-11-17 13:11 ` Daniel Lezcano
2015-11-17 13:11 ` Daniel Lezcano
2015-11-13 13:33 ` Marc Gonzalez
2015-11-13 14:18 ` Daniel Lezcano
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=5646041E.4040209@sigmadesigns.com \
--to=marc_gonzalez@sigmadesigns.com \
--cc=linux-arm-kernel@lists.infradead.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 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.