From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758635AbZBBSfe (ORCPT ); Mon, 2 Feb 2009 13:35:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752775AbZBBSfZ (ORCPT ); Mon, 2 Feb 2009 13:35:25 -0500 Received: from bombadil.infradead.org ([18.85.46.34]:47724 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753853AbZBBSfY (ORCPT ); Mon, 2 Feb 2009 13:35:24 -0500 Subject: Re: [Bugme-new] [Bug 12562] New: High overhead while switching or synchronizing threads on different cores From: Peter Zijlstra To: mtk.manpages@gmail.com Cc: Mike Galbraith , Thomas Pilarski , Andrew Morton , Gregory Haskins , bugme-daemon@bugzilla.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: <1233229028.4495.34.camel@laptop> <1233237934.11129.183.camel@bugs-laptop> <1233302270.6061.9.camel@marge.simson.net> <1233560635.4126.18.camel@localhost.localdomain> <1233562763.4787.71.camel@laptop> <1233563600.3669.36.camel@localhost.localdomain> <1233564731.21378.9.camel@marge.simson.net> <1233564920.4787.108.camel@laptop> <1233576952.4787.152.camel@laptop> Content-Type: text/plain Date: Mon, 02 Feb 2009 19:35:14 +0100 Message-Id: <1233599714.4787.221.camel@laptop> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2009-02-03 at 07:29 +1300, Michael Kerrisk wrote: > Hi Peter, > > On Tue, Feb 3, 2009 at 1:15 AM, Peter Zijlstra wrote: > > On Mon, 2009-02-02 at 09:55 +0100, Peter Zijlstra wrote: > > > >> Ah, that was a good clue, apparently all you need to so it use > >> random_r() and provide your own state and all should be well. > > > > Michael, would it make sense to add the random_r() family to the "SEE > > ALSO" section of the random() man page? > > > > (Admittedly, my random() manpage is ancient: 2008-03-07, so it might be > > this is already the case, in which case, ignore me :) > > (Up-to-date version of the pages can always be found online at the > location in the .sig.) Ah, I'll try to remember that. > Well, the man page already had this text under notes: > > This function should not be used in cases where multiple > threads use random() and the behavior should be reproducible. > Use random_r(3) for that purpose. Yeah, but I found it eventually, but I generally don't read a full manpage when I'm looking for related functions, only the SEE ALSO section. > But it certainly doesn't hurt to have random_r(3) also listed under > the SEE ALSO, and I've added it for man-pages-3.18. Thanks.