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]
Date:	Tue, 15 Mar 2016 13:15:25 +0100
From:	Ingo Molnar <mingo@...nel.org>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Frédéric Weisbecker <fweisbec@...il.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] nohz: Change tick_dep_mask from 'unsigned long' to
 'unsigned int'


* Ingo Molnar <mingo@...nel.org> wrote:

> 
> Linus noticed that the new tick_dep_mask types introduced in:
> 
>   d027d45d8a17 ("nohz: New tick dependency mask")
> 
> ... are sloppily defined as 'unsigned long' - which is wasteful
> to carry just 4 bits and which may also create suboptimal data
> types on 64-bit systems with word alignment padding holes in them.
> 
> Fix this by changing the type to the more natural 'unsigned int'.
> 
> (The xchg_or() API will work fine with 'unsigned int' as well.)
> 
> Reported-by: Linus Torvalds <torvalds@...ux-foundation.org>
> Cc: Chris Metcalf <cmetcalf@...hip.com>
> Cc: Frederic Weisbecker <fweisbec@...il.com>
> Cc: Christoph Lameter <cl@...ux.com>
> Cc: Chris Metcalf <cmetcalf@...hip.com>
> Cc: Ingo Molnar <mingo@...nel.org>
> Cc: Luiz Capitulino <lcapitulino@...hat.com>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Rik van Riel <riel@...hat.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Viresh Kumar <viresh.kumar@...aro.org>
> Signed-off-by: Ingo Molnar <mingo@...nel.org>
> ---
>  include/linux/sched.h    |  4 ++--
>  kernel/time/tick-sched.c | 11 +++++------
>  2 files changed, 7 insertions(+), 8 deletions(-)

Hm, so the problem I did not consider is the following:

 triton:~/tip> git grep tick_dep_mask kernel | grep _bit
 kernel/time/tick-sched.c:       clear_bit(bit, &tick_dep_mask);
 kernel/time/tick-sched.c:       clear_bit(bit, &ts->tick_dep_mask);
 kernel/time/tick-sched.c:       clear_bit(bit, &tsk->tick_dep_mask);
 kernel/time/tick-sched.c:       clear_bit(bit, &sig->tick_dep_mask);

and the bitops natural type (and in fact the only supported bitops type) is 
'unsigned long'.

So it's not that easy to change a bitmask over to unsigned int.

Suggestions?

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ