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 3F1EBC3DA5D for ; Mon, 22 Jul 2024 09:05:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A47CB6B0083; Mon, 22 Jul 2024 05:05:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9F76F6B0085; Mon, 22 Jul 2024 05:05:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8E5AD6B0088; Mon, 22 Jul 2024 05:05:10 -0400 (EDT) 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 723BF6B0083 for ; Mon, 22 Jul 2024 05:05:10 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 238F71615E2 for ; Mon, 22 Jul 2024 09:05:10 +0000 (UTC) X-FDA: 82366804380.27.5710487 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf28.hostedemail.com (Postfix) with ESMTP id 5009DC0004 for ; Mon, 22 Jul 2024 09:05:08 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=l374TXwm; spf=pass (imf28.hostedemail.com: domain of vbabka@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=vbabka@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1721639086; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=zKTF3eKKIOyz/5CWAxf14fwfkGFPdKKgoOsYu+8awVs=; b=YZdubclaG+kkkffHVqUeS9JSO+SDGXfBNiOe0ImJ7BETOlY0VkM8SCFRHfnq3NjgOhVofB IA9I3Q4rHS6u44CvlRuL16YUwBps9Jy9sIiVwNnd74Twq1KbIK1jtUtGZSVk1OT40ElxWd oRKvnQxwFiUdKjC+8hTpB0xusgUSV9k= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=l374TXwm; spf=pass (imf28.hostedemail.com: domain of vbabka@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=vbabka@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1721639086; a=rsa-sha256; cv=none; b=yOMnOvwuBOkPYIOHWXVFwk2QsJcReuppFarkEHpzpC6VCnnGOiZnqfg1ENvEP3rkmL42Cq 39SCKcGnw7+y3J+xxcAOC5FWWSaFmWQtGVymvv9w+sTXbCoYT8eUEh2eVfLE3xTKrAth4F sxhnveG46QvROPAeJoj83iQ+ALX2Q4M= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4BB7A6059E; Mon, 22 Jul 2024 09:05:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90FB4C116B1; Mon, 22 Jul 2024 09:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721639107; bh=4IufoW688MjV8pE1fRIvZ9u2QgVm4cdy1VM0wxvozJM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=l374TXwmXQ+pn1tf2oKS7UTwab4j2urTeLjNfe82TQG7kZWsgX8SbjWjiUnY+d2jc yo3i3yv+VceZ9gLHsTMlHpvPQnLkQOF9WQLAuFr2QxRo2RmsshJqig1A6YnrZv04+3 0hSE2ivVsBQTHoigcw+NkhHudQwWNxdCMLS6J+jHXsFWDWpx79HflY3q1nvoT5Tj/1 F8+iwBL6xZI8LIGmLy+BL8mIi4E3UeHqF0MUEb49jgDX7VlhPawZnVotzh/pcgHsuv +3mDXOnaKVrFmf+ETzCa0R5BMs19EiqtNAnlImbXnatjkdZnBavyQ6ETNsUphdqtzB 47QzaOvmbhzXg== Message-ID: <549a3199-2eb5-41b1-a03b-9cc571e72e03@kernel.org> Date: Mon, 22 Jul 2024 11:05:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Tools for explaining memory mappings/usage/pressure To: David Rientjes , Michal Hocko , Andrew Morton , Mel Gorman , Balbir Singh , Peter Zijlstra Cc: linux-mm@kvack.org References: <29c27dab-a590-5df2-c840-279bf9dff090@google.com> Content-Language: en-US From: "Vlastimil Babka (SUSE)" In-Reply-To: <29c27dab-a590-5df2-c840-279bf9dff090@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: 5009DC0004 X-Stat-Signature: xfjeumyjd5efj3713zdxb3w1dzdxwsrr X-HE-Tag: 1721639108-925757 X-HE-Meta: U2FsdGVkX18f/RB0tR9+3tty5yZAcs34RESd60W+5UE9yH67xJYkKag2bXVQSNyOdaSWRtIyhETfzJKOvCwOMWCX2OgVU2WzDHx7yOhgBYaag/bvADMWTRqq0wgwLcTVTGO1DwPjWlenYPC6ejohtH1UNH1ZZUatdxN1vdUlKgWK5xDAE8gkuBBgx51vpLC0VrRltkspy+npf/zTkwDpvMGti6ifwg4EsTwFuxhWkJZkd8qOd/MZL52OtNOVLOWxIAkksxecpiM718jTA104eA/dJOoRsghOjsCiCkhV9SzsNWItcLnLacbdRViqMg3c0mgV1oRcddbDn0M17p1UOcvmynJKGivF5+eTCVAWcpE0Y/ZZ7nk771GvWRwzJWAS7HfxZdHjituHv4A2I9yB4KuDI+lrIixP7CeDPBtiXQZsMqWm5h/waK1Z1LC/bGsnjMwN+mRNEJo/LOZXim95AjG0rWPT1Yx0SBkXdMmE/lq5b7JUBXQe+B+9p6CLcBa/6mW8jEeGwNYKfybswXqDmzj3pMnWu+7+nus6tkEtWMnGKG2LFAL7b80mHZsnMFjcHQbOfmBUZJK2r1MiTz7AmKXrBV46yteCrQwN4VTYEnmZmteB/wSycpv9v6Y9eMycG8p7KBMvGOSPwnZAy/bbLnwRXs/NaEybrjmzQv8kQATxJeP4MnylI75eON7avgveA8vYdJbp73X//uyuUHDWsDEyu492wiY6D2tSDF2lWnGuXmtFTUlOSCEB5+Xx/2dzajSHOLWNNzq1fd9S17REbag8xZbXNZ0GFrvEXLRo9DcDE9/1P/Dim8eBislCWyNga/Euq5uRSd0sD31OhfZgPGIrAmL+DCAJEivPWQMvJv1QUieaq0dYpG1Rq5WJaYVee+qnM4OEo+tyU4lffsokagiuSl0JndOApNxX+frdzAvJIjyD9cdhkP0IKay2FtJum+dvTqb5OeBADY9tIZs 0Q+w1/m4 oEQz5jUn41gia+xyDFBuYWodXSrnZ3SmdOHFxCBFZYqB06sewdq3pMtafDWH+ka/pGzXBgU7fFWbhvqeralfXfYd8f0vYUQaHNOXwng3Rcv4S3lxj2X9aOnWLcOdNhnP0pahb6LxBCX6pJEK8TiJrOGzhgF2vuApwsuZhJOnTznOX6/3JAQKnu6bL02g6AMo8TCA+SxX80xjdmFPGemM1kGyhAzhjWznFGMLh 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 7/6/24 10:55 PM, David Rientjes wrote: > Hi all, > > I'm trying to crowdsource information on open source tools that can be > used directly by customers to explain memory mappings, usage, pressure, > etc. > > We encounter both internal and external users that are looking for this > insight and it often requires significant engineering time to collect data > to make any conclusions. > > A recent example is an external customer that recently upgraded their > userspace and started to run into memcg constrained memory pressure that > wasn't previously observed. After handing off a hacky script to run in > the background, it was immediately obvious that the source of the direct > reclaim was all of the MADV_FREE memory that was sitting around. > Converting to MADV_DONTNEED solved their issue. BTW, was this reported/fixed upstream? Sounds like a bug to me that would better be fixed than suggesting the MADV_DONTNEED workaround to everyone from now on. > A month ago, a different external customer was concerned about increased > memory access latency in their guest on some instances although there > were no issues observable on the host. After handing off a hacky script > to run in the background, it was immediately obvious that memory > fragmentation was resulting in a large disparity in the number of > hugepages that were available on some instances. > > Rather than hacky scripts that collect things like vmstat, memory.stat, > buddyinfo, etc, at regular intervals, it would be preferable to hand off > something more complete. Idea is an open source tool that can be run in > the background to collect metrics for the system, NUMA nodes, and memcg > hierarchies, as well as potentially from subsystems in the kernel like > delay accounting. IOW, I want to be able to say "install ${tool} and send > over the log file." > > Are thre any open source tools that do a good job of this today that I can > latch onto? If not, sounds like I'll be writing one from scratch. Let me > know if there's interest in this as well. > > Thanks! >