Skip to content

Commit

Permalink
tools/vm/page-types: remove dependency on opt_file for idle page trac…
Browse files Browse the repository at this point in the history
…king

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
  ...

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Changbin Du <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
changbindu authored and torvalds committed Sep 24, 2021
1 parent d09c387 commit ebaeab2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/vm/page-types.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ebaeab2

Please sign in to comment.