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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <4F4C983002000078000751AE@nat28.tlf.novell.com>
Date:	Tue, 28 Feb 2012 08:02:40 +0000
From:	"Jan Beulich" <JBeulich@...e.com>
To:	"Andrew Morton" <akpm@...ux-foundation.org>
Cc:	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] consolidate WARN_...ONCE() static variables

>>> On 28.02.12 at 08:44, Andrew Morton <akpm@...ux-foundation.org> wrote:
> On Tue, 28 Feb 2012 07:41:54 +0000 "Jan Beulich" <JBeulich@...e.com> wrote:
> 
>> >>> On 28.02.12 at 01:03, Andrew Morton <akpm@...ux-foundation.org> wrote:
>> > On Mon, 27 Feb 2012 15:10:34 +0000
>> > "Jan Beulich" <JBeulich@...e.com> wrote:
>> > 
>> >> Due to the alignment of following variables, these typically consume
>> >> more than just the single byte that 'bool' requires, and as there are
>> >> a few hundred instances, the cache pollution (not so much the waste of
>> >> memory) sums up. Put these variables into their own section, outside
>> >> of any half way frequently used memory range.
>> >> 
>> >> v2: Do the same also to the __warned variable of rcu_lockdep_assert().
>> >> (Don't, however, include the ones used by printk_once() and alike, as
>> >> they can potentially be hot.)
>> > 
>> > I have a bad feeling that I still don't understand this patch.  Ho hum.
>> > 
>> > What are the rules for the new .data.unlikely section?  When should
>> > people put variables into this section?  Perhaps we can document this
>> > somewhere?
>> 
>> If I knew the "where" part of this, I could put together a few sentences.
>> I just grep-ed through Documentation/, without finding e.g. any rules
>> or guidelines for using {,un}likely()...
>>
> 
> At the definition site in vmlinux.lds?

Sorry, Andrew, but this makes no sense to me. For one, vmlinux.lds{,h}
don't define anything, they merely gather together all input sections.
Second, the very similar use of .text.unlikely there isn't being explained
in any way either (which makes sense given that that's a compiler
generated section, which I just derived the new section's name from).

If anything, I would expect a place where all the special sections (.init*,
.exit*, etc) are being explained, but this (if existing at all) is scattered
around. While I don't mind adding a few words to something that
already exists, I'm not really eager to write something from scratch.

Finally, if we're really looking forward to having this used in a broader
manner (and particularly with objects wider than bool), then the
section name should get changed again anyway (and perhaps some
further abstraction be created): The goal of the patch is not only to
get the symbols out of potentially hot cache lines, but (secondary,
but nevertheless) also to avoid the non-negligible waste of space due
to padding (taking into consideration that the compiler doesn't really
do a good job in this regard, nor does it make meaningful attempts
at providing the necessary infrastructure for doing so manually).

Jan

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