From patchwork Mon Aug 14 20:02:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 13353214 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 422A0EB64DD for ; Mon, 14 Aug 2023 20:02:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B476F8E000D; Mon, 14 Aug 2023 16:02:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ACFAA8E0001; Mon, 14 Aug 2023 16:02:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 970838E000D; Mon, 14 Aug 2023 16:02:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 7E8EA8E0001 for ; Mon, 14 Aug 2023 16:02:15 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 330FC804F8 for ; Mon, 14 Aug 2023 20:02:15 +0000 (UTC) X-FDA: 81123781830.07.3D3A197 Received: from mail-oa1-f48.google.com (mail-oa1-f48.google.com [209.85.160.48]) by imf17.hostedemail.com (Postfix) with ESMTP id 26D1A40026 for ; Mon, 14 Aug 2023 20:02:11 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=lDXYOI3e; spf=pass (imf17.hostedemail.com: domain of hughd@google.com designates 209.85.160.48 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1692043332; 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=vfRGFHRblVYm9a4Zjcxv2SCcEUrJ5g3lq6KKqWpPSec=; b=6nxzeMYi/azQ71xaab7sg67zGfz7KSNxyxd9+V2x1zhA1vm30LnFn1L/8LB4FJci3F7AWr fa0q8OTYWBRhLufKs/KW+Y7cn4LVkKOiPC7ZKqWDbaEa4zwcl/JMbpAHd1Y2izzQjIXg+n eg9rjbcWwh2ebKWfLHTL+LQf86UuDao= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1692043332; a=rsa-sha256; cv=none; b=3m0imDxPC4rob7pFTHV259tOzp7WGpzzCULcW97wOyhJZ409DqC/r53vP8WzMWPIDS1jhm EIo+8xqjrohaRWvvpBy0PtylVU0lb41j6O1igCCDYMo02wwyUPwoy1cokNrd/jcaO1hFCp K2CfUrP7Qo49nKoHLcX9G3qPkKMer0E= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b=lDXYOI3e; spf=pass (imf17.hostedemail.com: domain of hughd@google.com designates 209.85.160.48 as permitted sender) smtp.mailfrom=hughd@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-1c0fcbf7ae4so3252813fac.0 for ; Mon, 14 Aug 2023 13:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1692043331; x=1692648131; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=vfRGFHRblVYm9a4Zjcxv2SCcEUrJ5g3lq6KKqWpPSec=; b=lDXYOI3eqyv2pAGd9fdn+sbA7tEtD1U4ZnyxWf5DmxG+/pG4TaMd9si5JjxV+Y4elW QvgOMxk3NY7c9BnKG22wjYy//1uPNmxeNb9pDlpqRqy8cAieAlY5mIjfXRi0Ut1Uh+1w 5JQrpwcdY/7Ev4qoTy7WGyScS8UOWj9apJda3pbd2KkeO9zP9CVQjFBL+VzITKto60yk hhbdoUn7Vej+ExjmddY71eQ1JeHAyKipqNoT8sPuvBZDTfZFFRj/scEnEu4uRwc4Mr3l 5gGyuCkGmIkee0EzLlxak+SxDLmi+DKJZMjYb1+hi2RfaiKUGgHwYojlM/stqeS1ZaXD kSBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692043331; x=1692648131; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vfRGFHRblVYm9a4Zjcxv2SCcEUrJ5g3lq6KKqWpPSec=; b=c9ZCpGiYfYd6ABWJNUVJ81Vu6uxCe0+8rTud+vFxgvJJs/lfn8Wc7It9Twx0w1ladK iaRtkYueNqc6Cm48HsoVupQqDdljVoPGmG01qy7g7ImlFH0z2t74FZ3sZXCCoSTIPa0e u/Ge/Ce5IRgwl1culdmPjSZCpJzbFUPoRZAgifK4qTohfP82FjnSD/D6L68UPAPaIcOR /8jeOf6AeUMp+ROVqkan/7meWOKLXu4xah9aFQS+kZemyE0UXqLmh9XMg2TTqpN9AII3 s+mUPr3XKajXsBm0Od1iSu6+kxl6BD5DEOsOlysrI7rzhebRXwGawttHhBFvxRcFyRrK PUIQ== X-Gm-Message-State: AOJu0Yxbmd3PKMwtOZMI1jtPO1/ox+bujt50f4NibF3KDismFQKfRCeS 2GjwLRQkOXCNITjjahLD0oiWCVbdIxbD+6HD7dxCJg== X-Google-Smtp-Source: AGHT+IHC+0qdqxsysM02okguYcvI1jvs0bLxTCBtuuiFTVTXL1MJdj93jH7snfqXUjweHqeLCIdazQ== X-Received: by 2002:a05:6870:e990:b0:1bb:8483:a807 with SMTP id r16-20020a056870e99000b001bb8483a807mr11104238oao.44.1692043330522; Mon, 14 Aug 2023 13:02:10 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id d63-20020a0df442000000b0057042405e2csm2970168ywf.71.2023.08.14.13.02.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 13:02:10 -0700 (PDT) Date: Mon, 14 Aug 2023 13:02:08 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton cc: Alexey Dobriyan , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 3/3] mm,thp: fix smaps THPeligible output alignment In-Reply-To: Message-ID: References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 26D1A40026 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 7n5z7xk3zyt57wp4xhx9ndr3zgryk6ky X-HE-Tag: 1692043331-536531 X-HE-Meta: U2FsdGVkX1/IcBiJapKYrPw3Cf3QpTFEqMKigDvy+16aCdSbvRJBPp6EgUMii4UMLIDKVZ6HAQZ5OJxtcm/dTMtyAbyke8ZB+9CPamzY7z/sDVe+rxmEzOur4esRkjWB6g9U0IhgeQU03hsy1bjSO1fvPTZ0LmuYGY/j4Gm7OQnl9cYUnqIVmpH9aD2Kql6GhrQ0Slaehm0ca8EOacadEd8TzlzJnOa04NiOw7VZ6GPv7BOs/W4cxc9Ckv3gR18H3BdeiKdUHtDMu5RykkXQU6aPi/hbFCWmnjY/FzWsAGfCTDsJHneV7fhB7nmQhywcMF3SlUcQPiBLmIwdsYA0bkAaG6qffWlaeXAK7hz00VfDKQETIKPvh70wKE4GhoZhsxFmC5ykXMejY4XlHewMIQLAp1ejwqzJ8Kh0bIecbEmxfEBhYeuOA3IAor9BFQALWnpiVuspAWINFPvANjMFhPyWW136QXDHVYYWPUfAXf/seGvU4nv8Y0wtlAt7B6SVfjLoKyn0WzuANoJqI2YqofD2eMl3F+cJbtnF36CHrfArmauuBcgMEcFQ5QhI42B8kSAA3fHnyhRdK1eWag9Glj5mRMu6zpLhvVQrPbW7Qn/cw/0EyrNGNSfjH9BJiZEfUpDuZbSKFz1LbyGV8jMXiGzunCUHmNM7p7tynA9HzN86xt48JUwDfuUjmdDirOy5farXj+S2jSPaMghuJS4e+TEAqKnlqWaMgjrsuL1oco45Ry0p/+4pqwDbOQrwUObb4efRf0lC6hP6JerRwrD8rW1bwCtgjKDoLYaWS/+sBwxauMTxEnNloGQe+GB8s2x7LLBttWkZHbELUUBizIBRZpjH87PHU+sRDjMCMCCBd7fyBkIWfNEtrwsG8kEVwEBQTihJtdk4BwCjX13vVraECyVZrGdYIBUxcwtK5RwTrhFBNcj3xvDUX0WUF1LOgtrjvh55uw43pWQAabnVad0 mM81uitf ZaakyobtrfVaRhLrw3e58MCoWmBv0xr3P0AgWLFPjXAI9o/9t2qA1xwf2P3kh8ycZHUFLM3x2J2UAWFPreZrV/n0lRMBpBUqPphFacennF6MMgXcVBR3zB56seJYA+6pvh94QwGwfcZW3Mk/CqXVIGF/djbM38t0JVbsAYMNPn/uppYaPpa02WUQ518+mRNVambAgkt03Jqsz17g6cRD8wtD/Dfjb1dOIiMpXYsoPlCr77WOMU1AiUqtoAubJnxOf905P6/RJFgL2D324Bx1x+aqtQ0AZR4hE05/vQcpzUNnCHNODkWNJQk5gyk0r677BdtNHSxjf4uz/zVwjM1F5Ca0u3toEyL3obGSiRfL4zaFL4HOCns3YJdyJwfQpfkqivmMc 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: Extract from current /proc/self/smaps output: Swap: 0 kB SwapPss: 0 kB Locked: 0 kB THPeligible: 0 ProtectionKey: 0 That's not the alignment shown in Documentation/filesystems/proc.rst: it's an ugly artifact from missing out the %8 other fields are using; but there's even one selftest which expects it to look that way. Hoping no other smaps parsers depend on THPeligible to look so ugly, fix these. Signed-off-by: Hugh Dickins --- fs/proc/task_mmu.c | 2 +- tools/testing/selftests/proc/proc-empty-vm.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 51315133cdc2..15ddf4653a19 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -855,7 +855,7 @@ static int show_smap(struct seq_file *m, void *v) __show_smap(m, &mss, false); - seq_printf(m, "THPeligible: %d\n", + seq_printf(m, "THPeligible: %8u\n", hugepage_vma_check(vma, vma->vm_flags, true, false, true)); if (arch_pkeys_enabled()) diff --git a/tools/testing/selftests/proc/proc-empty-vm.c b/tools/testing/selftests/proc/proc-empty-vm.c index dfbcb3ce2194..b16c13688b88 100644 --- a/tools/testing/selftests/proc/proc-empty-vm.c +++ b/tools/testing/selftests/proc/proc-empty-vm.c @@ -82,7 +82,7 @@ static const char proc_pid_smaps_vsyscall_1[] = "Swap: 0 kB\n" "SwapPss: 0 kB\n" "Locked: 0 kB\n" -"THPeligible: 0\n" +"THPeligible: 0\n" /* * "ProtectionKey:" field is conditional. It is possible to check it as well, * but I don't have such machine. @@ -112,7 +112,7 @@ static const char proc_pid_smaps_vsyscall_2[] = "Swap: 0 kB\n" "SwapPss: 0 kB\n" "Locked: 0 kB\n" -"THPeligible: 0\n" +"THPeligible: 0\n" /* * "ProtectionKey:" field is conditional. It is possible to check it as well, * but I'm too tired.