lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 16 Jan 2014 12:00:01 -0800
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Michael Dalton <mwdalton@...gle.com>
Cc:	Ben Hutchings <bhutchings@...arflare.com>,
	"David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
	Eric Dumazet <edumazet@...gle.com>,
	Rusty Russell <rusty@...tcorp.com.au>,
	"Michael S. Tsirkin" <mst@...hat.com>,
	Jason Wang <jasowang@...hat.com>,
	lf-virt <virtualization@...ts.linux-foundation.org>
Subject: Re: [PATCH net-next v3 4/5] net-sysfs: add support for
 device-specific rx queue sysfs attributes

On Thu, 2014-01-16 at 11:51 -0800, Michael Dalton wrote:
> On Thu, Jan 16, 2014 Ben Hutchings <bhutchings@...arflare.com> wrote:
> > It's simpler but we don't know if it's faster (and I don't believe that
> > matters for the current usage).
> >
> > If one of these functions starts to be used in the data path, at that
> > point it could be worth optimising, e.g. by doing a test for queue 0 and
> > only then doing the pointer arithmetic with its implicit division.
> Good catch, my statement above is incorrect. We don't know if this change
> is a performance win, and it does introduce an implicit div. I agree this
> function is not currently performance critical and is used only by for
> reporting values to sysfs.

gcc usually do not emit a divide instruction to perform a divide by a
constant, but uses a reciprocal operation (basically a multiply and a
shift)

So I am pretty sure this is faster than the loop.


--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ