Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5107imm; Fri, 13 Jul 2018 15:47:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdnWNZqjWYk7yOzeQ8N348OFYt+krQIRHTxci9BQa+8fd6j+b7O93c2CLGFTxO5lA191XjK X-Received: by 2002:a63:d5b:: with SMTP id 27-v6mr7583994pgn.107.1531522064521; Fri, 13 Jul 2018 15:47:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531522064; cv=none; d=google.com; s=arc-20160816; b=MuYKzUVoSm8VykEymfiC32ntGexaBRpLwdMkkArrD9AgLz9eG5U92VkMGx4LuWRMIV l9+WFo1P7qFvTQUVh0+4XflqItbaoQOW/FcCCtUAdLe15WJbfLnMwuiMyG9iybQusWzK mddgv4fST29rBAfIw/AqiG9IKNiYpOqtPG71ckmACwZtR+95bpPzuFVbUfk+tuzUiiAr TPz0tgkcEG9e+JDBAaI0+5cHl8RrNS4q22DIeRZtngFBWvYRwOwuuYEjf1kcqPEo7nKU TxfwN1e4w9TKM30MVcdu16WgUzey69OKRvBnVRuB2nRedyiF/qXdUheTjte1UKUMc+Xw iL5w== 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=HZKdE5BEkuE41busR47XjmYnRCtqFvpmYwJ64dAu8iU=; b=Xhy7OzVWKbVsS4Tqlt6GYaghXE9ux8pE/RKFdXQ4ni6Y2tTxE4zsndIl5KDpshkE4Y SWrGjFl9q98V+B67/heHThWBrdyDTTAULlXJpHTq5YGfPGMrXshjjsqNxo6x3wzVXJum IdhWygn2YOuTJPAebnEsmndOZVGluMYIgvQjdCtMcaRN46Ah7aut9ibYjRZtdJQ3K2c7 9d4OQayT1NBh45xns5+Ce8EWFEGMqpKY174XZR1wk64WoorlEdSoe98ttdtGi1rJGHQC BGLdW0FuUCSa/M8kg9LTc2QrSlWJJC4p1KHrlz7RaYWM3fT8NGwHZDqSTtS2lqLK5l/7 4E4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b="RfPu4v/X"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c17-v6si23628211pge.273.2018.07.13.15.47.29; Fri, 13 Jul 2018 15:47:44 -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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b="RfPu4v/X"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730038AbeGMXDP (ORCPT + 99 others); Fri, 13 Jul 2018 19:03:15 -0400 Received: from mail-yb0-f194.google.com ([209.85.213.194]:33679 "EHLO mail-yb0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727188AbeGMXDP (ORCPT ); Fri, 13 Jul 2018 19:03:15 -0400 Received: by mail-yb0-f194.google.com with SMTP id e84-v6so13378010ybb.0 for ; Fri, 13 Jul 2018 15:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=HZKdE5BEkuE41busR47XjmYnRCtqFvpmYwJ64dAu8iU=; b=RfPu4v/XumHDR+n+s8fcBUN+mzsf8UVrzt5PgLxCRGYRdHEwfcCXpc3LlZfMgz7t6e s+y+uo/IYQYbDXLiJE0NjWCaWHA315ilkxI/tBTDRPgH7CBlOzoyg/Q9RSZeFdVqUM9u cidAzqAKgO0wKELYoZOPfR8BQGFy9dx5Lkt+VRxi8XNw9SobhD5yBiIRB19EHSBUTrZn 28A54Lh2FIEYS5hkFOTqoKgzjuxbvzzN+ul4ks6Yqla3LIxEJ0eFgWzSMH7QhVl2VTiL gdj90CU3rqiO7dHORF9aYdZIsJ+DBDuyVkUWGrj9TvKrQKHExpY6uf1YrsIVIslHoidD 8Wxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=HZKdE5BEkuE41busR47XjmYnRCtqFvpmYwJ64dAu8iU=; b=NhyYdQtwNdSip4vappq9F888Glq1mqtLP7Cm4xYTTaLe0Yf5ZJNJdC5Gl00JbsrRw3 QkwWtch8OGNDpB00cOSpScMQ5pv66ysdJasWIczUfN7vjY1VVNA3hZuXYDfaF5TBm2md SO7PJqJXDh0o2Tv6RehgyNl+OLZIPdRusoSNIPqrNWewmxjb/IokNVezfkFZtBtn59I6 ilEqcXNL2DKAlWwxutEDCizoEWmJ460qhT5vXgQBWBbww5wi1bXaA2SmJPszQQ2aORPJ yK3xUzO6/OfD5YVv9heteretL63gGZHamYGTMKUGHunEZWGqkdUDq/2jYANPPVsLjI+p /nSg== X-Gm-Message-State: AOUpUlHNN4/XBFTiZmxPwGGdAb63KXPQqP/vZL9ui61b0J0nAghmQLvr chffVSf+NjDCYjlR+jeqQlhYZA== X-Received: by 2002:a25:30d6:: with SMTP id w205-v6mr4542621ybw.52.1531521996293; Fri, 13 Jul 2018 15:46:36 -0700 (PDT) Received: from localhost ([2620:10d:c091:180::1:23bd]) by smtp.gmail.com with ESMTPSA id u64-v6sm1590819ywu.107.2018.07.13.15.46.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Jul 2018 15:46:35 -0700 (PDT) Date: Fri, 13 Jul 2018 18:49:20 -0400 From: Johannes Weiner To: Suren Baghdasaryan 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 Subject: Re: [RFC PATCH 10/10] psi: aggregate ongoing stall events when somebody reads pressure Message-ID: <20180713224920.GA31566@cmpxchg.org> References: <20180712172942.10094-1-hannes@cmpxchg.org> <20180712172942.10094-11-hannes@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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.