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]
Message-Id: <20091116.190922.182816918.davem@davemloft.net>
Date:	Mon, 16 Nov 2009 19:09:22 -0800 (PST)
From:	David Miller <davem@...emloft.net>
To:	gorcunov@...il.com
Cc:	hpa@...or.com, mingo@...e.hu, travis@....com, tglx@...utronix.de,
	akpm@...ux-foundation.org, heiko.carstens@...ibm.com,
	rdreier@...co.com, rdunlap@...otime.net, tj@...nel.org,
	andi@...stfloor.org, gregkh@...e.de, yhlu.kernel@...il.com,
	rientjes@...gle.com, rostedt@...dmis.org, rusty@...tcorp.com.au,
	seto.hidetoshi@...fujitsu.com, steiner@....com, fweisbec@...il.com,
	x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/6] INIT: Limit the number of per cpu calibration
 bootup messages

From: Cyrill Gorcunov <gorcunov@...il.com>
Date: Tue, 17 Nov 2009 00:50:52 +0300

> On Mon, Nov 16, 2009 at 01:46:07PM -0800, H. Peter Anvin wrote:
>> On 11/16/2009 01:43 PM, Cyrill Gorcunov wrote:
>> > 
>> > It seems we have one
>> > 
>> > 	arch/x86/kernel/setup.c:125:unsigned int boot_cpu_id __read_mostly;
>> > 
>> > 	-- Cyrill
>> 
>> We probably should make it an inline function so that if other arches
>> want to define it to be a constant or some other kind of special thing
>> they can.
>
> IA-64 and SPARC already has this variable. But boot_cpu_id() as an
> inline function seem to be more natural/portable ineed.

Only 32-bit SPARC actually has it.  On sparc64 we have no reason to
remember which processor was the boot cpu, and remembering it merely
for the sake of only printing out the bogomips message once seems a
bit excessive?

How about:

	static bool printed;

	if (!printed) {
		printk(...);
		printed = true;
	}

Or, alternatively, use an atomic_t instead of a bool if you think
races matter this early in the boot process.
--
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