From: Joe Perches <joe@perches.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Fabian Frederick <fabf@skynet.be>,
linux-kernel <linux-kernel@vger.kernel.org>,
"John W. Linville" <linville@tuxdriver.com>,
akpm <akpm@linux-foundation.org>
Subject: Re: [PATCH 1/1] net/wireless/ibss.c: replace memcpy by ether_addr_copy
Date: Mon, 12 May 2014 12:17:57 -0700 [thread overview]
Message-ID: <1399922277.9240.50.camel@joe-AO725> (raw)
In-Reply-To: <1399920710.4337.26.camel@jlt4.sipsolutions.net>
On Mon, 2014-05-12 at 20:51 +0200, Johannes Berg wrote:
> On Mon, 2014-05-12 at 11:07 -0700, Joe Perches wrote:
> > On Mon, 2014-05-12 at 20:00 +0200, Fabian Frederick wrote:
> > > On Mon, 12 May 2014 10:50:25 -0700
> > > Joe Perches <joe@perches.com> wrote:
> > > > On Mon, 2014-05-12 at 19:30 +0200, Fabian Frederick wrote:
> > > > > This patch also fixes some comment checkpatch warnings
> > > > For all the patches that replace memcpy(foo, bar, ETH_ALEN)
> > > > with ether_addr_copy, did you use a tool to verify both
> > > > arguments are __aligned(2) or did you do the verification
> > > > visually?
> > > I only replaced ETH_ALEN/memcpy .
> > > AFAICS ETH_ALEN is defined 6 ...
> >
> > The difference here is that both arguments to
> > ether_addr_copy, like all the is_<foo>_ether_addr
> > helpers, must be __aligned(2). memcpy has
> > no alignment requirement.
> >
> > Please verify that all these changes are to
> > __aligned(2) arguments.
>
> Seriously though, who cares. Only two of these patches really touch
> paths where performance matters - and one of those is the lib80211 one
> which is practically only used for certain ancient Intel devices, which
> probably don't run on anything but IA where I'd guess the whole thing
> doesn't really matter anyway.
>
> I certainly don't see the benefit in changing all those other files,
> particularly since it's not just that we have to verify alignment *now*,
> we also have to add alignment attributes so that we don't break
> alignment in the future.
The same alignment requirements exist in quite a
lot of the code so I don't see that as much of a
continuing problem.
It's more of an initial conversion problem.
> Additionally doesn't even really save much typing:
>
> memcpy(x, y, ETH_ALEN);
> ether_addr_copy(x, y);
To me the general benefit isn't in the reduced
source code size, but small improvements for
ARM both in code size and execution speed.
I'm not sure it's worth even the initial conversion
verification costs though. It's quite tedious to
go through the call trees and I don't know of an
automated way to do that.
next prev parent reply other threads:[~2014-05-12 19:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-12 17:30 Fabian Frederick
2014-05-12 17:50 ` Joe Perches
2014-05-12 18:00 ` Fabian Frederick
2014-05-12 18:07 ` Joe Perches
2014-05-12 18:51 ` Johannes Berg
2014-05-12 19:17 ` Joe Perches [this message]
2014-05-13 7:30 ` Johannes Berg
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=1399922277.9240.50.camel@joe-AO725 \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=fabf@skynet.be \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linville@tuxdriver.com \
/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
all inboxes | Powered by JetHome®