From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81C4AE66887 for ; Sat, 23 Nov 2024 21:15:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1371D6B0085; Sat, 23 Nov 2024 16:15:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E8526B0088; Sat, 23 Nov 2024 16:15:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF1F06B0089; Sat, 23 Nov 2024 16:15:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D06F26B0085 for ; Sat, 23 Nov 2024 16:15:57 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 594831C892B for ; Sat, 23 Nov 2024 21:15:57 +0000 (UTC) X-FDA: 82818617112.24.9B90E64 Received: from out-172.mta1.migadu.com (out-172.mta1.migadu.com [95.215.58.172]) by imf08.hostedemail.com (Postfix) with ESMTP id BBFA416000E for ; Sat, 23 Nov 2024 21:15:54 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=dxkobz0M; spf=pass (imf08.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.172 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1732396555; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=MXmSBrZpWl/Xy/VpB0EsgeUw0zP4+U6MJ+lql+/W8ws=; b=oCrmjozSWNUxQubQSgWbgQin9ur4X/tsy0gS9muwn9mS894uFzuvvDZFVph0MDeilrDS9f AnR5Vrc29LB/NkbfKhubkGO6JrJiBAPGNaCPzyg2sVHtrjDve+yiEUjF3YTD13Y7YLlN7T pEc84WEX2bEbvnGe7Awp/9TRWgxNxXQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1732396555; a=rsa-sha256; cv=none; b=PrE/y8LwKP/23adlKi8+o3ypLmnQuXVYRi+DoozzWrRe6h6cFIVsDGVH+Mevb7+i4hdE4H fYZLA3tOUW9W6PbQiTEWMpsF4VOrSgUnDZvZuTSFCXFl9mztbh85kvlizBk6QRvKV5BYel btPTT7EEpN5VJjV5HDujCLRfcDrqDsU= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=dxkobz0M; spf=pass (imf08.hostedemail.com: domain of shakeel.butt@linux.dev designates 95.215.58.172 as permitted sender) smtp.mailfrom=shakeel.butt@linux.dev; dmarc=pass (policy=none) header.from=linux.dev Date: Sat, 23 Nov 2024 13:15:41 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1732396549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MXmSBrZpWl/Xy/VpB0EsgeUw0zP4+U6MJ+lql+/W8ws=; b=dxkobz0MvFMtfcUDntw4+WeL4boWWsnW0X5Mi1WFim5eEIZp6baQ8ldbTujGnmE0LeByQz 7yoZWeQS71FeX5Fa0LGuW7iKce9m+tfdq/vR9GwjUAdLLxReVuTmQ3JJWvd5rZD1NkZ+Bn ySWDBcsR8uL1hGeWD8Z9FfyFNpkgiOY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Shakeel Butt To: Vlastimil Babka Cc: Andrew Morton , Sebastian Andrzej Siewior , Tejun Heo , Michal Koutny , Johannes Weiner , Michal Hocko , Roman Gushchin , Muchun Song , Axel Rasmussen , Steven Rostedt , Suren Baghdasaryan , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Meta kernel team Subject: Re: [PATCH] mm: mmap_lock: optimize mmap_lock tracepoints Message-ID: References: <20241123060939.169978-1-shakeel.butt@linux.dev> <99c6af52-942f-4262-a79d-53a9c2e8eefe@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <99c6af52-942f-4262-a79d-53a9c2e8eefe@suse.cz> X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam10 X-Stat-Signature: cr9816ihsij74iof98im84b969hn5wtg X-Rspamd-Queue-Id: BBFA416000E X-Rspam-User: X-HE-Tag: 1732396554-722917 X-HE-Meta: U2FsdGVkX18Pq3XGDaqZ7N3KTrVOraRRiW8iR7cDcHY8t2/qcUOftlxlNOGQj48qGUM5ROfPQvbXHQ7sQmBn4rJ6tbzz/6QW01Fmua+vRk0JYRgygb5EADSSOdOupTsrJryKr6bTGUYBI6C9s2Ru45g1Tq482odC2yLzur8USCp/F40vA9AplShO9NsdR8cbV/uMMYNNcIaEjoHcmoC0S6CPSPEGiliK1xyCBX+2xu8DIBGCXcuxN6OGj1q+XzPNh2dO+tL1BNTIs5SMf6TskPjSGj7eUn2arpzStBrUGzkSOSKAh0unO5znEf4whjXc6JhKVjyFSXg7oO7wUOMziQUa0Vb7DPKpAQYpiZMVaxxi8YPpARtD/++2qiBxchCOinOXcbADwEtLFWANAJ4DXwE7eoH8mJT07u8MkGfEYCT7jWwmERJeG57u6DaTPvq5MUoOWQTK3Hj+dzYGV+FGZ2czQxut3ESAS6vHRbQdyjdH+oFlbIHarJkQxtRwkXbkLOHV6VVMYGCsY0RkfFWa5m1KSvHCfRN5ERgEDKf7yv+NS/8114yrt1dY1qhH/GZ6sdlAtc5mD4Y1TDPd1t1TMvArVI2ZOl50jNW74ooaKkyb2gLxw1FHZB9ITYEo+lSGB7jPHrlnux/UTvqFuNB0z1p81hf1tfV6T8GCmwuoW0rBXW34sDbjRf82BSW0tfuFCREeUJncmwDjA6afquayVrM/wU5byupUB1u84/N6v2Lrh2mldJYNPZW2t3GVunbMT7YYXcd1aG3r4JZjM0Vt10JBM5hxlHW+Sf92B1Jw68cuQE14mOL4VkzAsl5dx6vjhX/FmNtkIhT+beQsJfQV2GanWaQcF317v3x93UPXzNposiV5V+/xNLleSfyjDopbWN3hD2Aa/DgTMrsxl/Lu2Km6IKjmp5GWTx2xlYYcO4V5oUF/kJh3CM+zgqsrIDjiiLrUFPkYiWhOwIsPuF7 61yhAvjl 38s/nEapKB5euxHrLqmo7N1zC6U+YkOhMfZZSazxa1AxGkMVAIxpDo55sYDGti1I88BiJmGtMHAnFcALzW8TUiI+oY9sriU1wICPujKpZN6/gLkrIep4pdQuPNpseAs0xOvPNhKpp18jYHqkLlLDbYKndiDfHsXZGhLllRkhXwMoJ/YLx+UannDvZozhnza4A2VH33EtYwPmm5tb2RvFWCF4ZBA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 > > 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.