linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools/vm/page-types: remove dependency on opt_file for idle page tracking
@ 2021-09-17  3:28 Changbin Du
  0 siblings, 0 replies; only message in thread
From: Changbin Du @ 2021-09-17  3:28 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, linux-mm, Changbin Du

Idle page tracking can also be used for process address space, not only
file mappings.

Without this change, using with '-i' option for process address space
encounters below errors reported.

$ sudo ./page-types -p $(pidof bash) -i
mark page idle: Bad file descriptor
mark page idle: Bad file descriptor
mark page idle: Bad file descriptor
mark page idle: Bad file descriptor
mark page idle: Bad file descriptor
mark page idle: Bad file descriptor
....

Signed-off-by: Changbin Du <changbin.du@gmail.com>
---
 tools/vm/page-types.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/vm/page-types.c b/tools/vm/page-types.c
index 0517c744b04e..f62f10c988db 100644
--- a/tools/vm/page-types.c
+++ b/tools/vm/page-types.c
@@ -1331,7 +1331,7 @@ int main(int argc, char *argv[])
 	if (opt_list && opt_list_mapcnt)
 		kpagecount_fd = checked_open(PROC_KPAGECOUNT, O_RDONLY);
 
-	if (opt_mark_idle && opt_file)
+	if (opt_mark_idle)
 		page_idle_fd = checked_open(SYS_KERNEL_MM_PAGE_IDLE, O_RDWR);
 
 	if (opt_list && opt_pid)
-- 
2.32.0



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-17  3:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-17  3:28 [PATCH] tools/vm/page-types: remove dependency on opt_file for idle page tracking Changbin Du

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox