Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp36415imm; Fri, 13 Jul 2018 16:35:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfnbCFfEa34rGp+ZyyAHAwH0WEclp013pJhE6qau+hRHtXLL4Nz/zQnZ9TSExJ01Ubfjhrg X-Received: by 2002:a62:9f85:: with SMTP id v5-v6mr9011229pfk.27.1531524959127; Fri, 13 Jul 2018 16:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531524959; cv=none; d=google.com; s=arc-20160816; b=a4Gamugqbu6BJvSZTbLM/ZGaNF+vfhtc9knZQoyeFFcsiVT/ZmQPHEDz4FBnjIFa2u LMM2X/ZcHNZCXJC8ibVn6QIRyt58NXdhA8wRj3eB3E+dNXaX+hHRCSqAtiD1oK4kdRhp 0JI9YDwt1LQR5UOccviwV51iKeWPgr4hJVcf+9a5yGgtUTh9gnyp9Bs3eIsOOh7UN0Hf UxP2de3b1wHxB7zje3HzfPq04FS4mJ3qmkebCZMTJCkUhr/mlxDAO8+cT5CAT+Qno013 VUSEGRJo6Nu54dqfTs2VquwtXohi2oniRQZpLK8Lfj22RP4tzyD5F62zqJA4fIPQPt3y Rmyg== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=LbuajyqVafS+Oe0uGJrsnT4wqPiXVRFSTfmkTnit5WY=; b=pBA2PzXBVe6nuOkhc2Q656Jf3vEhkmudUd2g7Gs0aUMLCWqJ1jS9OXzhRJXlf33tmr EYr9squfjW6ejAIXqQ+i9tag+yaZj+K787d65G1tNt8OcUvlFZ/t97/1+yPmGWvU9lE/ 19H9sattXmVyCWyPlpm+59cmrW6M6fmXILl1Hv+cDgJdhqYWoKmFCcDR/rOayXAigW+t V/xogwLkEvarmdzYMKhZvRu3xFbJm3tIBHMUTIMqaTDOilWFZSA9Z2wo2Wjkv74RPsAQ ZB3EFMkiBYtsBuLQdcbU6dWNBBKQAu1NR9kEZnVDCCpzuyvF1KDLy7LD4n2kS+oBH87X hv0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=qT3SePYj; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g11-v6si22471882pgq.457.2018.07.13.16.35.44; Fri, 13 Jul 2018 16:35:59 -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=pass header.i=@google.com header.s=20161025 header.b=qT3SePYj; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731443AbeGMXvt (ORCPT + 99 others); Fri, 13 Jul 2018 19:51:49 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:35743 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729774AbeGMXvt (ORCPT ); Fri, 13 Jul 2018 19:51:49 -0400 Received: by mail-io0-f194.google.com with SMTP id q4-v6so32738105iob.2 for ; Fri, 13 Jul 2018 16:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=LbuajyqVafS+Oe0uGJrsnT4wqPiXVRFSTfmkTnit5WY=; b=qT3SePYjvLFlPgcGsDtTeG5wOek+6Fff0AME4B/qoaS/iNMptN03hbtYFhonUtd+m6 issLWguzjzOZZjClJzoHhUKdX8S8v2zOcfrbhP5cyjY+Gguxb/cpy25unXLj+GlckHXi gR4GyCXiYVumG/wYOGhtF96pDzntEgB0O4cpMgsd3YvSLT1mivMx/elyxLT6blG7c8KZ L2zMHl77WSWjd51PxUTFRSa2jRpPD6VbINsUkadJ+phb/wLZIVeJGgMo5ggXrG7dfjMx R6eeEgqs7LXRX79hW2IX9viVVs3fn1Ls3EcYrQr+oO+TYrb5SdweaMuj8SSsquTuTQAD WzNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=LbuajyqVafS+Oe0uGJrsnT4wqPiXVRFSTfmkTnit5WY=; b=a6a8JTs6KXsfTdkt95CXZPgPkUYHkowp1o9+Qoz1pS0C9CXxIX+i31et5u3fLFkn5l Uizinuza88Fl0/fO7QIpYAM9yEUlyteHPMu5YaWflUhUor5lpkvWxZ//15DCVwzLNVaF IK78eZoZzwHQ7hDs36M0X6mTGV6wDYlZodZYgNajtVhKecdB3oZHZQSbr/egZ5bVsdpx I67Zq63dgutg+9fxzp+rUJYx36kfayf79KO0SpeECBt5RhgceHyBrGuARSrr1yM+IO54 tiXdBGQFyjdU/acXKWsVCODzi+NDykS1iF3v7I2QHeE9H5j+7owHoHZL6G+TXmNKj5QB Z+Lw== X-Gm-Message-State: AOUpUlE4W5KAIj9hCGOh1iESP+Rx2vVh+Xqbc8bDeiqtnUnpv+vlzEHh 3wUmHuWDwcAVPIp3Mz9wiikjAIDO1Cl4gnJn6zJIhA== X-Received: by 2002:a6b:fb04:: with SMTP id h4-v6mr13483672iog.193.1531524900391; Fri, 13 Jul 2018 16:35:00 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac0:e445:0:0:0:0:0 with HTTP; Fri, 13 Jul 2018 16:34:59 -0700 (PDT) In-Reply-To: <20180713224920.GA31566@cmpxchg.org> References: <20180712172942.10094-1-hannes@cmpxchg.org> <20180712172942.10094-11-hannes@cmpxchg.org> <20180713224920.GA31566@cmpxchg.org> From: Suren Baghdasaryan Date: Fri, 13 Jul 2018 16:34:59 -0700 Message-ID: Subject: Re: [RFC PATCH 10/10] psi: aggregate ongoing stall events when somebody reads pressure To: Johannes Weiner Cc: Ingo Molnar , Peter Zijlstra , Andrew Morton , Linus Torvalds , Tejun Heo , 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 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 On Fri, Jul 13, 2018 at 3:49 PM, Johannes Weiner wrote: > On Fri, Jul 13, 2018 at 03:13:07PM -0700, Suren Baghdasaryan wrote: >> On Thu, Jul 12, 2018 at 10:29 AM, Johannes Weiner wrote: >> > might want to know about and react to stall states before they have >> > even concluded (e.g. a prolonged reclaim cycle). >> > >> > This patches the procfs/cgroupfs interface such that when the pressure >> > metrics are read, the current per-cpu states, if any, are taken into >> > account as well. >> > >> > Any ongoing states are concluded, their time snapshotted, and then >> > restarted. This requires holding the rq lock to avoid corruption. It >> > could use some form of rq lock ratelimiting or avoidance. >> > >> > Requested-by: Suren Baghdasaryan >> > Not-yet-signed-off-by: Johannes Weiner >> > --- >> >> IMHO this description is a little difficult to understand. In essence, >> PSI information is being updated periodically every 2secs and without >> this patch the data can be stale at the time when we read it (because >> it was last updated up to 2secs ago). To avoid this we update the PSI >> "total" values when data is being read. > > That fix I actually folded into the main patch. We now always update > the total= field at the time the user reads to include all concluded > events, even if we sampled less than 2s ago. Only the running averages > are still bound to the 2s sampling window. > > What this patch adds on top is for total= to include any *ongoing* > stall events that might be happening on a CPU at the time of reading > from the interface, like a reclaim cycle that hasn't finished yet. Ok, I see now what you mean. So ondemand flag controls whether *ongoing* stall events are accounted for or not. Nit: maybe rename that flag to better explain it's function?