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 C7A03C3DA6E for ; Wed, 10 Jan 2024 08:43:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 14C446B0080; Wed, 10 Jan 2024 03:43:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0FDD86B0081; Wed, 10 Jan 2024 03:43:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F055B6B0083; Wed, 10 Jan 2024 03:43:16 -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 DF3516B0080 for ; Wed, 10 Jan 2024 03:43:16 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id AD33C1A0ADF for ; Wed, 10 Jan 2024 08:43:16 +0000 (UTC) X-FDA: 81662761992.10.DA104E5 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf01.hostedemail.com (Postfix) with ESMTP id 83BEB40010 for ; Wed, 10 Jan 2024 08:43:14 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1704876195; 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; bh=OrYoduDq6qpmMvcB2MISHa2xjsuFzTOeNYF58cwfOF4=; b=Hq/7gMivq+IaoaVHsteDelaOTV7+OWFFOl8lAHJKIumpf0cUbRO2QhSquuLaVyofs+AvDf JjAEDBP/ODx1ObbgB9ANDWpMxM9pTWU8VHNxo0jGydUXGCSc92fC9GYJXKY+Eh/CyInGlW V22fAqm3SD321BKg3I6acDCjNrCzRPU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1704876195; a=rsa-sha256; cv=none; b=wWScNnMEXJTojJ7hvx2QN8563iBXOB9Mwm8x6TQT+JPuxV8BTNWIHLM8NnPN9yOnZKl8+4 4pcblZgCrjFgHIgEnXQXU5VuA/5EqUvYhazf1UW4+m3S/RVgfb2uvuvJ83UJseu9TwyfUM rTfkKWOOR2T51SW1bE0eEwk1J2c2WFg= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 02B802F4; Wed, 10 Jan 2024 00:43:59 -0800 (PST) Received: from [10.57.76.12] (unknown [10.57.76.12]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D3BEC3F73F; Wed, 10 Jan 2024 00:43:11 -0800 (PST) Message-ID: Date: Wed, 10 Jan 2024 08:43:10 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH v1] tools/mm: Add thpmaps script to dump THP usage info Content-Language: en-GB To: John Hubbard , William Kucharski Cc: Barry Song <21cnbao@gmail.com>, Andrew Morton , Zenghui Yu , Matthew Wilcox , David Hildenbrand , Kefeng Wang , Zi Yan , Alistair Popple , "linux-mm@kvack.org" References: <20240102153828.1002295-1-ryan.roberts@arm.com> <29007216-8A9B-4CA2-8A87-EB33E338CBA7@oracle.com> <84b43094-9b16-40a5-94e8-6dd4e859a01f@arm.com> <0d06b0fd-01f3-4a93-811d-f39c0b326b23@arm.com> <26dc2b09-b298-4fb7-81e1-4bfba6afaff4@nvidia.com> <146a88e6-a647-4b8f-8472-af3ff7ae6b93@arm.com> <64d876e2-a181-4685-83f6-989cb5f3aa7e@nvidia.com> From: Ryan Roberts In-Reply-To: <64d876e2-a181-4685-83f6-989cb5f3aa7e@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Stat-Signature: 8dgfcq4mgdcne6ticjddftjybd1qhimu X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 83BEB40010 X-Rspam-User: X-HE-Tag: 1704876194-497461 X-HE-Meta: U2FsdGVkX1/AtcO+Rvj8gWzzbzGyLEYw9c46nDn724G3bAQMhDHyh+hps2TfhwF62onPGXsImkuhFj4VMInVmvogT89AJAcx2qUaibBI7ttQq/nf4unYa1DbvRTFGzISZc6r1L83RoR+K9Ner/+Gjhpc8+U4bH2zxRffMkhOrs6Vwwh5SuOVgxW0s+q4qBX3H+RUZuMJ82WOQwy1WDtfqknT8cSzSATtOpy50hUalbPz7AKYQb2sOv6NInDxKu0E8c29UikRo5z/OpTj2XzW3apAH4LKYsHy+xwWGeJx7MFTRuuEFx4Odfycx13tcWDrPljfIOH7dVCpDS7Sl5Vkas+aGST49PSCkCMpcc+CdPi2qlcEAD0rogaK0QKyU7k1w0G2WaKDRaJePYUVNw/tV+pXABOWQAwUPZt4lczNsmIwnZsULtSHEzAgNi/FDg5mm8to5ttqbHBPF3pK5VxoBToSVvz96C8og2Hiwzi5z3ruw3GTdARxar8yp4B0t8bPun9c3TKhfTH/YLcZrGEirMpggehP+l5MMOpidVVkZ3hV7LuUHAwkLj5U+P3N9VPQxC3O+S5pgFL9JdGVpGmtR4l7M5xMXgFJ37chUfZJ4d5xF+nI9IwdctOvkZBfvIMSw7qzAPP1p75QEZ5ts6imlJ8pKr2KkJ2BYI0/J1suyPFMOq33o/WuiUifI/esrBS70l1RrXmSu0bBnEF9C5SWwDvhLYo83MbaDm8W3mTZaFESJ2d1hQAV/DeEDSRw0fZ0EaP/CT+RK9ZDqyeewwFHwwXyxsMpif0Cm3KRNKTHn00WMSWdeQ947sZs2pEuSiGfw33Gy8ualB+qMfxeG2PXMXuFhWF3UmtwHqM9nGNvawZY47A2c9ECIqtmYnpZ2fGo99LgTbDSWFQUpQVfHqnSRoXhcRGlSyu9/huvV2jp0pnezE7tAVI6wK/7d7SJqR3+mZ+WcYYO3Z1QSjRQZqw bf5zCSdY SvbkRLeTjQPGVPm4KlheZD1D2Vl2v7dtYR+vIK0OcbO1BKtMewlJpulTU4JRs+2hEnioBtmQyqAh+Xq3VxYc9NfXsidwY/0wW+5cIUAqVSnLYrFK8YCp1ijm1qGgZNMJ9azrjkdzX3axi/Q6Nc+AouhmFPOqxcpf2uqhbTNOLTg0tBFY+DKWnx334VrvIBeM/59ar 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 05/01/2024 23:18, John Hubbard wrote: > On 1/5/24 00:35, Ryan Roberts wrote: >> right aligned with 0 or ' ' as the pad? I guess ' ' if you want it to look like >> ps? But given pid is the first column, I think it will look weird right aligned. >> Perhaps left aligned, followed by colon, followed by pad? Here are the 3 options: > > I will leave all of the alignment to your judgment and good taste. I'm sure > it will be fine. > > (I'm not trying to make the output look like ps(1). I'm trying to make the pid > look like it "often" looks, and I used ps(1) as an example.) > >> >> 00000206: 0000aaaadbb20000-0000aaaadbb21000 r-xp 00000000 fe:00 00426969 I'm going to go with this version ^ >>       206: 0000aaaadbb20000-0000aaaadbb21000 r-xp 00000000 fe:00 00426969 > > Sure. > >> 206:      0000aaaadbb20000-0000aaaadbb21000 r-xp 00000000 fe:00 00426969 >> >> My personal preference is the first option; right aligned with 0 pad. >> >>> >>> b) In fact, perhaps a header row would help. There could be a --no-header-row >>>     option for cases that want to feed this to other scripts, but the default >>>     would be to include a human-friendly header. >> >> How about this for a header (with example first data row): >> >>       PID             START              END PROT      OFF MJ:MN    INODE FILE > > I need to go look up with the MJ:MN means, and then see if there is a > less mysterious column name. Its the device major/minor number. I could just call it DEV (DEVICE is too long) > >> 00000206: 0000aaaadbb20000-0000aaaadbb21000 r-xp 00000000 fe:00 00426969 >> >> Personally I wouldn't bother with a --no-header option; just keep it always on. >> >>> >>> c) pid should probably be suppressed if --pid is specified, but that's >>>     less important than the other points. >> >> If we have the header then I think its clear what it is and I'd prefer to keep >> the data format consistent between --pid and --cgroup. So prefer to leave pid in >> always. >> > > That sounds reasonable to me. >   >>> >>> In a day or two I'll get a chance to run this on something that allocates >>> lots of mTHPs, and give a closer look. >> >> Thanks - it would be great to get some feedback on the usefulness of the actual >> counters! :) > > Working on it! > >> >> I'm considering adding an --ignore-folio-boundaries option, which would modify >> the way the cont counters work, to only look for contiguity and alignment and >> ignore any folio boundaries. At the moment, if you have multiple contiguous >> folios, they don't count, because the memory doesn't all belong to the same >> folio. I think this could be useful in some (limited) circumstances. >> > > This sounds both potentially useful, and yet obscure, so I'd suggest waiting > until you see a usecase. And then include the usecase (even if just a comment), > so that it explains both how to use it, and why it's useful. > > thanks,