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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1428218636-3780-1-git-send-email-hofrat@osadl.org>
Date:	Sun,  5 Apr 2015 09:23:53 +0200
From:	Nicholas Mc Guire <hofrat@...dl.org>
To:	Michal Marek <mmarek@...e.cz>
Cc:	Masahiro Yamada <yamada.m@...panasonic.com>,
	Sam Ravnborg <sam@...nborg.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	"H. Peter Alvin" <hpa@...or.com>, Joe Perches <joe@...ches.com>,
	John Stultz <john.stultz@...aro.org>,
	Andrew Hunter <ahh@...gle.com>, Paul Turner <pjt@...gle.com>,
	linux-kernel@...r.kernel.org, Nicholas Mc Guire <hofrat@...dl.org>
Subject: [PATCH 0/3] time: use __builtin_constant_p() in msecs_to_jiffies

In the overall kernel source there currently are
  2544 msecs_to_jiffies
  126  usecs_to_jiffies
and a few places that are using  var * HZ / 1000  constructs
which are not always safe (no check of corner cases) and should
be switched to msecs_to_jiffies (roughly 25 left).
Allowing gcc to fold constants for these calls that in most
cases are passing in constants (roughly 95%) has some potential
to improve performance (and should save a few bytes).

size impact:
 x86_64_defconfig:
  without patches vmlinux 24628843
  with patches    vmlinux 24628797
 ppc64_defconfig:
  without patches 27412024
  with patches    27412040 (no clue why it is bigger!)
 multi_v7_defconfig:
  without patches vmlinux.o 22901462
  with patches    vmlinux.o 22899843

 As the changes to the top level Kbuild will impact every architecture
 this is probably not enough testing - but should be suitable for a first 
 review.

 Once this is clean a patch for usecs_to_jiffies will be provided as well

The patch set:
 0001  moves timeconst.h from kernel/time/ to include/generated/ and makes
       it available early enough so that the build can use the constants
       for msecs_to_jiffies
 0002  rename msecs_to_jiffies to __msecs_to_jiffies, the only modification
       is that the < 0 is moved out.
       modified version of msecs_to_jiffies that checks for constant via 
       call to __builtin_constant_p() and calls __msecs_to_jiffies if it 
       can't determine that the argument is constant.
 0003  documentation update and reformatting to kernel-doc format  
--
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