[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151009235441.GD32536@n2100.arm.linux.org.uk>
Date: Sat, 10 Oct 2015 00:54:41 +0100
From: Russell King - ARM Linux <linux@....linux.org.uk>
To: Måns Rullgård <mans@...sr.com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-omap@...r.kernel.org, linux-cris-kernel@...s.com,
linux-mips@...ux-mips.org, linux-xtensa@...ux-xtensa.org,
kernel@...inux.com, linux-rpi-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-tegra@...r.kernel.org
Subject: Re: [PATCH] sched_clock: add data pointer argument to read callback
On Sat, Oct 10, 2015 at 12:48:22AM +0100, Måns Rullgård wrote:
> Russell King - ARM Linux <linux@....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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists