Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3698771imm; Mon, 6 Aug 2018 09:04:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfiTY/ZhlYFYwzXMoU9wC0ArCDW3wPEljDyvXeqfVnbJIYrOFcGFDS8rSzVGUZZdy5/Ykor X-Received: by 2002:a63:f953:: with SMTP id q19-v6mr14722279pgk.292.1533571486329; Mon, 06 Aug 2018 09:04:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533571486; cv=none; d=google.com; s=arc-20160816; b=GEx+drXlt5gTYA2Bf2APqcXWwNInYsL6ss7l1z//wDVLPf62srxtw9n9Yiq1T4c1iB fjbaGLKhUMHfldxDv8Vua5GzNk2zVO5HYOAdHb9pi+h0WQ0+bNG6srMhGFNRmAGuvx38 QXjvM1SgIh/XFyxbytr6Sl2a/EQ0BuceTBwXxRiOzU08CpcEK+1YcEi6br0RwQ1qtcY4 EDmf3CfQpTn7qLDV9OzM0ZqJz+qtF8Zw/X3kjgcU8WdstfoOQ7R8GW7PN02Pd8rLwPKd MpE4/ANXtQT228Zox+tA2RsIQe+KBirFu10hzedXOTJNfLMBWZx4n/TTiRs1WqG8NYBY tPsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=8IaTbGiI2kBzPlXkTibDxExERHMd3REdT8BW2Nz2qnY=; b=dx9aHQSw0EIRRjoBRYswY6xcbre4eg1eYoF8N75ZWhsaRoYk1OI9IKW4jNyNJALgRq nKcE8QZwkpkVqQZVl6JJtfq4r894CO+yHSQ+ilkYip3kP8v0c/+k//4kGvoGQQVZuFL3 juSrUVSvolUonUkPvZWvGn9Ss2FQIxM7RL4x09+Y7TTAQ7+BtgAU75aPBFkpfGt9QuSH nlVSlilBF5KJP17szzMgyI0RUgK960T+7g+P7d2JWydoC18/nnkxYt4jhl2263//LFFM bErKq9lo5t1maMnRqmRREbeAGbnRdTHM8JFh1PyjvOS/t9O7OI0EdlVV0/eYm0q8WUKu 8B1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=bSkuTjxY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k3-v6si1350489plt.328.2018.08.06.09.04.31; Mon, 06 Aug 2018 09:04:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=bSkuTjxY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733129AbeHFSN0 (ORCPT + 99 others); Mon, 6 Aug 2018 14:13:26 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:48820 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730724AbeHFSNZ (ORCPT ); Mon, 6 Aug 2018 14:13:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8IaTbGiI2kBzPlXkTibDxExERHMd3REdT8BW2Nz2qnY=; b=bSkuTjxYN4NMHmlhw2dJhmPpJ P/0O5ZWufJug37n30eMX6zn9IQ0QpAMnZAkNcmK7ou43dU+XTgCRkMmrSLxP6K8g2QeSdU49zFQUk UKVCQQkrwn65ney/0EdNe2Jnp9GQB66ViYynnHVgRlOeS4wcg/b791Co6Qn7TbL5q8sJcAQTAGpKP qK6iCvfApWakeMjob3w18AAJ53W+BD+pkUu590MFo5HHgYEY4zeE3PDYCg9VX6qeP2R/r5aVuarbv nPOtSdbtiXpN80LRv/aCX3eAYocf/L9kvVddGLD3aVruUatVCx0nrIh8Rcf/LEUn+5bFekxQ4rWVI 17xROMavw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fmhyl-0006hP-05; Mon, 06 Aug 2018 16:03:31 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7547920589AA1; Mon, 6 Aug 2018 18:03:29 +0200 (CEST) Date: Mon, 6 Aug 2018 18:03:29 +0200 From: Peter Zijlstra To: Johannes Weiner Cc: Ingo Molnar , Andrew Morton , Linus Torvalds , Tejun Heo , Suren Baghdasaryan , Daniel Drake , Vinayak Menon , Christopher Lameter , Mike Galbraith , Shakeel Butt , Peter Enderborg , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 8/9] psi: pressure stall information for CPU, memory, and IO Message-ID: <20180806160329.GP2494@hirez.programming.kicks-ass.net> References: <20180801151958.32590-1-hannes@cmpxchg.org> <20180801151958.32590-9-hannes@cmpxchg.org> <20180803165641.GA2476@hirez.programming.kicks-ass.net> <20180806151928.GB9888@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180806151928.GB9888@cmpxchg.org> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 06, 2018 at 11:19:28AM -0400, Johannes Weiner wrote: > On Fri, Aug 03, 2018 at 06:56:41PM +0200, Peter Zijlstra wrote: > > On Wed, Aug 01, 2018 at 11:19:57AM -0400, Johannes Weiner wrote: > > > + u32 uninitialized_var(nonidle); > > > > urgh.. I can see why the compiler got confused. Dodgy :-) > > :-) I think we can make this cleaner. Something like this (modulo the > READ_ONCE/WRITE_ONCE you pointed out in the other email)? > > @@ -244,60 +287,17 @@ static bool psi_update_stats(struct psi_group *group) > */ > for_each_online_cpu(cpu) { > struct psi_group_cpu *groupc = per_cpu_ptr(group->pcpu, cpu); > + u32 nonidle; > + > + nonidle = read_update_delta(groupc, PSI_NONIDLE, cpu); > + nonidle = nsecs_to_jiffies(nonidle); > + nonidle_total += nonidle; > + > + for (s = 0; s < PSI_NONIDLE; s++) { > + u32 delta; > + > + delta = read_update_delta(groupc, s, cpu); > + deltas[s] += (u64)delta * nonidle; > } > } Yes, much clearer, thanks!