[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20081028161642.GL1034@flint.arm.linux.org.uk>
Date: Tue, 28 Oct 2008 16:16:42 +0000
From: Russell King - ARM Linux <linux@....linux.org.uk>
To: Grant Likely <grant.likely@...retlab.ca>
Cc: Paulius Zaleckas <paulius.zaleckas@...tonika.lt>,
netdev@...r.kernel.org, linux-arm-kernel@...ts.arm.linux.org.uk,
linux-embedded@...r.kernel.org
Subject: Re: [PATCH] phylib: add mdio-gpio bus driver (v2)
On Tue, Oct 28, 2008 at 09:30:10AM -0600, Grant Likely wrote:
> On Tue, Oct 28, 2008 at 9:17 AM, Russell King - ARM Linux
> <linux@....linux.org.uk> wrote:
> > On Tue, Oct 28, 2008 at 07:08:06AM -0600, Grant Likely wrote:
> >> On Tue, Oct 28, 2008 at 1:46 AM, Paulius Zaleckas
> >> <paulius.zaleckas@...tonika.lt> wrote:
> >> > Grant Likely wrote:
> >> >> The IRQ array is fixed size. You can add it to the mdio_gpio_info
> >> >> structure and then just set the pointer here so that only one kzalloc
> >> >> is needed.
> >> >
> >> > It can be put in mdio_gpio_info, but please note that mdio_gpio_info is
> >> > allocated with kzalloc() and irq with kmalloc(), because there is no need
> >> > to fill this array with zeros(see below).
> >>
> >> Adding an additional 32 words to be zeroed in the mdio_gpio_info
> >> kzalloc is considerably cheaper than doing an additional kmalloc.
> >> Plus, once the array is zeroed it is then in the cache and so the
> >> filling it with -1 also becomes cheaper.
> >
> > Actually no, it doesn't become cheaper. You're making the assumption
> > that cache lines are allocated when memory is written to. This isn't
> > the case with the vast majority of ARM CPUs.
>
> Okay, I wasn't aware of that on ARM.
>
> However it is still true that increasing the size of the kzalloc is
> cheaper than doing 2 allocs.
Yes, that 'irq' array might as well be part of the same structure.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists