From: Randy Dunlap <rdunlap@infradead.org>
To: Johannes Weiner <hannes@cmpxchg.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-block@vger.kernel.org, cgroups@vger.kernel.org
Cc: Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Andrew Morton <akpm@linuxfoundation.org>,
Tejun Heo <tj@kernel.org>, Balbir Singh <bsingharora@gmail.com>,
Mike Galbraith <efault@gmx.de>, Oliver Yang <yangoliver@me.com>,
Shakeel Butt <shakeelb@google.com>, xxx xxx <x.qendo@gmail.com>,
Taras Kondratiuk <takondra@cisco.com>,
Daniel Walker <danielwa@cisco.com>,
Vinayak Menon <vinmenon@codeaurora.org>,
Ruslan Ruslichenko <rruslich@cisco.com>,
kernel-team@fb.com
Subject: Re: [PATCH 6/7] psi: pressure stall information for CPU, memory, and IO
Date: Mon, 7 May 2018 17:42:36 -0700 [thread overview]
Message-ID: <024fba07-eece-3878-0924-ea9fd601542d@infradead.org> (raw)
In-Reply-To: <20180507210135.1823-7-hannes@cmpxchg.org>
On 05/07/2018 02:01 PM, Johannes Weiner wrote:
>
> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
> ---
> Documentation/accounting/psi.txt | 73 ++++++
> include/linux/psi.h | 27 ++
> include/linux/psi_types.h | 84 ++++++
> include/linux/sched.h | 10 +
> include/linux/sched/stat.h | 10 +-
> init/Kconfig | 16 ++
> kernel/fork.c | 4 +
> kernel/sched/Makefile | 1 +
> kernel/sched/core.c | 3 +
> kernel/sched/psi.c | 424 +++++++++++++++++++++++++++++++
> kernel/sched/sched.h | 166 ++++++------
> kernel/sched/stats.h | 91 ++++++-
> mm/compaction.c | 5 +
> mm/filemap.c | 15 +-
> mm/page_alloc.c | 10 +
> mm/vmscan.c | 13 +
> 16 files changed, 859 insertions(+), 93 deletions(-)
> create mode 100644 Documentation/accounting/psi.txt
> create mode 100644 include/linux/psi.h
> create mode 100644 include/linux/psi_types.h
> create mode 100644 kernel/sched/psi.c
>
> diff --git a/Documentation/accounting/psi.txt b/Documentation/accounting/psi.txt
> new file mode 100644
> index 000000000000..e051810d5127
> --- /dev/null
> +++ b/Documentation/accounting/psi.txt
> @@ -0,0 +1,73 @@
Looks good to me.
> diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
> new file mode 100644
> index 000000000000..052c529a053b
> --- /dev/null
> +++ b/kernel/sched/psi.c
> @@ -0,0 +1,424 @@
> +/*
> + * Measure workload productivity impact from overcommitting CPU, memory, IO
> + *
> + * Copyright (c) 2017 Facebook, Inc.
> + * Author: Johannes Weiner <hannes@cmpxchg.org>
> + *
> + * Implementation
> + *
> + * Task states -- running, iowait, memstall -- are tracked through the
> + * scheduler and aggregated into a system-wide productivity state. The
> + * ratio between the times spent in productive states and delays tells
> + * us the overall productivity of the workload.
> + *
> + * The ratio is tracked in decaying time averages over 10s, 1m, 5m
> + * windows. Cumluative stall times are tracked and exported as well to
Cumulative
> + * allow detection of latency spikes and custom time averaging.
> + *
> + * Multiple CPUs
> + *
> + * To avoid cache contention, times are tracked local to the CPUs. To
> + * get a comprehensive view of a system or cgroup, we have to consider
> + * the fact that CPUs could be unevenly loaded or even entirely idle
> + * if the workload doesn't have enough threads. To avoid artifacts
> + * caused by that, when adding up the global pressure ratio, the
> + * CPU-local ratios are weighed according to their non-idle time:
> + *
> + * Time the CPU had stalled tasks Time the CPU was non-idle
> + * ------------------------------ * ---------------------------
> + * Walltime Time all CPUs were non-idle
> + */
> +
> +/**
> + * psi_memstall_leave - mark the end of an memory stall section
end of a memory
> + * @flags: flags to handle nested memdelay sections
> + *
> + * Marks the calling task as no longer stalled due to lack of memory.
> + */
> +void psi_memstall_leave(unsigned long *flags)
> +{
--
~Randy
next prev parent reply other threads:[~2018-05-08 0:43 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-07 21:01 [PATCH 0/7] " Johannes Weiner
2018-05-07 21:01 ` [PATCH 1/7] mm: workingset: don't drop refault information prematurely Johannes Weiner
2018-05-07 21:01 ` [PATCH 2/7] mm: workingset: tell cache transitions from workingset thrashing Johannes Weiner
2018-05-07 21:01 ` [PATCH 3/7] delayacct: track delays from thrashing cache pages Johannes Weiner
2018-05-07 21:01 ` [PATCH 4/7] sched: loadavg: consolidate LOAD_INT, LOAD_FRAC, CALC_LOAD Johannes Weiner
2018-05-07 21:01 ` [PATCH 5/7] sched: loadavg: make calc_load_n() public Johannes Weiner
2018-05-09 9:49 ` Peter Zijlstra
2018-05-10 13:46 ` Johannes Weiner
2018-05-07 21:01 ` [PATCH 6/7] psi: pressure stall information for CPU, memory, and IO Johannes Weiner
2018-05-08 0:42 ` Randy Dunlap [this message]
2018-05-08 14:06 ` Johannes Weiner
2018-05-08 1:35 ` kbuild test robot
2018-05-08 3:04 ` kbuild test robot
2018-05-08 14:05 ` Johannes Weiner
2018-05-09 9:59 ` Peter Zijlstra
2018-05-10 13:49 ` Johannes Weiner
2018-05-09 10:04 ` Peter Zijlstra
2018-05-10 14:10 ` Johannes Weiner
2018-05-09 10:05 ` Peter Zijlstra
2018-05-10 14:13 ` Johannes Weiner
2018-05-09 10:14 ` Peter Zijlstra
2018-05-10 14:18 ` Johannes Weiner
2018-05-09 10:21 ` Peter Zijlstra
2018-05-10 14:24 ` Johannes Weiner
2018-05-09 10:26 ` Peter Zijlstra
2018-05-09 10:46 ` Peter Zijlstra
2018-05-09 11:38 ` Peter Zijlstra
2018-05-10 13:41 ` Johannes Weiner
2018-05-14 8:33 ` Peter Zijlstra
2018-05-09 10:55 ` Peter Zijlstra
2018-05-09 11:03 ` Vinayak Menon
2018-05-23 13:17 ` Johannes Weiner
2018-05-23 13:19 ` Vinayak Menon
2018-06-07 0:46 ` Suren Baghdasaryan
2018-05-07 21:01 ` [PATCH 7/7] psi: cgroup support Johannes Weiner
2018-05-09 11:07 ` Peter Zijlstra
2018-05-10 14:49 ` Johannes Weiner
2018-05-14 15:39 ` [PATCH 0/7] psi: pressure stall information for CPU, memory, and IO Christopher Lameter
2018-05-14 17:35 ` Bart Van Assche
2018-05-14 18:55 ` Johannes Weiner
2018-05-14 20:15 ` Christopher Lameter
2018-05-26 0:29 ` Suren Baghdasaryan
2018-05-29 18:16 ` Johannes Weiner
2018-05-30 23:32 ` Suren Baghdasaryan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=024fba07-eece-3878-0924-ea9fd601542d@infradead.org \
--to=rdunlap@infradead.org \
--cc=akpm@linuxfoundation.org \
--cc=bsingharora@gmail.com \
--cc=cgroups@vger.kernel.org \
--cc=danielwa@cisco.com \
--cc=efault@gmx.de \
--cc=hannes@cmpxchg.org \
--cc=kernel-team@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rruslich@cisco.com \
--cc=shakeelb@google.com \
--cc=takondra@cisco.com \
--cc=tj@kernel.org \
--cc=vinmenon@codeaurora.org \
--cc=x.qendo@gmail.com \
--cc=yangoliver@me.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox