From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932335AbWDUOcp (ORCPT ); Fri, 21 Apr 2006 10:32:45 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932337AbWDUOcp (ORCPT ); Fri, 21 Apr 2006 10:32:45 -0400 Received: from nz-out-0102.google.com ([64.233.162.203]:63420 "EHLO nz-out-0102.google.com") by vger.kernel.org with ESMTP id S932335AbWDUOco convert rfc822-to-8bit (ORCPT ); Fri, 21 Apr 2006 10:32:44 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=m3AHHcE4Q0GQ7bTODGPIbfaaO8UuCIm4I7UTDxfT6W1R9abs+T6jCTqjnaISWHPw2cLw1FZmitWNLAJKx57QZra/FbmXrlN/RSHozL/fmu6v5+q2q5fgL69UUzYnsdV30EtIoaaUHjEh6Zp2+Wc+lcimI6NpCUYBVG+USoznYKM= Message-ID: Date: Fri, 21 Apr 2006 07:32:43 -0700 From: "Ulrich Drepper" To: "Claudio Scordino" Subject: Re: [PATCH] Extending getrusage Cc: "Andrew Morton" , linux-kernel@vger.kernel.org, luto@myrealbox.com, alan@lxorguk.ukuu.org.uk, torvalds@osdl.org, kernel-janitors@lists.osdl.org, bert.hubert@netherlabs.nl In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Content-Disposition: inline References: <20060420162140.0a03e227.akpm@osdl.org> <20060421074129.GA31972@outpost.ds9a.nl> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On 4/21/06, Claudio Scordino wrote: > Recently, while writing some code at user level, I needed a fast way > to have such information about another process. That's not very specific. And one program isn't really a compelling reason. You should specify with some level of detail why you need that information and why you cannot depend on collaboration of the process you try to get the information for. > - return -EINVAL; > - return getrusage(current, who, ru); > + struct rusage r; > + struct task_struct *tsk = current; > + read_lock(&tasklist_lock); You are introducing scalability problems where there were none before. Even if there is some justification revealed in the end IMO the patch shouldn't be accepted in this form. You should not slow down the normal case of operation. If the current thread is observed the lock isn't needed.