Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262256AbUFEXHO (ORCPT ); Sat, 5 Jun 2004 19:07:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262382AbUFEXHN (ORCPT ); Sat, 5 Jun 2004 19:07:13 -0400 Received: from x35.xmailserver.org ([69.30.125.51]:17796 "EHLO x35.xmailserver.org") by vger.kernel.org with ESMTP id S262256AbUFEXHM (ORCPT ); Sat, 5 Jun 2004 19:07:12 -0400 X-AuthUser: davidel@xmailserver.org Date: Sat, 5 Jun 2004 16:07:06 -0700 (PDT) From: Davide Libenzi X-X-Sender: davide@bigblue.dev.mdolabs.com To: Robert Love cc: Chris Wedgwood , Arjan van de Ven , Linus Torvalds , Russell Leighton , Kernel Mailing List Subject: Re: clone() <-> getpid() bug in 2.6? In-Reply-To: <1086475663.7940.50.camel@localhost> Message-ID: References: <40C1E6A9.3010307@elegant-software.com> <20040605205547.GD20716@devserv.devel.redhat.com> <20040605215346.GB29525@taniwha.stupidest.org> <1086475663.7940.50.camel@localhost> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 851 Lines: 28 On Sat, 5 Jun 2004, Robert Love wrote: > On Sat, 2004-06-05 at 14:53 -0700, Chris Wedgwood wrote: > > > glibc caches getpid() ?!? > > > > it's not like it's a slow syscall or used often > > It is almost certainly done to improve the speed of some stupid > microbenchmark - say, one that just calls getpid() repeatedly (simple > because it is NOT slow) to measure system call overhead. > > Or maybe libc uses the PID a lot internally. I don't know. > > But it sure seems wrong. It is likely used by pthread_self(), that is pretty much performance sensitive. I'd agree with Ulrich here. - Davide - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/