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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1395072992.9668.59.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Mon, 17 Mar 2014 09:16:32 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	David Laight <David.Laight@...LAB.COM>
Cc:	'Thomas Graf' <tgraf@...g.ch>, David Miller <davem@...emloft.net>,
	John Fastabend <john.fastabend@...il.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH net-next] net: sched: use no more than one page in
 struct fw_head

On Mon, 2014-03-17 at 16:00 +0000, David Laight wrote:

> Actually the -Os forces the divide.

Yep, this might be the case.

> With -O3 the generated code I get for amd64 is a multiply by reciprocal
> to get the quotient followed by an open coded multiply by 0x1ff and
> then a subtract. 13 instructions, only a few of which are register renames
> or are non-dependant.

I think its more 4 arithmetic instructions : 2 multiplies, one shift,
one sub.

Note that when John adds an rcu_head, the 0x1ff becomes 0x1fd

   	89 f8                	mov    %edi,%eax
   	ba b3 21 c1 80       	mov    $0x80c121b3,%edx
   	f7 e2                	mul    %edx
   	c1 ea 08             	shr    $0x8,%edx
  	69 d2 fd 01 00 00    	imul   $0x1fd,%edx,%edx
  	29 d7                	sub    %edx,%edi
  	89 f8                	mov    %edi,%eax



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