Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1381227imm; Fri, 27 Jul 2018 16:41:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdisP7umTpW2PjLSCFKN31kx08+ZnEvF5qvwBbw7AGcc8F1R5YbT3CjDCD0zzif4q9wkulP X-Received: by 2002:a63:4d06:: with SMTP id a6-v6mr7733314pgb.408.1532734919866; Fri, 27 Jul 2018 16:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532734919; cv=none; d=google.com; s=arc-20160816; b=II20cSQTheUk2xZ+ruHh7C9XGxNMCwi3AFI23SlCOH3v4x0HARlcBAI/YcWrc4mUdd O4T/drQeuTkdmMw8rZu0s92mpjihiJ3ytwozBZueV/RZjOYt+BW3mk1s1P0FkpK9eUSC p9aqDQsgMcoViQaPe1+Mv49jmhCrMQK6TnOA/zeYKkTo+fEWOpTpXA8eM8+8xkciubGY 41z8y6pvc1oa+vFX43hRuwRPRh6xEOMqrDvOTh+0+JoNRXpA8pQP10q8BUXoOLeoJo/e tB7sFzfZ4SwMDZSt5lyZ+tmfkDcONNF0fkhws7/yoP3HI5fUDgj3WWIh4UqWJUoIRXCk IO0w== 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=8fRSoEKCnzV5OdL6IFEFlYB403uuIYKr1/yVsG2dWJo=; b=EmuEo+apc93BpAYdr6S0OkV7K8490MRNQbzzAvvcWzSTu9z7ND/8TJcJDBHSCplMHo WAhJMSbGi3mhrw/cR7upMEWy1YKhKVo3l69jzqsuizCloKU9pB0wXmzwLX96nvFTb7hA e1LatV9jmIn07kpFKMnEy9emAzPsWfRDQZry2pkvoaZ42J0gHFGSGny5WSK2iGhOhVTP oQ6kVnBkCWfPPMG9/Uvsc4hguqRmbviuhdDu5YiOp0K5BzykyUv7i78ynB7dCkd3eafw 2nakaS3iblYOPOdTj/kTdykFnWZbpzuGXJHzUKg0+JWHvWw6qS+oQ9/uhXIymHmez/jz y6Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=b8lp+g5f; 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 a64-v6si5122825pfb.224.2018.07.27.16.41.43; Fri, 27 Jul 2018 16:41: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=b8lp+g5f; 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 S2389063AbeG1BFB (ORCPT + 99 others); Fri, 27 Jul 2018 21:05:01 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:44661 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388668AbeG1BFB (ORCPT ); Fri, 27 Jul 2018 21:05:01 -0400 Received: by mail-io0-f195.google.com with SMTP id q19-v6so5456469ioh.11 for ; Fri, 27 Jul 2018 16:40:50 -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=8fRSoEKCnzV5OdL6IFEFlYB403uuIYKr1/yVsG2dWJo=; b=b8lp+g5fUyKsZd4mrx7jPCc1vaYwOwEhyYcukNkqhzPJA241bfFPABdopUbFORNDU4 ptVZf09sg1YTwl12hATWR2yWxtSHPVnljByY4cpK7x0I3Pt+aujWOy90jGkvQ8Q80PrK N7WImRg8n4LKcLZ8Ie+xZ40/udC9NO3D6dl0D++7PSPYmL+6VXWbCIVW8qqNc283B8Bm Xhd5XdnGkYVvowPkt6E2OArjmGiLJQNolBBsaAV5UzxiTXt34W3SNnDeSY1frccHtI7e vTpCQ5ELZgSPJAQ++V9An0xBp7h2YLcSrBrte2/lmLfq4gwrfptMk4Zg+RcKbyd3sB6h 5P6A== 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=8fRSoEKCnzV5OdL6IFEFlYB403uuIYKr1/yVsG2dWJo=; b=Xcv/0blfQJqsoWl3je82KLgJIRLTvQemGaEc4DMEeQ4e/yfYHYOV8mqomqQZamEeH9 s/E/vUVY9DpOzUnnTV8S5xpBgOSJ3OaQPH+fSwOM73gtfS1hNCcwBLJFMwiCW44WL97Q z9xIgDFCb3VqZ9ZAnIh9YoZIa8y15FzLD0S59jC+x/hIiQ9EuvwoPppJN7UztozvmxFe syM3Hm7nnaFmS4LSV+fG83Wwx7be8es3c2jLXMA3xLvYq/QgJnpjCNYWwgH0Y1T5UUpu 5GUT9e5UcYva/Zo+GObulebF7F4Hb+sZYmolJEMv6IY6vFz2+aXO86rAkBsjAz5kZD/D DPmA== X-Gm-Message-State: AOUpUlGzyomvoMt8yvVCCxqdPghOetEp3yO9T7fSlZvMJMu3jc/sepD5 Z94pFJQY0Jr4yHLCJe2+SRwaJjV0zbUpsstxu/INbw== X-Received: by 2002:a6b:87db:: with SMTP id r88-v6mr7226903ioi.243.1532734849922; Fri, 27 Jul 2018 16:40:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac0:e445:0:0:0:0:0 with HTTP; Fri, 27 Jul 2018 16:40:49 -0700 (PDT) In-Reply-To: <20180726200718.GA23307@cmpxchg.org> References: <20180712172942.10094-1-hannes@cmpxchg.org> <20180724151519.GA11598@cmpxchg.org> <268c2b08-6c90-de2b-d693-1270bb186713@gmail.com> <20180726200718.GA23307@cmpxchg.org> From: Suren Baghdasaryan Date: Fri, 27 Jul 2018 16:40:49 -0700 Message-ID: Subject: Re: [PATCH 0/10] psi: pressure stall information for CPU, memory, and IO v2 To: Johannes Weiner Cc: "Singh, Balbir" , Ingo Molnar , Peter Zijlstra , "akpm@linux-foundation.org" , Linus Torvalds , Tejun Heo , Vinayak Menon , Christoph Lameter , Mike Galbraith , Shakeel Butt , linux-mm , 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 Thu, Jul 26, 2018 at 1:07 PM, Johannes Weiner wrote: > On Thu, Jul 26, 2018 at 11:07:32AM +1000, Singh, Balbir wrote: >> On 7/25/18 1:15 AM, Johannes Weiner wrote: >> > On Tue, Jul 24, 2018 at 07:14:02AM +1000, Balbir Singh wrote: >> >> Does the mechanism scale? I am a little concerned about how frequently >> >> this infrastructure is monitored/read/acted upon. >> > >> > I expect most users to poll in the frequency ballpark of the running >> > averages (10s, 1m, 5m). Our OOMD defaults to 5s polling of the 10s >> > average; we collect the 1m average once per minute from our machines >> > and cgroups to log the system/workload health trends in our fleet. >> > >> > Suren has been experimenting with adaptive polling down to the >> > millisecond range on Android. >> > >> >> I think this is a bad way of doing things, polling only adds to >> overheads, there needs to be an event driven mechanism and the >> selection of the events need to happen in user space. > > Of course, I'm not saying you should be doing this, and in fact Suren > and I were talking about notification/event infrastructure. I implemented a psi-monitor prototype which allows userspace to specify the max PSI stall it can tolerate (in terms of % of time spent on memory management). When that threshold is breached an event to userspace is generated. I'm still testing it but early results look promising. I'm planning to send it upstream when it's ready and after the main PSI patchset is merged. > > You asked if this scales and I'm telling you it's not impossible to > read at such frequencies. > Yes it's doable. One usecase might be to poll at a higher rate for a short period of time immediately after the initial event is received to clarify the short-term signal dynamics. > Maybe you can clarify your question. > >> >> Why aren't existing mechanisms sufficient >> > >> > Our existing stuff gives a lot of indication when something *may* be >> > an issue, like the rate of page reclaim, the number of refaults, the >> > average number of active processes, one task waiting on a resource. >> > >> > But the real difference between an issue and a non-issue is how much >> > it affects your overall goal of making forward progress or reacting to >> > a request in time. And that's the only thing users really care >> > about. It doesn't matter whether my system is doing 2314 or 6723 page >> > refaults per minute, or scanned 8495 pages recently. I need to know >> > whether I'm losing 1% or 20% of my time on overcommitted memory. >> > >> > Delayacct is time-based, so it's a step in the right direction, but it >> > doesn't aggregate tasks and CPUs into compound productivity states to >> > tell you if only parts of your workload are seeing delays (which is >> > often tolerable for the purpose of ensuring maximum HW utilization) or >> > your system overall is not making forward progress. That aggregation >> > isn't something you can do in userspace with polled delayacct data. >> >> By aggregation you mean cgroup aggregation? > > System-wide and per cgroup.