From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753813Ab0CZQPQ (ORCPT ); Fri, 26 Mar 2010 12:15:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6625 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753149Ab0CZQPO (ORCPT ); Fri, 26 Mar 2010 12:15:14 -0400 Date: Fri, 26 Mar 2010 17:12:18 +0100 From: Stanislaw Gruszka To: Balbir Singh Cc: Oleg Nesterov , Andrew Morton , Americo Wang , "Eric W. Biederman" , Hidetoshi Seto , Ingo Molnar , Peter Zijlstra , Roland McGrath , Spencer Candland , linux-kernel@vger.kernel.org Subject: Re: [RFC,PATCH 1/2] cputimers/proc: do_task_stat()->task_times() can race with getrusage() Message-ID: <20100326161218.GA3169@dhcp-lab-161.englab.brq.redhat.com> References: <20100324204550.GA31777@redhat.com> <20100326035344.GQ3308@balbir.in.ibm.com> <20100326073723.GA2596@dhcp-lab-161.englab.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100326073723.GA2596@dhcp-lab-161.englab.brq.redhat.com> User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 26, 2010 at 08:37:23AM +0100, Stanislaw Gruszka wrote: > On Fri, Mar 26, 2010 at 09:23:44AM +0530, Balbir Singh wrote: > > * Oleg Nesterov [2010-03-24 21:45:50]: > > > > > do_task_stat()->task_times() can race with getrusage(), they both can > > > try to update task->prev_Xtime at the same time. > > > > > > Remove this bit of d180c5bc "sched: Introduce task_times() to replace > > > task_{u,s}time()". > > > > One of the reasons for adding this accuracy was to avoid sampling > > based noise and errors that occur with utime and stime. > > > > As long as there is no preemption during the assignment, I think we > > should be OK. > > > > I see two options > > > > 1. Disable preemption around assignment > That one sounds very good. No. Preemption will not help here. Stanislaw