Skip to contentSkip to conversation

mm: vmscan: show zone type in kswapd tracepoints

PATCH In review Yafang Shao 2 participants 5 messages Mar 1, 2019 – Mar 12, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: vmscan: show zone type in kswapd tracepoints

If we want to know the zone type, we have to check whether CONFIG_ZONE_DMA, CONFIG_ZONE_DMA32 and CONFIG_HIGHMEM are set or not, that's not so convenient.

We'd better show the zone type directly.

---
 include/trace/events/vmscan.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
include/trace/events/vmscan.h +6 -3
index a1cb913..4c8880b 100644
@@ -73,7 +73,10 @@
 		__entry->order	= order;
 	),
 
-	TP_printk("nid=%d zid=%d order=%d", __entry->nid, __entry->zid, __entry->order)
+	TP_printk("nid=%d zid=%-8s order=%d",
+		__entry->nid,
+		__print_symbolic(__entry->zid, ZONE_TYPE),
+		__entry->order)
 );
 
 TRACE_EVENT(mm_vmscan_wakeup_kswapd,
@@ -96,9 +99,9 @@
 		__entry->gfp_flags	= gfp_flags;
 	),
 
-	TP_printk("nid=%d zid=%d order=%d gfp_flags=%s",
+	TP_printk("nid=%d zid=%-8s order=%d gfp_flags=%s",
 		__entry->nid,
-		__entry->zid,
+		__print_symbolic(__entry->zid, ZONE_TYPE),
 		__entry->order,
 		show_gfp_flags(__entry->gfp_flags))
 );
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 5 lines · Yafang Shao

If we want to know the zone type, we have to check whether CONFIG_ZONE_DMA, CONFIG_ZONE_DMA32 and CONFIG_HIGHMEM are set or not, that's not so convenient.

We'd better show the zone type directly.

I do agree that zone number is quite PITA to process in general but do we really need this information in the first place? Why do we even care?

Zones are an MM internal implementation details and the more we export to the userspace the more we are going to argue about breaking userspace when touching them. So I would rather not export that information unless it is terribly useful.

Quoted 36 lines
---
 include/trace/events/vmscan.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
include/trace/events/vmscan.h +6 -3
index a1cb913..4c8880b 100644
@@ -73,7 +73,10 @@
 		__entry->order	= order;
 	),
 
-	TP_printk("nid=%d zid=%d order=%d", __entry->nid, __entry->zid, __entry->order)
+	TP_printk("nid=%d zid=%-8s order=%d",
+		__entry->nid,
+		__print_symbolic(__entry->zid, ZONE_TYPE),
+		__entry->order)
 );
 
 TRACE_EVENT(mm_vmscan_wakeup_kswapd,
@@ -96,9 +99,9 @@
 		__entry->gfp_flags	= gfp_flags;
 	),
 
-	TP_printk("nid=%d zid=%d order=%d gfp_flags=%s",
+	TP_printk("nid=%d zid=%-8s order=%d gfp_flags=%s",
 		__entry->nid,
-		__entry->zid,
+		__print_symbolic(__entry->zid, ZONE_TYPE),
 		__entry->order,
 		show_gfp_flags(__entry->gfp_flags))
 );
Signature · 1 line
1.8.3.1
Signature · 2 lines
Michal Hocko
SUSE Labs
#2 lore raw
Quoted 11 lines · Michal Hocko
Quoted 5 lines · Yafang Shao

If we want to know the zone type, we have to check whether CONFIG_ZONE_DMA, CONFIG_ZONE_DMA32 and CONFIG_HIGHMEM are set or not, that's not so convenient.

We'd better show the zone type directly.

I do agree that zone number is quite PITA to process in general but do we really need this information in the first place? Why do we even care?

Sometimes we want to know this event occurs in which zone, then we can get the information of this zone,
for example via /proc/zoneinfo.
It could give us more information for debugging.

Quoted 5 lines

Zones are an MM internal implementation details and the more we export to the userspace the more we are going to argue about breaking userspace when touching them. So I would rather not export that information unless it is terribly useful.

I 'm not sure whether zone type is terribly useful or not, but the 'zid' is useless at all.

I don't agree that Zones are MM internal.
We can get the zone type in many ways, for example /proc/zoneinfo.

If we show this event occurs in which zone, we'd better show the zone type, or we should drop this 'zid'.

Quoted 40 lines
Quoted 34 lines
---
 include/trace/events/vmscan.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
include/trace/events/vmscan.h +6 -4
index a1cb913..4c8880b 100644
@@ -73,7 +73,10 @@
              __entry->order  = order;
      ),
 
-     TP_printk("nid=%d zid=%d order=%d", __entry->nid, __entry->zid, __entry->order)
+     TP_printk("nid=%d zid=%-8s order=%d",
+             __entry->nid,
+             __print_symbolic(__entry->zid, ZONE_TYPE),
+             __entry->order)
 );
 
 TRACE_EVENT(mm_vmscan_wakeup_kswapd,
@@ -96,9 +99,9 @@
              __entry->gfp_flags      = gfp_flags;
      ),
 
-     TP_printk("nid=%d zid=%d order=%d gfp_flags=%s",
+     TP_printk("nid=%d zid=%-8s order=%d gfp_flags=%s",
              __entry->nid,
-             __entry->zid,
+             __print_symbolic(__entry->zid, ZONE_TYPE),
              __entry->order,
              show_gfp_flags(__entry->gfp_flags))
 );
--
Quoted 2 lines

1.8.3.1

--
Michal Hocko
SUSE Labs

#3 lore raw
Quoted 9 lines · Yafang Shao
Quoted 8 lines · Michal Hocko
Quoted 5 lines · Yafang Shao

If we want to know the zone type, we have to check whether CONFIG_ZONE_DMA, CONFIG_ZONE_DMA32 and CONFIG_HIGHMEM are set or not, that's not so convenient.

We'd better show the zone type directly.

Quoted 8 lines
Quoted 3 lines

I do agree that zone number is quite PITA to process in general but do we really need this information in the first place? Why do we even care?

Sometimes we want to know this event occurs in which zone, then we can get the information of this zone,
for example via /proc/zoneinfo.
It could give us more information for debugging.

Could you be more specific please?

Quoted 6 lines
Quoted 5 lines

Zones are an MM internal implementation details and the more we export to the userspace the more we are going to argue about breaking userspace when touching them. So I would rather not export that information unless it is terribly useful.

Quoted 8 lines

I 'm not sure whether zone type is terribly useful or not, but the 'zid' is useless at all.

I don't agree that Zones are MM internal.
We can get the zone type in many ways, for example /proc/zoneinfo.

If we show this event occurs in which zone, we'd better show the zone type, or we should drop this 'zid'.

Yes, I am suggesting the later. If somebody really needs it then I would like to see a _specific_ usecase. Then we can add the proper name.

Signature · 2 lines
Michal Hocko
SUSE Labs
#4 lore raw
Quoted 15 lines · Michal Hocko
Quoted 13 lines · Yafang Shao
Quoted 11 lines · Michal Hocko
Quoted 5 lines · Yafang Shao

If we want to know the zone type, we have to check whether CONFIG_ZONE_DMA, CONFIG_ZONE_DMA32 and CONFIG_HIGHMEM are set or not, that's not so convenient.

We'd better show the zone type directly.

I do agree that zone number is quite PITA to process in general but do we really need this information in the first place? Why do we even care?

Quoted 7 lines
Quoted 4 lines

Sometimes we want to know this event occurs in which zone, then we can get the information of this zone,
for example via /proc/zoneinfo.
It could give us more information for debugging.

Could you be more specific please?

Honestly speaking, this one hasn't help us fix the real issue yet.

Quoted 9 lines
Quoted 9 lines
Quoted 5 lines

Zones are an MM internal implementation details and the more we export to the userspace the more we are going to argue about breaking userspace when touching them. So I would rather not export that information unless it is terribly useful.

I 'm not sure whether zone type is terribly useful or not, but the 'zid' is useless at all.

Quoted 8 lines
Quoted 5 lines

I don't agree that Zones are MM internal.
We can get the zone type in many ways, for example /proc/zoneinfo.

If we show this event occurs in which zone, we'd better show the zone type, or we should drop this 'zid'.

Yes, I am suggesting the later. If somebody really needs it then I would like to see a _specific_ usecase. Then we can add the proper name.

This 'zid' always seems like a noise currently.
I will send a patch to drop this one.

Thanks
Yafang