Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752141AbbFMLSP (ORCPT ); Sat, 13 Jun 2015 07:18:15 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:33738 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751504AbbFMLSE (ORCPT ); Sat, 13 Jun 2015 07:18:04 -0400 MIME-Version: 1.0 In-Reply-To: <1434104217.1495.74.camel@twins> References: <1434099316-29749-1-git-send-email-fredrik.markstrom@gmail.com> <1434099316-29749-2-git-send-email-fredrik.markstrom@gmail.com> <1434104217.1495.74.camel@twins> From: =?UTF-8?Q?Fredrik_Markstr=C3=B6m?= Date: Sat, 13 Jun 2015 13:17:32 +0200 Message-ID: Subject: Re: [PATCH 1/1] cputime: Make the reported utime+stime correspond to the actual runtime. To: Peter Zijlstra Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, Rik van Riel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1482 Lines: 39 Resending beause it bounced of linux-kernel (google inbox sends everything as html) ! Thanks for your quick response, I'll elaborate on the Changelog. Regarding the global spinlock I considered adding it to task_struct and signal_struct. My reasoning not to do it, flawed or not, was that I thought the risk for congestion and cache line bouncing would be small given the following assumptions: 1. As far as I understand neither of the callers are typically called very frequently. (procfs, k_getrusage, wait_task_zombie and sys_times) 2 The and the time spent in the lock region is small. Did I have bad luck when thinking :) or do you still think it's better to add the locks to the structs above ? /Fredrik On Fri, Jun 12, 2015 at 12:16 PM, Peter Zijlstra wrote: > On Fri, 2015-06-12 at 10:55 +0200, Fredrik Markstrom wrote: >> The scaling mechanism might sometimes cause top to report >100% >> (sometimes > 1000%) cpu usage for a single thread. This patch makes >> sure that stime+utime corresponds to the actual runtime of the thread. > > This Changelog is inadequate, it does not explain the actual problem. > >> +static DEFINE_SPINLOCK(prev_time_lock); > > global (spin)locks are bad. -- /Fredrik -- 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/