linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>,
	linux-kernel@vger.kernel.org,  linux-mm@kvack.org
Subject: [PATCH 3/3] mm,thp: fix smaps THPeligible output alignment
Date: Mon, 14 Aug 2023 13:02:08 -0700 (PDT)	[thread overview]
Message-ID: <cfb81f7a-f448-5bc2-b0e1-8136fcd1dd8c@google.com> (raw)
In-Reply-To: <dc264fd6-40bb-6510-db36-9340a5f01d94@google.com>

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 <hughd@google.com>
---
 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.
-- 
2.35.3



  parent reply	other threads:[~2023-08-14 20:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-14 19:58 [PATCH 0/3] mm,thp: fix sloppy text output Hugh Dickins
2023-08-14 20:00 ` [PATCH 1/3] mm,thp: no space after colon in Mem-Info fields Hugh Dickins
2023-08-15 17:52   ` David Hildenbrand
2023-08-14 20:01 ` [PATCH 2/3] mm,thp: fix nodeN/meminfo output alignment Hugh Dickins
2023-08-15 17:52   ` David Hildenbrand
2023-08-14 20:02 ` Hugh Dickins [this message]
2023-08-15 14:27   ` [PATCH 3/3] mm,thp: fix smaps THPeligible " Alexey Dobriyan
2023-08-15 16:57     ` Hugh Dickins

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=cfb81f7a-f448-5bc2-b0e1-8136fcd1dd8c@google.com \
    --to=hughd@google.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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