Skip to contentSkip to conversation

mm: add last level page table numa info to /proc/pid/numa_pgtable

RFC PATCH Superseded Xin Hao 1 participant 1 message Jul 31, 2022

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Xin Hao

author
#0 lore raw

RFC PATCH v2 1/1 mm: add last level page table numa info to /proc/pid/numa_pgtable

In many data center servers, the shared memory architectures is Non-Uniform Memory Access (NUMA), remote numa node data access often brings a high latency problem, but what we are easy to ignore is that the page table remote numa access, It can also leads to a performance degradation.

So there add a new interface in /proc, This will help developers to get more info about performance issues if they are caused by cross-NUMA.

V1 -> V2
1, As Matthew Wilcox advise, Simplify the codes.
2, Do some codes format fix.

V1: https://lore.kernel.org/linux-mm/[email protected]/T/

---
 fs/proc/base.c     |  2 ++
 fs/proc/internal.h |  1 +
 fs/proc/task_mmu.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 90 insertions(+)
fs/proc/base.c +2 -0
index 8dfa36a99c74..487e82dd3275 100644
@@ -3224,6 +3224,7 @@ static const struct pid_entry tgid_base_stuff[] = {
 	REG("maps",       S_IRUGO, proc_pid_maps_operations),
 #ifdef CONFIG_NUMA
 	REG("numa_maps",  S_IRUGO, proc_pid_numa_maps_operations),
+	REG("numa_pgtable", S_IRUGO, proc_pid_numa_pgtable_operations),
 #endif
 	REG("mem",        S_IRUSR|S_IWUSR, proc_mem_operations),
 	LNK("cwd",        proc_cwd_link),
@@ -3571,6 +3572,7 @@ static const struct pid_entry tid_base_stuff[] = {
 #endif
 #ifdef CONFIG_NUMA
 	REG("numa_maps", S_IRUGO, proc_pid_numa_maps_operations),
+	REG("numa_pgtable", S_IRUGO, proc_pid_numa_pgtable_operations),
 #endif
 	REG("mem",       S_IRUSR|S_IWUSR, proc_mem_operations),
 	LNK("cwd",       proc_cwd_link),
fs/proc/internal.h +1 -0
index 06a80f78433d..e7ed9ef097b6 100644
@@ -296,6 +296,7 @@ struct mm_struct *proc_mem_open(struct inode *inode, unsigned int mode);
 
 extern const struct file_operations proc_pid_maps_operations;
 extern const struct file_operations proc_pid_numa_maps_operations;
+extern const struct file_operations proc_pid_numa_pgtable_operations;
 extern const struct file_operations proc_pid_smaps_operations;
 extern const struct file_operations proc_pid_smaps_rollup_operations;
 extern const struct file_operations proc_clear_refs_operations;
fs/proc/task_mmu.c +87 -0

91 lines not on this page · raw message

--
2.31.0