Skip to content

Commit 4ff6c22

Browse files
committed
numastat: default NR_BOUNCE to 0
It was removed and defaulted to zero in 6.16. This allows us existing code to continue working with compatibility for old kernels. The "Bounce" field in meminfo will likely remain hard-coded to zero for a long time anyway. Signed-off-by: Stephen Brennan <[email protected]>
1 parent 267db6d commit 4ff6c22

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

drgn_tools/meminfo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,9 @@ def get_all_meminfo(prog: Program) -> Dict[str, int]:
509509
stats["NFS_Unstable"] = 0
510510
if "NR_UNSTABLE_NFS" in global_stats:
511511
stats["NFS_Unstable"] = global_stats["NR_UNSTABLE_NFS"]
512-
stats["Bounce"] = global_stats["NR_BOUNCE"]
512+
# Since 194df9f66db8d ("mm: remove NR_BOUNCE zone stat") in v6.16, NR_BOUNCE
513+
# is removed from stats and set to zero.
514+
stats["Bounce"] = global_stats.get("NR_BOUNCE", 0)
513515
stats["WritebackTmp"] = global_stats["NR_WRITEBACK_TEMP"]
514516

515517
stats["CommitLimit"] = get_vm_commit_limit(prog)

drgn_tools/numastat.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ def get_per_node_meminfo(prog: Program, node: Object) -> Dict[str, int]:
8989

9090
totalram_pages = node_zone_stats["NR_MANAGED_PAGES"]
9191
freeram_pages = node_zone_stats["NR_FREE_PAGES"]
92-
bounce_pages = node_zone_stats["NR_BOUNCE"]
92+
# Since 194df9f66db8d ("mm: remove NR_BOUNCE zone stat") in v6.16, NR_BOUNCE
93+
# is removed from stats and set to zero.
94+
bounce_pages = node_zone_stats.get("NR_BOUNCE", 0)
9395
mlocked_pages = node_zone_stats["NR_MLOCK"]
9496

9597
slab_reclaimable = node_zone_stats["NR_SLAB_RECLAIMABLE"]

0 commit comments

Comments
 (0)