From: Axel Rasmussen <axelrasmussen@google.com>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: "Peter Zijlstra" <peterz@infradead.org>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"David Rientjes" <rientjes@google.com>,
"Davidlohr Bueso" <dbueso@suse.de>,
"Ingo Molnar" <mingo@kernel.org>,
"Ingo Molnar" <mingo@redhat.com>,
"Jerome Glisse" <jglisse@redhat.com>,
"Laurent Dufour" <ldufour@linux.ibm.com>,
"Liam R . Howlett" <Liam.Howlett@oracle.com>,
"Matthew Wilcox" <willy@infradead.org>,
"Michel Lespinasse" <walken@google.com>,
"Vlastimil Babka" <vbabka@suse.cz>,
"Will Deacon" <will@kernel.org>,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org,
"AKASHI Takahiro" <takahiro.akashi@linaro.org>,
"Aleksa Sarai" <cyphar@cyphar.com>,
"Alexander Potapenko" <glider@google.com>,
"Alexey Dobriyan" <adobriyan@gmail.com>,
"Al Viro" <viro@zeniv.linux.org.uk>,
"Andrei Vagin" <avagin@gmail.com>,
"Ard Biesheuvel" <ardb@kernel.org>,
"Brendan Higgins" <brendanhiggins@google.com>,
chenqiwu <chenqiwu@xiaomi.com>,
"Christian Brauner" <christian.brauner@ubuntu.com>,
"Christian Kellner" <christian@kellner.me>,
"Corentin Labbe" <clabbe@baylibre.com>,
"Daniel Jordan" <daniel.m.jordan@oracle.com>,
"Dan Williams" <dan.j.williams@intel.com>,
"David Gow" <davidgow@google.com>,
"David S. Miller" <davem@davemloft.net>,
"Dmitry V. Levin" <ldv@altlinux.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
"Eugene Syromiatnikov" <esyr@redhat.com>,
"Jamie Liu" <jamieliu@google.com>,
"Jason Gunthorpe" <jgg@ziepe.ca>,
"John Garry" <john.garry@huawei.com>,
"John Hubbard" <jhubbard@nvidia.com>,
"Jonathan Adams" <jwadams@google.com>,
"Junaid Shahid" <junaids@google.com>,
"Kees Cook" <keescook@chromium.org>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
"Konstantin Khlebnikov" <khlebnikov@yandex-team.ru>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
"Masahiro Yamada" <yamada.masahiro@socionext.com>,
"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
"Michal Hocko" <mhocko@suse.com>,
"Mikhail Zaslonko" <zaslonko@linux.ibm.com>,
"Petr Mladek" <pmladek@suse.com>,
"Ralph Campbell" <rcampbell@nvidia.com>,
"Randy Dunlap" <rdunlap@infradead.org>,
"Roman Gushchin" <guro@fb.com>,
"Shakeel Butt" <shakeelb@google.com>,
"Tal Gilboa" <talgi@mellanox.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Uwe Kleine-König" <uwe@kleine-koenig.org>,
"Vincenzo Frascino" <vincenzo.frascino@arm.com>,
"Yang Shi" <yang.shi@linux.alibaba.com>,
"Yu Zhao" <yuzhao@google.com>, "Tom Zanussi" <zanussi@kernel.org>
Subject: Re: [PATCH v2 0/7] Add histogram measuring mmap_lock contention latency
Date: Fri, 29 May 2020 15:38:05 -0700 [thread overview]
Message-ID: <CAJHvVcgERRjF2SytQG+kn=vQ5K3G=3zq3NS237f7E+Oew0BOZQ@mail.gmail.com> (raw)
In-Reply-To: <20200530000359.519f38720ab457435ecf7b6f@kernel.org>
On Fri, May 29, 2020 at 8:04 AM Masami Hiramatsu <mhiramat@kernel.org> wrote:
>
> On Fri, 29 May 2020 10:09:57 +0200
> Peter Zijlstra <peterz@infradead.org> wrote:
>
> > On Thu, May 28, 2020 at 06:39:08PM -0700, Axel Rasmussen wrote:
> >
> > > The use case we have in mind for this is to enable this instrumentation
> > > widely in Google's production fleet. Internally, we have a userspace thing
> > > which scrapes these metrics and publishes them such that we can look at
> > > aggregate metrics across our fleet. The thinking is that mechanisms like
> > > lockdep or getting histograms with e.g. BPF attached to the tracepoint
> > > introduces too much overhead for this to be viable. (Although, granted, I
> > > don't have benchmarks to prove this - if there's skepticism, I can produce
> > > such a thing - or prove myself wrong and rethink my approach. :) )
> >
> > Whichever way around; I don't believe in special instrumentation like
> > this. We'll grow a thousand separate pieces of crap if we go this route.
> >
> > Next on, someone will come and instrument yet another lock, with yet
> > another 1000 lines of gunk.
> >
> > Why can't you kprobe the mmap_lock things and use ftrace histograms?
>
> +1.
> As far as I can see the series, if you want to make a histogram
> of the duration of acquiring locks, you might only need 7/7 (but this
> is a minimum subset.) I recommend you to introduce a set of tracepoints
> -- start-locking, locked, and released so that we can investigate
> which process is waiting for which one. Then you can use either bpf
> or ftrace to make a histogram easily.
>
> Thank you,
>
> --
> Masami Hiramatsu <mhiramat@kernel.org>
The reasoning against using BPF or ftrace basically comes down to
overhead. My intuition is that BPF/ftrace are great for testing /
debugging on a small number of machines, but are less suitable for
leaving them enabled in production across many servers. This may not
be generally true, but due to how "hot" this lock is, I think this may
be sort of a pathological case.
Consider maple trees and range locks: if we're running Linux on many
servers, with many different workloads, it's useful to see the impact
of these changes in production, and in aggregate, over a "long" period
of time, instead of just under test conditions on a small number of
machines.
I'll circle back next week with some benchmarks to confirm/deny my
intuition on this. If I can confirm the overhead of BPF / ftrace is
low enough, I'll pursue that route instead.
The point about special instrumentation is well taken. I completely
agree we don't want a file in /proc for each lock in the kernel. :) I
think there's some argument to be made that mmap_lock in particular is
"special", considering the amount of investment going into optimizing
it vs. other locks.
next prev parent reply other threads:[~2020-05-29 22:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-28 23:52 Axel Rasmussen
2020-05-29 0:24 ` Steven Rostedt
2020-05-29 1:39 ` Axel Rasmussen
2020-05-29 8:09 ` Peter Zijlstra
2020-05-29 15:03 ` Masami Hiramatsu
2020-05-29 22:38 ` Axel Rasmussen [this message]
2020-05-29 5:32 ` Thomas Gleixner
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='CAJHvVcgERRjF2SytQG+kn=vQ5K3G=3zq3NS237f7E+Oew0BOZQ@mail.gmail.com' \
--to=axelrasmussen@google.com \
--cc=Liam.Howlett@oracle.com \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=ardb@kernel.org \
--cc=avagin@gmail.com \
--cc=brendanhiggins@google.com \
--cc=chenqiwu@xiaomi.com \
--cc=christian.brauner@ubuntu.com \
--cc=christian@kellner.me \
--cc=clabbe@baylibre.com \
--cc=cyphar@cyphar.com \
--cc=dan.j.williams@intel.com \
--cc=daniel.m.jordan@oracle.com \
--cc=davem@davemloft.net \
--cc=davidgow@google.com \
--cc=dbueso@suse.de \
--cc=ebiederm@xmission.com \
--cc=esyr@redhat.com \
--cc=glider@google.com \
--cc=guro@fb.com \
--cc=jamieliu@google.com \
--cc=jgg@ziepe.ca \
--cc=jglisse@redhat.com \
--cc=jhubbard@nvidia.com \
--cc=john.garry@huawei.com \
--cc=junaids@google.com \
--cc=jwadams@google.com \
--cc=keescook@chromium.org \
--cc=khlebnikov@yandex-team.ru \
--cc=kirill.shutemov@linux.intel.com \
--cc=krzk@kernel.org \
--cc=ldufour@linux.ibm.com \
--cc=ldv@altlinux.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mark.rutland@arm.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=mhocko@suse.com \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=rcampbell@nvidia.com \
--cc=rdunlap@infradead.org \
--cc=rientjes@google.com \
--cc=rostedt@goodmis.org \
--cc=shakeelb@google.com \
--cc=takahiro.akashi@linaro.org \
--cc=talgi@mellanox.com \
--cc=tglx@linutronix.de \
--cc=uwe@kleine-koenig.org \
--cc=vbabka@suse.cz \
--cc=vincenzo.frascino@arm.com \
--cc=viro@zeniv.linux.org.uk \
--cc=walken@google.com \
--cc=will@kernel.org \
--cc=willy@infradead.org \
--cc=yamada.masahiro@socionext.com \
--cc=yang.shi@linux.alibaba.com \
--cc=yuzhao@google.com \
--cc=zanussi@kernel.org \
--cc=zaslonko@linux.ibm.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