From: "Ulrich Drepper" Date: Fri, 21 Apr 2006 14:32:43 +0000 Subject: [KJ] Re: [PATCH] Extending getrusage Message-Id: List-Id: References: <20060420162140.0a03e227.akpm@osdl.org> <20060421074129.GA31972@outpost.ds9a.nl> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Claudio Scordino 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 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. _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.osdl.org https://lists.osdl.org/mailman/listinfo/kernel-janitors