From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>,
netdev@vger.kernel.org, linux-arm-kernel@lists.arm.linux.org.uk,
linux-embedded@vger.kernel.org
Subject: Re: [PATCH] phylib: add mdio-gpio bus driver (v2)
Date: Tue, 28 Oct 2008 16:16:42 +0000 [thread overview]
Message-ID: <20081028161642.GL1034@flint.arm.linux.org.uk> (raw)
In-Reply-To: <fa686aa40810280830i1a5a7b84u1dfa8cd97c6b1420@mail.gmail.com>
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@arm.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@teltonika.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.
next prev parent reply other threads:[~2008-10-28 16:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-27 10:53 [PATCH] phylib: add mdio-gpio bus driver (v2) Paulius Zaleckas
2008-10-27 14:37 ` Grant Likely
2008-10-27 16:41 ` David Brownell
2008-10-28 8:55 ` Paulius Zaleckas
2008-10-28 7:46 ` Paulius Zaleckas
2008-10-28 13:08 ` Grant Likely
2008-10-28 15:17 ` Russell King - ARM Linux
2008-10-28 15:30 ` Grant Likely
2008-10-28 16:16 ` Russell King - ARM Linux [this message]
2008-10-27 14:52 ` Mike Frysinger
2008-10-28 8:30 ` Paulius Zaleckas
2008-10-28 10:07 ` Mike Frysinger
2008-10-27 14:53 ` Mike Frysinger
2008-10-28 7:37 ` Paulius Zaleckas
2008-10-28 7:41 ` Mike Frysinger
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=20081028161642.GL1034@flint.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=grant.likely@secretlab.ca \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-embedded@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=paulius.zaleckas@teltonika.lt \
/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;
as well as URLs for NNTP newsgroup(s).