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  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]
Date:	Mon, 16 Jun 2014 16:18:04 -0700
From:	Andrew Morton <>
To:	Michal Nazarewicz <>
Cc:	Steven Rostedt <>,
	Hagen Paul Pfeifer <>,
Subject: Re: [PATCH] include: kernel.h: rewrite min3, max3 and clamp using
 min and max

On Mon, 16 Jun 2014 23:07:22 +0200 Michal Nazarewicz <> wrote:

> It appears that gcc is better at optimising a double call to min
> and max rather than open coded min3 and max3.  This can be observed
> here:
> ...
> Furthermore, after ___make allmodconfig && make bzImage modules___ this is the
> comparison of image and modules sizes:
>     # Without this patch applied
>     $ ls -l arch/x86/boot/bzImage **/*.ko |awk '{size += $5} END {print size}'
>     350715800
>     # With this patch applied
>     $ ls -l arch/x86/boot/bzImage **/*.ko |awk '{size += $5} END {print size}'
>     349856528

We saved nearly a megabyte by optimising min3(), max3() and clamp()? 

I'm counting a grand total of 182 callsites for those macros.  So the
saving is 4700 bytes per invokation?  I don't believe it...

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists