diff options
| author | Kirill A. Shutemov <[email protected]> | 2023-03-12 14:26:04 +0300 | 
|---|---|---|
| committer | Dave Hansen <[email protected]> | 2023-03-16 13:08:40 -0700 | 
| commit | f7d304343b9d2456ffba23b99d2345408251ea45 (patch) | |
| tree | c7e5315aaeaac40909084a5784a0536c858091b6 /fs/proc/array.c | |
| parent | 2f8794bd087e7958c8d1f0a0538856ca03e0bf3c (diff) | |
mm: Expose untagging mask in /proc/$PID/status
Add a line in /proc/$PID/status to report untag_mask. It can be
used to find out LAM status of the process from the outside. It is
useful for debuggers.
Signed-off-by: Kirill A. Shutemov <[email protected]>
Signed-off-by: Dave Hansen <[email protected]>
Acked-by: Catalin Marinas <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Tested-by: Alexander Potapenko <[email protected]>
Link: https://lore.kernel.org/all/20230312112612.31869-10-kirill.shutemov%40linux.intel.com
Diffstat (limited to 'fs/proc/array.c')
| -rw-r--r-- | fs/proc/array.c | 7 | 
1 files changed, 7 insertions, 0 deletions
| diff --git a/fs/proc/array.c b/fs/proc/array.c index 9b0315d34c58..6daea628bc76 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -91,6 +91,7 @@  #include <linux/user_namespace.h>  #include <linux/fs_struct.h>  #include <linux/kthread.h> +#include <linux/mmu_context.h>  #include <asm/processor.h>  #include "internal.h" @@ -423,6 +424,11 @@ static inline void task_thp_status(struct seq_file *m, struct mm_struct *mm)  	seq_printf(m, "THP_enabled:\t%d\n", thp_enabled);  } +static inline void task_untag_mask(struct seq_file *m, struct mm_struct *mm) +{ +	seq_printf(m, "untag_mask:\t%#lx\n", mm_untag_mask(mm)); +} +  int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,  			struct pid *pid, struct task_struct *task)  { @@ -438,6 +444,7 @@ int proc_pid_status(struct seq_file *m, struct pid_namespace *ns,  		task_mem(m, mm);  		task_core_dumping(m, task);  		task_thp_status(m, mm); +		task_untag_mask(m, mm);  		mmput(mm);  	}  	task_sig(m, task); |