Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1362275 > unrolled thread

Re: [PATCH] Staging: wlan-ng: moved memset() calls after copy_from_user() call

Started byGreg KH <gregkh@linuxfoundation.org>
First post2016-03-22 03:10 +0100
Last post2016-03-22 14:30 +0100
Articles 2 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] Staging: wlan-ng: moved memset() calls after  copy_from_user() call Greg KH <gregkh@linuxfoundation.org> - 2016-03-22 03:10 +0100
    Re: [PATCH] Staging: wlan-ng: moved memset() calls after  copy_from_user() call Greg KH <gregkh@linuxfoundation.org> - 2016-03-22 14:30 +0100

#1362275 — Re: [PATCH] Staging: wlan-ng: moved memset() calls after copy_from_user() call

FromGreg KH <gregkh@linuxfoundation.org>
Date2016-03-22 03:10 +0100
SubjectRe: [PATCH] Staging: wlan-ng: moved memset() calls after copy_from_user() call
Message-ID<rfjVD-67W-3@gated-at.bofh.it>
On Tue, Mar 15, 2016 at 09:53:15PM +0200, Claudiu Beznea wrote:
> This patch moves memset() calls from p80211netdev_ethtool()
> after copy_from_user() call in order to avoid unnecessary
> instruction in case copy_from_user() fails.

Does that really matter?  If an error happens, then we are on a "slow
path" and the extra memset didn't matter at all.  Don't move code around
for no good reason, and if you think it makes things faster, then you
have to be able to prove it somehow :)

thanks,

greg k-h

[toc] | [next] | [standalone]


#1362742

FromGreg KH <gregkh@linuxfoundation.org>
Date2016-03-22 14:30 +0100
Message-ID<rfuxI-4WW-7@gated-at.bofh.it>
In reply to#1362275
On Tue, Mar 22, 2016 at 03:02:00PM +0200, Claudiu Beznea wrote:
> I was guided by the principle that every instruction counts, no matter the
> execution context.

But you have to be able to actually measure the difference, and here you
can't.

thanks,

greg k-h

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web