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:	Wed, 21 May 2008 15:50:22 +0200
From:	Peter 1 Oberparleiter <Peter.Oberparleiter@...ibm.com>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Harvey Harrison <harvey.harrison@...il.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] consolidate all within() implementations

Peter Zijlstra <a.p.zijlstra@...llo.nl> wrote on 21.05.2008 12:48:52:

> On Wed, 2008-05-21 at 12:33 +0200, Peter 1 Oberparleiter wrote:
> > Peter Zijlstra <a.p.zijlstra@...llo.nl> wrote on 21.05.2008 12:04:26:

> peter@...py:~/tmp$ gcc -S -Os cmp*.c
> peter@...py:~/tmp$ ls -la cmp*.o
> -rw-r--r-- 1 peter peter 752 2008-05-21 12:43 cmp2.o
> -rw-r--r-- 1 peter peter 743 2008-05-21 12:43 cmp.o

Yeah, but!

[oberpar@...al cmp]$ gcc -c -O2 cmp*.c
[oberpar@...al cmp]$ ls -la cmp*.o
-rw-r--r-- 1 oberpar oberpar 1352 May 21 15:40 cmp2.o
-rw-r--r-- 1 oberpar oberpar 1408 May 21 15:40 cmp.o

:)

> Also look at the .s output and notice mine doesn't have any additional
> branches ;-)

It really boils down to the question whether you want to trade
a bit of obviousness for a bit of efficiency/clever programming.
I vote for keeping the former.

> > > static inline int
> > > addr_within(const void *add, const void *start, const void *end)
> > > {
> > >    return addr_within_len(addr, start, 
> > >          (unsigned long)end - (unsigned long)start);
> > > }
> > 
> > For empty ranges (start > end), this produces different (less 
expected)
> > results than the previous version.
> 
> agreed, do we care about those?

Why not plan for the unexpected when it comes at little cost?


Regards,
  Peter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ