* Re: [PATCH] sched_clock: add data pointer argument to read callback
[not found] <1444427858-576-1-git-send-email-mans@mansr.com>
@ 2015-10-09 23:20 ` Russell King - ARM Linux
[not found] ` <20151009232015.GC32536-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-10-11 20:40 ` Thomas Gleixner
[not found] ` <1444427858-576-1-git-send-email-mans-2StjZFpD7GcAvxtiuMwx3w@public.gmane.org>
2 siblings, 1 reply; 7+ messages in thread
From: Russell King - ARM Linux @ 2015-10-09 23:20 UTC (permalink / raw)
To: Mans Rullgard
Cc: linux-arm-kernel, linux-kernel, linux-omap, linux-cris-kernel,
linux-mips, linux-xtensa, kernel, linux-rpi-kernel,
linux-samsung-soc, linux-tegra
On Fri, Oct 09, 2015 at 10:57:35PM +0100, Mans Rullgard wrote:
> This passes a data pointer specified in the sched_clock_register()
> call to the read callback allowing simpler implementations thereof.
>
> In this patch, existing uses of this interface are simply updated
> with a null pointer.
This is a bad description. It tells us what the patch is doing,
(which we can see by reading the patch) but not _why_. Please include
information on why the change is necessary - describe what you are
trying to achieve.
I generally don't accept patches what add new stuff to the kernel with
no users of that new stuff - that's called experience, experience of
people who submit stuff like that, and then vanish leaving their junk
in the kernel without any users. Please ensure that this gets a user
very quickly, or better still, submit this patch as part of a series
which makes use of it.
Also, copying soo many people is guaranteed to be silently dropped by
mailing lists.
--
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] sched_clock: add data pointer argument to read callback
[not found] ` <20151009232015.GC32536-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
@ 2015-10-09 23:48 ` Måns Rullgård
2015-10-09 23:54 ` Russell King - ARM Linux
0 siblings, 1 reply; 7+ messages in thread
From: Måns Rullgård @ 2015-10-09 23:48 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-omap-u79uwXL29TY76Z2rM5mHXA, linux-cris-kernel-VrBV9hrLPhE,
linux-mips-6z/3iImG2C8G8FEW9MqTrA,
linux-xtensa-PjhNF2WwrV/0Sa2dR60CXw,
kernel-F5mvAk5X5gdBDgjK7y7TUQ,
linux-rpi-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
Russell King - ARM Linux <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org> writes:
> On Fri, Oct 09, 2015 at 10:57:35PM +0100, Mans Rullgard wrote:
>> This passes a data pointer specified in the sched_clock_register()
>> call to the read callback allowing simpler implementations thereof.
>>
>> In this patch, existing uses of this interface are simply updated
>> with a null pointer.
>
> This is a bad description. It tells us what the patch is doing,
> (which we can see by reading the patch) but not _why_. Please include
> information on why the change is necessary - describe what you are
> trying to achieve.
Currently most of the callbacks use a global variable to store the
address of a counter register. This has several downsides:
- Loading the address of a global variable can be more expensive than
keeping a pointer next to the function pointer.
- It makes it impossible to have multiple instances of a driver call
sched_clock_register() since the caller can't know which clock will
win in the end.
- Many of the existing callbacks are practically identical and could be
replaced with a common generic function if it had a pointer argument.
If I've missed something that makes this a stupid idea, please tell.
--
Måns Rullgård
mans-2StjZFpD7GcAvxtiuMwx3w@public.gmane.org
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] sched_clock: add data pointer argument to read callback
2015-10-09 23:48 ` Måns Rullgård
@ 2015-10-09 23:54 ` Russell King - ARM Linux
2015-10-10 0:42 ` Måns Rullgård
0 siblings, 1 reply; 7+ messages in thread
From: Russell King - ARM Linux @ 2015-10-09 23:54 UTC (permalink / raw)
To: Måns Rullgård
Cc: linux-arm-kernel, linux-kernel, linux-omap, linux-cris-kernel,
linux-mips, linux-xtensa, kernel, linux-rpi-kernel,
linux-samsung-soc, linux-tegra
On Sat, Oct 10, 2015 at 12:48:22AM +0100, Måns Rullgård wrote:
> Russell King - ARM Linux <linux@arm.linux.org.uk> writes:
>
> > On Fri, Oct 09, 2015 at 10:57:35PM +0100, Mans Rullgard wrote:
> >> This passes a data pointer specified in the sched_clock_register()
> >> call to the read callback allowing simpler implementations thereof.
> >>
> >> In this patch, existing uses of this interface are simply updated
> >> with a null pointer.
> >
> > This is a bad description. It tells us what the patch is doing,
> > (which we can see by reading the patch) but not _why_. Please include
> > information on why the change is necessary - describe what you are
> > trying to achieve.
>
> Currently most of the callbacks use a global variable to store the
> address of a counter register. This has several downsides:
>
> - Loading the address of a global variable can be more expensive than
> keeping a pointer next to the function pointer.
>
> - It makes it impossible to have multiple instances of a driver call
> sched_clock_register() since the caller can't know which clock will
> win in the end.
>
> - Many of the existing callbacks are practically identical and could be
> replaced with a common generic function if it had a pointer argument.
>
> If I've missed something that makes this a stupid idea, please tell.
So my next question is whether you intend to pass an iomem pointer
through this, or a some kind of structure, or both. It matters,
because iomem pointers have a __iomem attribute to keep sparse
happy. Having to force that attribute on and off pointers is frowned
upon, as it defeats the purpose of the sparse static checker.
--
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] sched_clock: add data pointer argument to read callback
2015-10-09 23:54 ` Russell King - ARM Linux
@ 2015-10-10 0:42 ` Måns Rullgård
2015-10-10 15:33 ` Russell King - ARM Linux
0 siblings, 1 reply; 7+ messages in thread
From: Måns Rullgård @ 2015-10-10 0:42 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: linux-arm-kernel, linux-kernel, linux-omap, linux-cris-kernel,
linux-mips, linux-xtensa, kernel, linux-rpi-kernel,
linux-samsung-soc, linux-tegra
Russell King - ARM Linux <linux@arm.linux.org.uk> writes:
> On Sat, Oct 10, 2015 at 12:48:22AM +0100, Måns Rullgård wrote:
>> Russell King - ARM Linux <linux@arm.linux.org.uk> writes:
>>
>> > On Fri, Oct 09, 2015 at 10:57:35PM +0100, Mans Rullgard wrote:
>> >> This passes a data pointer specified in the sched_clock_register()
>> >> call to the read callback allowing simpler implementations thereof.
>> >>
>> >> In this patch, existing uses of this interface are simply updated
>> >> with a null pointer.
>> >
>> > This is a bad description. It tells us what the patch is doing,
>> > (which we can see by reading the patch) but not _why_. Please include
>> > information on why the change is necessary - describe what you are
>> > trying to achieve.
>>
>> Currently most of the callbacks use a global variable to store the
>> address of a counter register. This has several downsides:
>>
>> - Loading the address of a global variable can be more expensive than
>> keeping a pointer next to the function pointer.
>>
>> - It makes it impossible to have multiple instances of a driver call
>> sched_clock_register() since the caller can't know which clock will
>> win in the end.
>>
>> - Many of the existing callbacks are practically identical and could be
>> replaced with a common generic function if it had a pointer argument.
>>
>> If I've missed something that makes this a stupid idea, please tell.
>
> So my next question is whether you intend to pass an iomem pointer
> through this, or a some kind of structure, or both. It matters,
> because iomem pointers have a __iomem attribute to keep sparse
> happy. Having to force that attribute on and off pointers is frowned
> upon, as it defeats the purpose of the sparse static checker.
So this is an instance where tools like sparse get in the way of doing
the simplest, most efficient, and obviously correct thing. Who wins in
such cases?
--
Måns Rullgård
mans@mansr.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] sched_clock: add data pointer argument to read callback
2015-10-10 0:42 ` Måns Rullgård
@ 2015-10-10 15:33 ` Russell King - ARM Linux
0 siblings, 0 replies; 7+ messages in thread
From: Russell King - ARM Linux @ 2015-10-10 15:33 UTC (permalink / raw)
To: Måns Rullgård
Cc: linux-arm-kernel, linux-kernel, linux-omap, linux-cris-kernel,
linux-mips, linux-xtensa, kernel, linux-rpi-kernel,
linux-samsung-soc, linux-tegra
On Sat, Oct 10, 2015 at 01:42:47AM +0100, Måns Rullgård wrote:
> Russell King - ARM Linux <linux@arm.linux.org.uk> writes:
>
> > On Sat, Oct 10, 2015 at 12:48:22AM +0100, Måns Rullgård wrote:
> >> Russell King - ARM Linux <linux@arm.linux.org.uk> writes:
> >>
> >> > On Fri, Oct 09, 2015 at 10:57:35PM +0100, Mans Rullgard wrote:
> >> >> This passes a data pointer specified in the sched_clock_register()
> >> >> call to the read callback allowing simpler implementations thereof.
> >> >>
> >> >> In this patch, existing uses of this interface are simply updated
> >> >> with a null pointer.
> >> >
> >> > This is a bad description. It tells us what the patch is doing,
> >> > (which we can see by reading the patch) but not _why_. Please include
> >> > information on why the change is necessary - describe what you are
> >> > trying to achieve.
> >>
> >> Currently most of the callbacks use a global variable to store the
> >> address of a counter register. This has several downsides:
> >>
> >> - Loading the address of a global variable can be more expensive than
> >> keeping a pointer next to the function pointer.
> >>
> >> - It makes it impossible to have multiple instances of a driver call
> >> sched_clock_register() since the caller can't know which clock will
> >> win in the end.
> >>
> >> - Many of the existing callbacks are practically identical and could be
> >> replaced with a common generic function if it had a pointer argument.
> >>
> >> If I've missed something that makes this a stupid idea, please tell.
> >
> > So my next question is whether you intend to pass an iomem pointer
> > through this, or a some kind of structure, or both. It matters,
> > because iomem pointers have a __iomem attribute to keep sparse
> > happy. Having to force that attribute on and off pointers is frowned
> > upon, as it defeats the purpose of the sparse static checker.
>
> So this is an instance where tools like sparse get in the way of doing
> the simplest, most efficient, and obviously correct thing. Who wins in
> such cases?
In that case, NAK on the patch. I don't have time for your stupid games.
--
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] sched_clock: add data pointer argument to read callback
[not found] <1444427858-576-1-git-send-email-mans@mansr.com>
2015-10-09 23:20 ` [PATCH] sched_clock: add data pointer argument to read callback Russell King - ARM Linux
@ 2015-10-11 20:40 ` Thomas Gleixner
[not found] ` <1444427858-576-1-git-send-email-mans-2StjZFpD7GcAvxtiuMwx3w@public.gmane.org>
2 siblings, 0 replies; 7+ messages in thread
From: Thomas Gleixner @ 2015-10-11 20:40 UTC (permalink / raw)
To: Mans Rullgard
Cc: Sekhar Nori, Kevin Hilman, Russell King, Hartley Sweeten,
Ryan Mallon, Hans Ulli Kroll, Imre Kaloz, Krzysztof Halasa,
Eric Miao, Haojian Zhuang, Tony Lindgren, Jason Cooper,
Andrew Lunn, Sebastian Hesselbarth, Gregory Clement,
Mikael Starvik, Jesper Nilsson, Michal Simek, Ralf Baechle
Mans,
On Fri, 9 Oct 2015, Mans Rullgard wrote:
> This passes a data pointer specified in the sched_clock_register()
> call to the read callback allowing simpler implementations thereof.
>
> In this patch, existing uses of this interface are simply updated
> with a null pointer.
I can't see any simplifaction of any driver. This is called in hot
pathes and that extra unused argument just adds register pressure for
no value.
What are you actually trying to solve?
Thanks,
tglx
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] sched_clock: add data pointer argument to read callback
[not found] ` <1444427858-576-1-git-send-email-mans-2StjZFpD7GcAvxtiuMwx3w@public.gmane.org>
@ 2015-10-12 13:02 ` Gregory CLEMENT
0 siblings, 0 replies; 7+ messages in thread
From: Gregory CLEMENT @ 2015-10-12 13:02 UTC (permalink / raw)
To: Mans Rullgard
Cc: Sekhar Nori, Kevin Hilman, Russell King, Hartley Sweeten,
Ryan Mallon, Hans Ulli Kroll, Imre Kaloz, Krzysztof Halasa,
Eric Miao, Haojian Zhuang, Tony Lindgren, Jason Cooper,
Andrew Lunn, Sebastian Hesselbarth, Mikael Starvik,
Jesper Nilsson, Michal Simek, Ralf Baechle, Chris Zankel,
Max Filippov, Daniel Lezcano, Thomas Gleixner,
Srinivas Kandagatla <srinivas.kanda>
Hi Mans,
On ven., oct. 09 2015, Mans Rullgard <mans-2StjZFpD7GcAvxtiuMwx3w@public.gmane.org> wrote:
> This passes a data pointer specified in the sched_clock_register()
> call to the read callback allowing simpler implementations thereof.
>
> In this patch, existing uses of this interface are simply updated
> with a null pointer.
>
> Signed-off-by: Mans Rullgard <mans-2StjZFpD7GcAvxtiuMwx3w@public.gmane.org>
> ---
[...]
> diff --git a/drivers/clocksource/time-armada-370-xp.c b/drivers/clocksource/time-armada-370-xp.c
> index 2162796..a13b73b 100644
> --- a/drivers/clocksource/time-armada-370-xp.c
> +++ b/drivers/clocksource/time-armada-370-xp.c
> @@ -92,7 +92,7 @@ static void local_timer_ctrl_clrset(u32 clr, u32 set)
> local_base + TIMER_CTRL_OFF);
> }
>
> -static u64 notrace armada_370_xp_read_sched_clock(void)
> +static u64 notrace armada_370_xp_read_sched_clock(void *data)
> {
> return ~readl(timer_base + TIMER0_VAL_OFF);
> }
> @@ -290,7 +290,8 @@ static void __init armada_370_xp_timer_common_init(struct device_node *np)
> /*
> * Set scale and timer for sched_clock.
> */
> - sched_clock_register(armada_370_xp_read_sched_clock, 32, timer_clk);
> + sched_clock_register(armada_370_xp_read_sched_clock, 32, timer_clk,
> + NULL);
>
> clocksource_mmio_init(timer_base + TIMER0_VAL_OFF,
> "armada_370_xp_clocksource",
For the time-armada-370-xp.c file:
Acked-by: Gregory CLEMENT <gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
Thanks,
Gregory
--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-10-12 13:02 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1444427858-576-1-git-send-email-mans@mansr.com>
2015-10-09 23:20 ` [PATCH] sched_clock: add data pointer argument to read callback Russell King - ARM Linux
[not found] ` <20151009232015.GC32536-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2015-10-09 23:48 ` Måns Rullgård
2015-10-09 23:54 ` Russell King - ARM Linux
2015-10-10 0:42 ` Måns Rullgård
2015-10-10 15:33 ` Russell King - ARM Linux
2015-10-11 20:40 ` Thomas Gleixner
[not found] ` <1444427858-576-1-git-send-email-mans-2StjZFpD7GcAvxtiuMwx3w@public.gmane.org>
2015-10-12 13:02 ` Gregory CLEMENT
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).