Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1727753imm; Thu, 19 Jul 2018 07:00:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcZkZDvY7/Vw+H2WpODnqRyH6mSm2wNTbx/5yRfhQN54dLzC5+3WpydpHseVsjc4Y14D5Up X-Received: by 2002:a65:4c41:: with SMTP id l1-v6mr10338284pgr.310.1532008847312; Thu, 19 Jul 2018 07:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532008847; cv=none; d=google.com; s=arc-20160816; b=DRnrWhrxqaRA1vpZyyK7rvFlD/KYSUg1h1k0tH2v2BtjkXLAV3xQ4SQ9DapfGuiMpl LPURwx7gdH/q8a+jQFAA7VsH+eu2ysAtqCekKjQlXIy/2txl737s1DvF5fB3/b+LStL3 V1MkNxv0z9Jahw/KoYl8liJlPqVUEBy3UbULWGSTcbXQETZObOAOusEZi6wL72NBESyN OxtvaCo98vB6TyCoTahusxr8soy0BHexPjUx7+IMWgOt4BDg70KLetebLm4Z03/PHaZk AWHcPg9vsN7azXQScZfvB9Q21Ggx7hPMGKed9K/W7Xu2WI3PzTqZ+FkLEBjUyuc9wWn8 21Zw== 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=YbZEhod6+oCuO/XJF2r6OBkvvUCmqgWhGVTmfRqzeHs=; b=Bt29YH21nJBVXbzdPIq4exkAePzAJZ/S4tXIWW8aVDnzuaTEc6y1YDTc5dRsQteR0t x669k6Asbil8R9lk/1DfeOu8JJ4dTIYiWGJ/x0pngHB4mLzmLpBt9fkLHWZRjQcOogVM B59Wri1g4DV9Nsl/ifpdBRPOx7boxQnIu64lhYMEilBr1xX8LJ0uFlSxlzHjCK/XKzZB fJF3kiPvMyeEfPPRT0g/JoXll7Ra7973w0GiZS3yeG1jHY/WR+XfGuf5LIO74FEse2h/ jOBxiy90vwHG/O90SohuYHuTFgwo/NqQkoK+OWvKHa+oUT2isakROL/k8+d+7odRNmC2 Xk9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=YPYzioMC; 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 q20-v6si5808675pgl.573.2018.07.19.07.00.32; Thu, 19 Jul 2018 07:00:47 -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=YPYzioMC; 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 S1731790AbeGSOmN (ORCPT + 99 others); Thu, 19 Jul 2018 10:42:13 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:40168 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731105AbeGSOmN (ORCPT ); Thu, 19 Jul 2018 10:42:13 -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=YbZEhod6+oCuO/XJF2r6OBkvvUCmqgWhGVTmfRqzeHs=; b=YPYzioMCKH4PSfBh4+LL2AHDL j6HIpqdFgyPpOJOPtr3hPi9Z3+LfFKSXLuAzdwEJwu7i9h3JakG3tfdsK7cx7et62hiH4y1/mBGXJ Xfm6eqoEBk5rh92v8+z0iECUZotqY6LDAoU1sWhVLChd2JH3LdkxGe8Sfmz3GGbm5ZIqGEp7yfWUt Xd3c98GuMyzhsg/RNUme9fceOhhhfrsl0uUtDehgVgyOUFFMX/wWj8kBRo2cJqbf/Ozvv9+s1+yul erSJY+tTJQdl6FBjVRTZeQW97mMJMe5Nt+dgyRCBHtqqpQLN10KU5UuVOKEcisA79z3OAV9GMrPKD 6WiFz8iQw==; 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 1fg9SC-0001wY-ER; Thu, 19 Jul 2018 13:58:48 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E64DA20277352; Thu, 19 Jul 2018 15:58:46 +0200 (CEST) Date: Thu, 19 Jul 2018 15:58:46 +0200 From: Peter Zijlstra To: Johannes Weiner Cc: Ingo Molnar , Andrew Morton , Linus Torvalds , Tejun Heo , Suren Baghdasaryan , Vinayak Menon , Christopher Lameter , Mike Galbraith , Shakeel Butt , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 08/10] psi: pressure stall information for CPU, memory, and IO Message-ID: <20180719135846.GH2494@hirez.programming.kicks-ass.net> References: <20180712172942.10094-1-hannes@cmpxchg.org> <20180712172942.10094-9-hannes@cmpxchg.org> <20180718120318.GC2476@hirez.programming.kicks-ass.net> <20180718223644.GH2838@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180718223644.GH2838@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 Wed, Jul 18, 2018 at 06:36:44PM -0400, Johannes Weiner wrote: > On Wed, Jul 18, 2018 at 02:03:18PM +0200, Peter Zijlstra wrote: > > On Thu, Jul 12, 2018 at 01:29:40PM -0400, Johannes Weiner wrote: > > > + /* Time in which tasks wait for the CPU */ > > > + state = PSI_NONE; > > > + if (tasks[NR_RUNNING] > 1) > > > + state = PSI_SOME; > > > + time_state(&groupc->res[PSI_CPU], state, now); > > > + > > > + /* Time in which tasks wait for memory */ > > > + state = PSI_NONE; > > > + if (tasks[NR_MEMSTALL]) { > > > + if (!tasks[NR_RUNNING] || > > > + (cpu_curr(cpu)->flags & PF_MEMSTALL)) > > > > I'm confused, why do we care if the current tasks is MEMSTALL or not? > > We want to know whether we're losing CPU potential because of a lack > of memory. That can happen when the task waits for refaults and the > CPU goes idle, but it can also happen when the CPU is performing > reclaim. > > If the task waits for refaults and something else is runnable, we're > not losing CPU potential. But if the task performs reclaim and uses > the CPU, nothing else can do productive work on that CPU. Right, this is because MEMSTALL is not just blocking (as per that other sub-thread). This is really unfortunate, because it means the state is not a simple function of the task counts.