From: Vlastimil Babka <vbabka@suse.cz>
To: Axel Rasmussen <axelrasmussen@google.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Michel Lespinasse <walken@google.com>,
Daniel Jordan <daniel.m.jordan@oracle.com>,
Jann Horn <jannh@google.com>,
Chinwen Chang <chinwen.chang@mediatek.com>,
Davidlohr Bueso <dbueso@suse.de>,
David Rientjes <rientjes@google.com>,
Laurent Dufour <ldufour@linux.ibm.com>
Cc: Yafang Shao <laoar.shao@gmail.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH v5 1/1] mmap_lock: add tracepoints around lock acquisition
Date: Mon, 2 Nov 2020 13:49:14 +0100 [thread overview]
Message-ID: <1ce6927b-32a6-b59f-7b6b-6474000f44db@suse.cz> (raw)
In-Reply-To: <20201027230711.2180435-2-axelrasmussen@google.com>
On 10/28/20 12:07 AM, Axel Rasmussen wrote:
> The goal of these tracepoints is to be able to debug lock contention
> issues. This lock is acquired on most (all?) mmap / munmap / page fault
> operations, so a multi-threaded process which does a lot of these can
> experience significant contention.
>
> We trace just before we start acquisition, when the acquisition returns
> (whether it succeeded or not), and when the lock is released (or
> downgraded). The events are broken out by lock type (read / write).
>
> The events are also broken out by memcg path. For container-based
> workloads, users often think of several processes in a memcg as a single
> logical "task", so collecting statistics at this level is useful.
>
> The end goal is to get latency information. This isn't directly included
> in the trace events. Instead, users are expected to compute the time
> between "start locking" and "acquire returned", using e.g. synthetic
> events or BPF. The benefit we get from this is simpler code.
>
> Because we use tracepoint_enabled() to decide whether or not to trace,
> this patch has effectively no overhead unless tracepoints are enabled at
> runtime. If tracepoints are enabled, there is a performance impact, but
> how much depends on exactly what e.g. the BPF program does.
>
> [ rostedt@goodmis.org: in-depth examples of tracepoint_enabled() usage,
> and per-cpu-per-context buffer design ]
Great, thanks Steven.
> Signed-off-by: Axel Rasmussen <axelrasmussen@google.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
prev parent reply other threads:[~2020-11-02 12:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-27 23:07 [PATCH v5 0/1] " Axel Rasmussen
2020-10-27 23:07 ` [PATCH v5 1/1] " Axel Rasmussen
2020-11-02 12:49 ` Vlastimil Babka [this message]
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=1ce6927b-32a6-b59f-7b6b-6474000f44db@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=chinwen.chang@mediatek.com \
--cc=daniel.m.jordan@oracle.com \
--cc=dbueso@suse.de \
--cc=jannh@google.com \
--cc=laoar.shao@gmail.com \
--cc=ldufour@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=rientjes@google.com \
--cc=rostedt@goodmis.org \
--cc=walken@google.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