linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Shakeel Butt <shakeel.butt@linux.dev>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	 Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Tejun Heo <tj@kernel.org>, Michal Koutny <mkoutny@suse.com>,
	 Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>,
	 Roman Gushchin <roman.gushchin@linux.dev>,
	Muchun Song <muchun.song@linux.dev>,
	 Axel Rasmussen <axelrasmussen@google.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	 Suren Baghdasaryan <surenb@google.com>,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	 linux-kernel@vger.kernel.org,
	Meta kernel team <kernel-team@meta.com>
Subject: Re: [PATCH] mm: mmap_lock: optimize mmap_lock tracepoints
Date: Sat, 23 Nov 2024 13:15:41 -0800	[thread overview]
Message-ID: <a2aa5dbl2lwi3q3qzyds3lllgbcgruxjzwzwhnolg63i4swcus@lwtetk5wra44> (raw)
In-Reply-To: <99c6af52-942f-4262-a79d-53a9c2e8eefe@suse.cz>

On Sat, Nov 23, 2024 at 09:38:09AM +0100, Vlastimil Babka wrote:
> On 11/23/24 7:09 AM, Shakeel Butt wrote:
> > We are starting to deploy mmap_lock tracepoint monitoring across our
> > fleet and the early results showed that these tracepoints are consuming
> > significant amount of CPUs in kernfs_path_from_node when enabled.
> > 
> > It seems like the kernel is trying to resolved the cgroup path in the
> > fast path of the locking code path when the tracepoints are enabled. In
> > addition for some application their metrics are regressing when
> > monitoring is enabled.
> > 
> > The cgroup path resolution can be slow and should not be done in the
> > fast path. Most userspace tools, like bpftrace, provides functionality
> > to get the cgroup path from cgroup id, so let's just trace the cgroup
> > id and the users can use better tools to get the path in the slow path.
> > 
> > Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
> 
> AFAIU this would also remove the lockdep issue that patch [1] is solving
> with RCU conversion. It probably has other benefits on its own too, so
> just FYI. It's definitely better to avoid complex operations to gather
> tracepoint data, if avoidable.
> 
> [1] https://lore.kernel.org/all/20241121175250.EJbI7VMb@linutronix.de/
> 

Thanks for the pointer, I might add a reference to this in the commit
message in next version.


  reply	other threads:[~2024-11-23 21:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-23  6:09 Shakeel Butt
2024-11-23  6:46 ` Yosry Ahmed
2024-11-23 21:14   ` Shakeel Butt
2024-11-23  8:38 ` Vlastimil Babka
2024-11-23 21:15   ` Shakeel Butt [this message]
2024-11-23 17:01 ` Matthew Wilcox
2024-11-23 21:35   ` Shakeel Butt
2024-11-23 21:38     ` Vlastimil Babka
2024-11-24  6:26       ` Shakeel Butt
2024-11-24 13:39       ` Steven Rostedt

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=a2aa5dbl2lwi3q3qzyds3lllgbcgruxjzwzwhnolg63i4swcus@lwtetk5wra44 \
    --to=shakeel.butt@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=axelrasmussen@google.com \
    --cc=bigeasy@linutronix.de \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mkoutny@suse.com \
    --cc=muchun.song@linux.dev \
    --cc=roman.gushchin@linux.dev \
    --cc=rostedt@goodmis.org \
    --cc=surenb@google.com \
    --cc=tj@kernel.org \
    --cc=vbabka@suse.cz \
    /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