Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8406714ybl; Thu, 16 Jan 2020 16:14:34 -0800 (PST) X-Google-Smtp-Source: APXvYqy43UaD6DwzRPKYF82hZiWwvNJlmyL3FF3cBiiFk1s9U2Gc7cgdbM1hot2BjsPwePYQ5Zur X-Received: by 2002:aca:b183:: with SMTP id a125mr1469068oif.83.1579220074415; Thu, 16 Jan 2020 16:14:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579220074; cv=none; d=google.com; s=arc-20160816; b=pQUBhnnSqyrBS/oggDMF7Pm98tS1x9sfmOPcSLLehHt+NsL92tn2NnIv1Ogb0wUE+q 97UZVp7vE34cfKBCL1c6RprjM7tJtyPY1LKhjpcyc9oY46CgO6zxWu8APHA0BWxXTwFV I4f4UGmJ3p2IMzOsD5E2bPXz4Bkh/XID4LrfVmiJd1ytU5Ps1i2O6k54IwFteJRxtLHV xrUHWHeJGN/8WiGL8wRB5PiSlaYpZzNfNay82t9KJKH4z6sUOMtzZNcwnJbQ7umGDCQQ PLiIAo/bZz7aFVZmUWDUhPBMdIsY1T0ZggpHDooHgtX/GrPtLEtAn3knFf0sWcWw3/m2 P5lQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4FrKYxGLex7KY55dL8lMxEeBinvzP+LQNyH65PshZEs=; b=e5qXUrDQjJzsvR8zi3OKCp5Cn3pYEcF6OxhCaHGnNL5YJekriZoS4Hmo+IE6/abEbj wiugjLDGSliFF0BP1I8L2nBFHECpBJRP7w0pOhoGbSCbsWOwJaXXIJN49LkE+quml05V XoHVCm0LL/m5DgjFoqEm2b5PfWdwapqzc0c4hZPO3R5TPu6ykuA8jaE7k0KCLi3DCgTX i5Yh1ZE8UqGFY5gS08T8j77S8ndlZVmkOwy8kDHQlF2UpyFwpUgwC/jjQOkGbaoLpJN3 EAH0HS6k4Gd+MQPcB9Z7T1EUk62G5dbx4mODVgZwQmt0ERPTAl38jWfY3EBNmFvr3Fxf tRBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=Zp0+uBpa; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cloudflare.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h139si11250540oib.85.2020.01.16.16.14.21; Thu, 16 Jan 2020 16:14:34 -0800 (PST) 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=pass header.i=@cloudflare.com header.s=google header.b=Zp0+uBpa; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387802AbgAPUZA (ORCPT + 99 others); Thu, 16 Jan 2020 15:25:00 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:34662 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731740AbgAPUY7 (ORCPT ); Thu, 16 Jan 2020 15:24:59 -0500 Received: by mail-qt1-f196.google.com with SMTP id 5so20027546qtz.1 for ; Thu, 16 Jan 2020 12:24:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4FrKYxGLex7KY55dL8lMxEeBinvzP+LQNyH65PshZEs=; b=Zp0+uBpaH3H0gdT2e0qKjUQyxwU7AyZ6QAUooOJGqKQnpYTBgwYSKuk3OGdkdOsdPY t5u+d3Lapyj6ThZbdd1RCyWbjUZAcMSTQ9jNlbcv8MxMLQzY7QgQHC68cx/9d3VErCGS QOTeVzPheXSW4YCSfGw5keEWNgJtybHXO17xk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4FrKYxGLex7KY55dL8lMxEeBinvzP+LQNyH65PshZEs=; b=mTcypXpPwBLwDGiaoHp7E7Pzn+ByhV0R4IuxZwPhzR8J7XniGBCHz/AF4kvvbp+rmB KL0Ka0LaLra5ffAw+aMtLaaLlw//G22TsdE6ecojsywtWzlIPfEzqgAs34hWMGyBC4bT 6flkwZ8lgiw8P7ZLZWnTYP60PW8yA/05WyB9GzZsnogNNJp0+UGRf7NSwTBQvSExwoeK lPy6ZncyRrC9SiXB+Nl1Q6TFJb5sbR0nqDJSnDq6rRFwHX7sgKhhFXrsjX0Cz5EV/oPM 0Pjhss48SN+BOmyuAcgp3/903Y7mk4Vb/8jvJJ/HIWkB5LwpPb7KRX2UDd/IfzOFkCUo kLiw== X-Gm-Message-State: APjAAAV3vzPRe0eqoD0mSNYNzrKFPTYWxRqvfkSKKMo6rFijzzwWxyog 1/g59J0AuFbGhBhllhcaGsLCKLJZ7hPGiIax2yYsPg== X-Received: by 2002:ac8:187b:: with SMTP id n56mr4252669qtk.173.1579206298474; Thu, 16 Jan 2020 12:24:58 -0800 (PST) MIME-Version: 1.0 References: <20200109161632.GB8547@cmpxchg.org> <20200115165543.GA47772@cmpxchg.org> In-Reply-To: <20200115165543.GA47772@cmpxchg.org> From: Ivan Babrou Date: Thu, 16 Jan 2020 12:24:47 -0800 Message-ID: Subject: Re: Lower than expected CPU pressure in PSI To: Johannes Weiner Cc: linux-kernel , kernel-team , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This definitely helps! It would be nice to add this as a section here: * https://www.kernel.org/doc/html/latest/accounting/psi.html On Wed, Jan 15, 2020 at 8:55 AM Johannes Weiner wrote: > > On Fri, Jan 10, 2020 at 11:28:32AM -0800, Ivan Babrou wrote: > > I applied the patch on top of 5.5.0-rc3 and it's definitely better > > now, both competing cgroups report 500ms/s delay. Feel free to add > > Tested-by from me. > > Thanks, Ivan! > > > I'm still seeing /unified/system.slice at 385ms/s and /unified.slice > > at 372ms/s, do you have an explanation for that part? Maybe it's > > totally reasonable, but warrants a patch for documentation. > > Yes, this is a combination of CPU pinning and how pressure is > calculated in SMP systems. > > The stall times are defined as lost compute potential - which scales > with the number of concurrent threads - normalized to wallclock > time. See the "Multiple CPUs" section in kernel/sched/psi.c. > > By restricting the CPUs in system.slice, there is less compute > available in that group than in the parent, which means that the > relative loss of potential can be higher. > > It's a bit unintuitive because most cgroup metrics are plain numbers > that add up to bigger numbers as you go up the tree. If we exported > both the numerator (waste) and denominator (compute potential) here, > the numbers would act more conventionally, with parent numbers always > bigger than the child's. But because pressure is normalized to > wallclock time, you only see the ratio at each level, and that can > shrink as you go up the tree if lower levels are CPU-constrained. > > We could have exported both numbers, but for most usecases that would > be more confusing than helpful. And in practice it's the ratio that > really matters: the pressure in the leaf cgroups is high due to the > CPU restriction; but when you go higher up the tree and look at not > just the pinned tasks, but also include tasks in other groups that > have more CPUs available to them, the aggregate productivity at that > level *is* actually higher. > > I hope that helps!