mm, oom: add oom detection tracepoints
Subsystems (4)
v2 cover mm, oom: add oom detection tracepoints
Hi,
the previous version of the patchset has been posted here [1]. kbuild robot found some compilation issues which are fixed here. Vlastimil has reviewed the patchset and his review feedback has been addressed I believe. No other changes were introduced in this version and I believe this should be ready to be merged.
Original cover:
This is a long overdue and I am really sorry about that. I just didn't get to sit and come up with this earlier as there was always some going on which preempted it. This patchset adds two tracepoints which should help us to debug oom decision making. The first one is placed in should_reclaim_retry and it tells us why do we keep retrying the allocation and reclaim while the second is in should_compact_retry which tells us the similar for the high order requests.
In combination with the existing compaction and reclaim tracepoints we can draw a much better picture about what is going on and why we go and declare the oom.
I am not really a tracepoint guy so I hope I didn't do anything obviously stupid there. Thanks to Vlastimil for his help before I've posted this.
Anywa feedback is of course welcome!
[1] http://lkml.kernel.org/r/[email protected]
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH v2 1/3 mm, trace: extract COMPACTION_STATUS and ZONE_TYPE to a common header
From: Michal Hocko <[email protected]>
COMPACTION_STATUS resp. ZONE_TYPE are currently used to translate enum compact_result resp. struct zone index into their symbolic names for an easier post processing. The follow up patch would like to reuse this as well. The code involves some preprocessor black magic which is better not duplicated elsewhere so move it to a common mm tracing relate header.
Changes since v1
- fix compile issue with CONFIG_COMPACTION=n reported by kbuild test robot
--- include/trace/events/compaction.h | 60 ++---------------------------------- include/trace/events/mmflags.h | 64 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 57 deletions(-)
include/trace/events/compaction.h +3 -57
@@ -9,62 +9,6 @@#include <linux/tracepoint.h> #include <trace/events/mmflags.h> -#define COMPACTION_STATUS \ - EM( COMPACT_SKIPPED, "skipped") \ - EM( COMPACT_DEFERRED, "deferred") \ - EM( COMPACT_CONTINUE, "continue") \ - EM( COMPACT_SUCCESS, "success") \ - EM( COMPACT_PARTIAL_SKIPPED, "partial_skipped") \ - EM( COMPACT_COMPLETE, "complete") \ - EM( COMPACT_NO_SUITABLE_PAGE, "no_suitable_page") \ - EM( COMPACT_NOT_SUITABLE_ZONE, "not_suitable_zone") \ - EMe(COMPACT_CONTENDED, "contended") - -#ifdef CONFIG_ZONE_DMA -#define IFDEF_ZONE_DMA (X ) X -#else -#define IFDEF_ZONE_DMA (X ) -#endif - -#ifdef CONFIG_ZONE_DMA32 -#define IFDEF_ZONE_DMA32 (X ) X -#else -#define IFDEF_ZONE_DMA32 (X ) -#endif - -#ifdef CONFIG_HIGHMEM -#define IFDEF_ZONE_HIGHMEM (X ) X -#else -#define IFDEF_ZONE_HIGHMEM (X ) -#endif - -#define ZONE_TYPE \ - IFDEF_ZONE_DMA( EM (ZONE_DMA, "DMA")) \ - IFDEF_ZONE_DMA32( EM (ZONE_DMA32, "DMA32")) \ - EM (ZONE_NORMAL, "Normal") \ - IFDEF_ZONE_HIGHMEM( EM (ZONE_HIGHMEM,"HighMem")) \ - EMe(ZONE_MOVABLE,"Movable") - -/* -* First define the enums in the above macros to be exported to userspace -* via TRACE_DEFINE_ENUM(). -*/ -#undef EM -#undef EMe -#define EM (a, b) TRACE_DEFINE_ENUM(a); -#define EMe (a, b) TRACE_DEFINE_ENUM(a); - -COMPACTION_STATUS -ZONE_TYPE - -/* -* Now redefine the EM() and EMe() macros to map the enums to the strings -* that will be printed in the output. - */ -#undef EM -#undef EMe -#define EM (a, b) {a, b}, -#define EMe (a, b) {a, b} DECLARE_EVENT_CLASS(mm_compaction_isolate_template,
@@ -187,6 +131,7 @@ TRACE_EVENT(mm_compaction_begin, __entry->sync ? "sync" : "async") ); +#ifdef CONFIG_COMPACTION TRACE_EVENT(mm_compaction_end, TP_PROTO(unsigned long zone_start, unsigned long migrate_pfn, unsigned long free_pfn, unsigned long zone_end, bool sync,
@@ -220,6 +165,7 @@ TRACE_EVENT(mm_compaction_end, __entry->sync ?"sync" :"async" , __print_symbolic(__entry->status, COMPACTION_STATUS)) ); +#endif TRACE_EVENT(mm_compaction_try_to_compact_pages,
@@ -248,6 +194,7 @@ TRACE_EVENT(mm_compaction_try_to_compact_pages, __entry->prio) ); +#ifdef CONFIG_COMPACTION DECLARE_EVENT_CLASS(mm_compaction_suitable_template, TP_PROTO(struct zone *zone,
@@ -295,7 +242,6 @@ DEFINE_EVENT(mm_compaction_suitable_template, mm_compaction_suitable,TP_ARGS (zone, order, ret) ); -#ifdef CONFIG_COMPACTION DECLARE_EVENT_CLASS(mm_compaction_defer_template, TP_PROTO(struct zone *zone, int order),
include/trace/events/mmflags.h +64 -0
70 lines not on this page · raw message
Signature · 7 lines
2.10.2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH v2 2/3 oom, trace: Add oom detection tracepoints
In reply to Michal HockoFrom: Michal Hocko <[email protected]>
should_reclaim_retry is the central decision point for declaring the OOM. It might be really useful to expose data used for this decision making when debugging an unexpected oom situations.
Say we have an OOM report:
[ 52.264001] mem_eater invoked oom-killer: gfp_mask=0x24280ca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), nodemask=0, order=0, oom_score_adj=0 [ 52.267549] CPU: 3 PID: 3148 Comm: mem_eater Tainted: G W 4.8.0-oomtrace3-00006-gb21338b386d2 #1024
Now we can check the tracepoint data to see how we have ended up in this situation:
mem_eater-3148 [003] .... 52.432801: reclaim_retry_zone: node=0 zone=DMA32 order=0 reclaimable=51 available=11134 min_wmark=11084 no_progress_loops=1 wmark_check=1
mem_eater-3148 [003] .... 52.433269: reclaim_retry_zone: node=0 zone=DMA32 order=0 reclaimable=51 available=11103 min_wmark=11084 no_progress_loops=1 wmark_check=1
mem_eater-3148 [003] .... 52.433712: reclaim_retry_zone: node=0 zone=DMA32 order=0 reclaimable=51 available=11100 min_wmark=11084 no_progress_loops=2 wmark_check=1
mem_eater-3148 [003] .... 52.434067: reclaim_retry_zone: node=0 zone=DMA32 order=0 reclaimable=51 available=11097 min_wmark=11084 no_progress_loops=3 wmark_check=1
mem_eater-3148 [003] .... 52.434414: reclaim_retry_zone: node=0 zone=DMA32 order=0 reclaimable=51 available=11094 min_wmark=11084 no_progress_loops=4 wmark_check=1
mem_eater-3148 [003] .... 52.434761: reclaim_retry_zone: node=0 zone=DMA32 order=0 reclaimable=51 available=11091 min_wmark=11084 no_progress_loops=5 wmark_check=1
mem_eater-3148 [003] .... 52.435108: reclaim_retry_zone: node=0 zone=DMA32 order=0 reclaimable=51 available=11087 min_wmark=11084 no_progress_loops=6 wmark_check=1
mem_eater-3148 [003] .... 52.435478: reclaim_retry_zone: node=0 zone=DMA32 order=0 reclaimable=51 available=11084 min_wmark=11084 no_progress_loops=7 wmark_check=0
mem_eater-3148 [003] .... 52.435478: reclaim_retry_zone: node=0 zone=DMA order=0 reclaimable=0 available=1126 min_wmark=179 no_progress_loops=7 wmark_check=0Quoted 1 line
From the above we can quickly deduce that the reclaim stopped making
any progress (see no_progress_loops increased in each round) and while there were still some 51 reclaimable pages they couldn't be dropped for some reason (vmscan trace points would tell us more about that part). available will represent reclaimable + free_pages scaled down per no_progress_loops factor. This is essentially an optimistic estimate of how much memory we would have when reclaiming everything. This can be compared to min_wmark to get a rought idea but the wmark_check tells the result of the watermark check which is more precise (includes lowmem reserves, considers the order etc.). As we can see no zone is eligible in the end and that is why we have triggered the oom in this situation.
Please note that higher order requests might fail on the wmark_check even when there is much more memory available than min_wmark - e.g. when the memory is fragmented. A follow up tracepoint will help to debug those situations.
--- include/trace/events/oom.h | 42 ++++++++++++++++++++++++++++++++++++++++++ mm/page_alloc.c | 10 ++++++++-- 2 files changed, 50 insertions(+), 2 deletions(-)
include/trace/events/oom.h +42 -0
@@ -4,6 +4,7 @@#if !defined(_TRACE_OOM_H) || defined(TRACE_HEADER_MULTI_READ )#define _TRACE_OOM_H#include <linux/tracepoint.h> +#include <trace/events/mmflags.h> TRACE_EVENT(oom_score_adj_update,
@@ -27,6 +28,47 @@ TRACE_EVENT(oom_score_adj_update, __entry->pid, __entry->comm, __entry->oom_score_adj) ); +TRACE_EVENT (reclaim_retry_zone, + + TP_PROTO(struct zoneref *zoneref, + int order, + unsigned long reclaimable, + unsigned long available, + unsigned long min_wmark, + int no_progress_loops, + bool wmark_check), + +TP_ARGS (zoneref, order, reclaimable, available, min_wmark, no_progress_loops, wmark_check), + +TP_STRUCT__entry ( + __field( int, node) + __field( int, zone_idx) + __field( int, order) + __field( unsigned long, reclaimable) + __field( unsigned long, available) + __field( unsigned long, min_wmark) + __field( int, no_progress_loops) +__field ( bool, wmark_check) + ), + +TP_fast_assign ( + __entry->node = zone_to_nid(zoneref->zone); + __entry->zone_idx = zoneref->zone_idx; + __entry->order = order; + __entry->reclaimable = reclaimable; + __entry->available = available; + __entry->min_wmark = min_wmark; + __entry->no_progress_loops = no_progress_loops; + __entry->wmark_check = wmark_check; + ), + +TP_printk ("node=%d zone=%-8s order=%d reclaimable=%lu available=%lu min_wmark=%lu no_progress_loops=%d wmark_check=%d" , + __entry->node,__print_symbolic (__entry->zone_idx,ZONE_TYPE ), + __entry->order, + __entry->reclaimable, __entry->available, __entry->min_wmark, + __entry->no_progress_loops, + __entry->wmark_check) +);#endif /* This part must be outside protection */
mm/page_alloc.c +8 -2
@@ -55,6 +55,7 @@#include <linux/kmemleak.h> #include <linux/compaction.h> #include <trace/events/kmem.h> +#include <trace/events/oom.h> #include <linux/prefetch.h> #include <linux/mm_inline.h> #include <linux/migrate.h>
@@ -3479,6 +3480,8 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order, ac->nodemask) {unsigned long available;unsigned long reclaimable; +unsigned long min_wmark =min_wmark_pages (zone); +bool wmark; available = reclaimable =zone_reclaimable_pages (zone); available -= DIV_ROUND_UP((*no_progress_loops) * available,
@@ -3489,8 +3492,11 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order,* Would the allocation succeed if we reclaimed the whole * available? */ -if (__zone_watermark_ok (zone, order,min_wmark_pages (zone), -ac_classzone_idx (ac), alloc_flags, available)) { + wmark =__zone_watermark_ok (zone, order, min_wmark, +ac_classzone_idx (ac), alloc_flags, available); +trace_reclaim_retry_zone (z, order, reclaimable, + available, min_wmark, *no_progress_loops, wmark); +if (wmark) {/* * If we didn't make any progress and have a lot of * dirty + writeback pages then we should wait for
Signature · 7 lines
2.10.2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH v2 3/3 oom, trace: add compaction retry tracepoint
In reply to Michal HockoFrom: Michal Hocko <[email protected]>
Higher order requests oom debugging is currently quite hard. We do have some compaction points which can tell us how the compaction is operating but there is no trace point to tell us about compaction retry logic. This patch adds a one which will have the following format
bash-3126 [001] .... 1498.220001: compact_retry: order=9 priority=COMPACT_PRIO_SYNC_LIGHT compaction_result=withdrawn retries=0 max_retries=16 should_retry=0
we can see that the order 9 request is not retried even though we are in the highest compaction priority mode becase the last compaction attempt was withdrawn. This means that compaction_zonelist_suitable must have returned false and there is no suitable zone to compact for this request and so no need to retry further.
another example would be
<...>-3137 [001] .... 81.501689: compact_retry: order=9 priority=COMPACT_PRIO_SYNC_LIGHT compaction_result=failed retries=0 max_retries=16 should_retry=0
in this case the order-9 compaction failed to find any suitable block. We do not retry anymore because this is a costly request and those do not go below COMPACT_PRIO_SYNC_LIGHT priority.
Changes since v1
- fix compaction_result into highlevel constants translation as per Vlastimil
--- include/trace/events/mmflags.h | 26 ++++++++++++++++++++++++++ include/trace/events/oom.h | 39 +++++++++++++++++++++++++++++++++++++++ mm/page_alloc.c | 22 ++++++++++++++++------ 3 files changed, 81 insertions(+), 6 deletions(-)
include/trace/events/mmflags.h +26 -0
@@ -187,8 +187,32 @@ IF_HAVE_VM_SOFTDIRTY(VM_SOFTDIRTY, "softdirty" ) \ EM( COMPACT_NO_SUITABLE_PAGE, "no_suitable_page") \ EM( COMPACT_NOT_SUITABLE_ZONE, "not_suitable_zone") \EMe (COMPACT_CONTENDED ,"contended" ) + +/* High-level compaction status feedback */ +#define COMPACTION_FAILED 1 +#define COMPACTION_WITHDRAWN 2 +#define COMPACTION_PROGRESS 3 + +#define compact_result_to_feedback (result) \ +({ \ + enum compact_result __result = result; \ + (compaction_failed(__result)) ? COMPACTION_FAILED : \ + (compaction_withdrawn(__result)) ? COMPACTION_WITHDRAWN : COMPACTION_PROGRESS; \ +}) + +#define COMPACTION_FEEDBACK \ + EM(COMPACTION_FAILED, "failed") \ + EM(COMPACTION_WITHDRAWN, "withdrawn") \ + EMe(COMPACTION_PROGRESS, "progress") + +#define COMPACTION_PRIORITY \ + EM(COMPACT_PRIO_SYNC_FULL, "COMPACT_PRIO_SYNC_FULL") \ + EM(COMPACT_PRIO_SYNC_LIGHT, "COMPACT_PRIO_SYNC_LIGHT") \ + EMe(COMPACT_PRIO_ASYNC, "COMPACT_PRIO_ASYNC")#else #define COMPACTION_STATUS +#define COMPACTION_PRIORITY +#define COMPACTION_FEEDBACK #endif #ifdef CONFIG_ZONE_DMA
@@ -226,6 +250,8 @@ IF_HAVE_VM_SOFTDIRTY(VM_SOFTDIRTY, "softdirty" ) \#define EMe (a, b) TRACE_DEFINE_ENUM(a);COMPACTION_STATUS +COMPACTION_PRIORITY +COMPACTION_FEEDBACK ZONE_TYPE /*
include/trace/events/oom.h +39 -0
@@ -69,6 +69,45 @@ TRACE_EVENT(reclaim_retry_zone, __entry->no_progress_loops, __entry->wmark_check) ); + +#ifdef CONFIG_COMPACTION +TRACE_EVENT (compact_retry, + + TP_PROTO(int order, + enum compact_priority priority, + enum compact_result result, + int retries, + int max_retries, + bool ret), + +TP_ARGS (order, priority, result, retries, max_retries, ret), + +TP_STRUCT__entry ( + __field( int, order) + __field( int, priority) + __field( int, result) + __field( int, retries) + __field( int, max_retries) +__field ( bool, ret) + ), + +TP_fast_assign ( + __entry->order = order; + __entry->priority = priority; + __entry->result = compact_result_to_feedback(result); + __entry->retries = retries; + __entry->max_retries = max_retries; + __entry->ret = ret; + ), + +TP_printk ("order=%d priority=%s compaction_result=%s retries=%d max_retries=%d should_retry=%d" , + __entry->order, +__print_symbolic (__entry->priority,COMPACTION_PRIORITY ), +__print_symbolic (__entry->result,COMPACTION_FEEDBACK ), + __entry->retries, __entry->max_retries, + __entry->ret) +); +#endif /* CONFIG_COMPACTION */ #endif /* This part must be outside protection */
mm/page_alloc.c +16 -6
@@ -3208,6 +3208,9 @@ should_compact_retry(struct alloc_context *ac, int order, int alloc_flags, {int max_retries =MAX_COMPACT_RETRIES ;int min_priority; +bool ret = false; +int retries = *compaction_retries; +enum compact_priority priority = *compact_priority;if (!order)return false;
@@ -3229,8 +3232,10 @@ should_compact_retry(struct alloc_context *ac, int order, int alloc_flags,* But do not retry if the given zonelist is not suitable for * compaction. */ -if (compaction_withdrawn (compact_result)) -return compaction_zonelist_suitable (ac, order, alloc_flags); +if (compaction_withdrawn (compact_result)) { + ret =compaction_zonelist_suitable (ac, order, alloc_flags); + goto out; + }/* * !costly requests are much more important than __GFP_REPEAT
@@ -3242,8 +3247,10 @@ should_compact_retry(struct alloc_context *ac, int order, int alloc_flags,*/ if (order >PAGE_ALLOC_COSTLY_ORDER ) max_retries /=4 ; -if (*compaction_retries <= max_retries) -return true; +if (*compaction_retries <= max_retries) { + ret = true; + goto out; + }/* * Make sure there are attempts at the highest priority if we exhausted
@@ -3252,12 +3259,15 @@ should_compact_retry(struct alloc_context *ac, int order, int alloc_flags, check_priority: min_priority = (order >PAGE_ALLOC_COSTLY_ORDER ) ?MIN_COMPACT_COSTLY_PRIORITY :MIN_COMPACT_PRIORITY ; +if (*compact_priority > min_priority) { (*compact_priority)--; *compaction_retries =0 ; -return true; + ret = true; } -return false; +out: +trace_compact_retry (order, priority, compact_result, retries, max_retries, ret); +return ret; }#else static inline struct page *
Signature · 7 lines
2.10.2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 3/3] oom, trace: add compaction retry tracepoint
Quoted 22 lines · Michal Hocko
From: Michal Hocko <[email protected]>
Higher order requests oom debugging is currently quite hard. We do have some compaction points which can tell us how the compaction is operating but there is no trace point to tell us about compaction retry logic. This patch adds a one which will have the following format
bash-3126 [001] .... 1498.220001: compact_retry: order=9 priority=COMPACT_PRIO_SYNC_LIGHT compaction_result=withdrawn retries=0 max_retries=16 should_retry=0we can see that the order 9 request is not retried even though we are in the highest compaction priority mode becase the last compaction attempt was withdrawn. This means that
compaction_zonelist_suitablemust have returned false and there is no suitable zone to compact for this request and so no need to retry further.another example would be
<...>-3137 [001] .... 81.501689: compact_retry: order=9 priority=COMPACT_PRIO_SYNC_LIGHT compaction_result=failed retries=0 max_retries=16 should_retry=0in this case the order-9 compaction failed to find any suitable block. We do not retry anymore because this is a costly request and those do not go below
COMPACT_PRIO_SYNC_LIGHTpriority.
Quoted 6 lines
Changes since v1
- fixcompaction_resultinto highlevel constants translation as per VlastimilSigned-off-by Michal Hocko <[email protected]>Acked-by Vlastimil Babka <[email protected]>
Hmm I've noticed that I didn't suggest the following below here, although I did for the vmscan tracepoints now. How about adding this -fix for consistency?
--------8<--------
From: Vlastimil Babka <[email protected]>
Date: Wed, 4 Jan 2017 11:44:09 +0100
Subject: [PATCH] oom, trace: add compaction retry tracepoint-fix
Let's print the compaction priorities lower-case and without prefix for consistency.
Also indent fix in compact_result_to_feedback().
--- include/trace/events/mmflags.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
include/trace/events/mmflags.h +4 -4
@@ -195,7 +195,7 @@ IF_HAVE_VM_SOFTDIRTY(VM_SOFTDIRTY, "softdirty" ) \#define compact_result_to_feedback (result) \ ({ \ - enum compact_result __result = result; \ + enum compact_result __result = result; \ (compaction_failed(__result)) ? COMPACTION_FAILED : \ (compaction_withdrawn(__result)) ? COMPACTION_WITHDRAWN : COMPACTION_PROGRESS; \ })
@@ -206,9 +206,9 @@ IF_HAVE_VM_SOFTDIRTY(VM_SOFTDIRTY, "softdirty" ) \ EMe(COMPACTION_PROGRESS, "progress")#define COMPACTION_PRIORITY \ - EM(COMPACT_PRIO_SYNC_FULL, "COMPACT_PRIO_SYNC_FULL") \ - EM(COMPACT_PRIO_SYNC_LIGHT, "COMPACT_PRIO_SYNC_LIGHT") \ - EMe(COMPACT_PRIO_ASYNC, "COMPACT_PRIO_ASYNC") + EM(COMPACT_PRIO_SYNC_FULL, "sync_full") \ + EM(COMPACT_PRIO_SYNC_LIGHT, "sync_light") \ + EMe(COMPACT_PRIO_ASYNC, "async")#else #define COMPACTION_STATUS #define COMPACTION_PRIORITY
Signature · 8 lines
2.11.0 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 3/3] oom, trace: add compaction retry tracepoint
Quoted 39 lines · Vlastimil Babka
Quoted 22 lines · Michal Hocko
From: Michal Hocko <[email protected]>
Higher order requests oom debugging is currently quite hard. We do have some compaction points which can tell us how the compaction is operating but there is no trace point to tell us about compaction retry logic. This patch adds a one which will have the following format
bash-3126 [001] .... 1498.220001: compact_retry: order=9 priority=COMPACT_PRIO_SYNC_LIGHT compaction_result=withdrawn retries=0 max_retries=16 should_retry=0we can see that the order 9 request is not retried even though we are in the highest compaction priority mode becase the last compaction attempt was withdrawn. This means that
compaction_zonelist_suitablemust have returned false and there is no suitable zone to compact for this request and so no need to retry further.another example would be
<...>-3137 [001] .... 81.501689: compact_retry: order=9 priority=COMPACT_PRIO_SYNC_LIGHT compaction_result=failed retries=0 max_retries=16 should_retry=0in this case the order-9 compaction failed to find any suitable block. We do not retry anymore because this is a costly request and those do not go below
COMPACT_PRIO_SYNC_LIGHTpriority.Quoted 6 lines
Changes since v1
- fixcompaction_resultinto highlevel constants translation as per VlastimilSigned-off-by Michal Hocko <[email protected]>Acked-by Vlastimil Babka <[email protected]>Hmm I've noticed that I didn't suggest the following below here, although I did for the vmscan tracepoints now. How about adding this -fix for consistency?
--------8<--------
From: Vlastimil Babka <[email protected]>
Date: Wed, 4 Jan 2017 11:44:09 +0100
Subject: [PATCH] oom, trace: add compaction retry tracepoint-fix
Quoted 6 lines
Let's print the compaction priorities lower-case and without prefix for consistency.
Also indent fix in
compact_result_to_feedback().Signed-off-by Vlastimil Babka <[email protected]>
I would just worry that c&p constant name is easier to work with when vim -t $PRIO or git grep $PRIO. But if the lowercase and shorter sounds better to you then no objections from me.
Quoted 33 lines
--- include/trace/events/mmflags.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)include/trace/events/mmflags.h +4
-4@@ -195,7 +195,7 @@ IF_HAVE_VM_SOFTDIRTY(VM_SOFTDIRTY, "softdirty" ) \#define compact_result_to_feedback (result) \ ({ \ - enum compact_result __result = result; \ + enum compact_result __result = result; \ (compaction_failed(__result)) ? COMPACTION_FAILED : \ (compaction_withdrawn(__result)) ? COMPACTION_WITHDRAWN : COMPACTION_PROGRESS; \ })@@ -206,9 +206,9 @@ IF_HAVE_VM_SOFTDIRTY(VM_SOFTDIRTY, "softdirty" ) \ EMe(COMPACTION_PROGRESS, "progress")#define COMPACTION_PRIORITY \ - EM(COMPACT_PRIO_SYNC_FULL, "COMPACT_PRIO_SYNC_FULL") \ - EM(COMPACT_PRIO_SYNC_LIGHT, "COMPACT_PRIO_SYNC_LIGHT") \ - EMe(COMPACT_PRIO_ASYNC, "COMPACT_PRIO_ASYNC") + EM(COMPACT_PRIO_SYNC_FULL, "sync_full") \ + EM(COMPACT_PRIO_SYNC_LIGHT, "sync_light") \ + EMe(COMPACT_PRIO_ASYNC, "async")#else #define COMPACTION_STATUS #define COMPACTION_PRIORITY Signature · 1 line
2.11.0
Signature · 8 lines
Michal Hocko SUSE Labs -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH 3/3] oom, trace: add compaction retry tracepoint
Quoted 12 lines · Michal Hocko
Quoted 11 lines · Vlastimil Babka
Quoted 1 line · Michal Hocko
From: Michal Hocko <[email protected]>
--------8<--------
From: Vlastimil Babka <[email protected]>
Date: Wed, 4 Jan 2017 11:44:09 +0100
Subject: [PATCH] oom, trace: add compaction retry tracepoint-fixLet's print the compaction priorities lower-case and without prefix for consistency.
Quoted 7 lines
Quoted 3 lines
Also indent fix in
compact_result_to_feedback().Signed-off-by Vlastimil Babka <[email protected]>I would just worry that c&p constant name is easier to work with when vim -t $PRIO or git grep $PRIO. But if the lowercase and shorter sounds better to you then no objections from me.
Yeah, valid point, but since we didn't do that until now, let's stay consistent.
Quoted 20 lines
Quoted 20 lines
--- include/trace/events/mmflags.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)include/trace/events/mmflags.h +1
-1@@ -195,7 +195,7 @@ IF_HAVE_VM_SOFTDIRTY(VM_SOFTDIRTY, "softdirty" ) \#define compact_result_to_feedback (result) \ ({ \ - enum compact_result __result = result; \ + enum compact_result __result = result; \ (compaction_failed(__result)) ? COMPACTION_FAILED : \ (compaction_withdrawn(__result)) ? COMPACTION_WITHDRAWN : COMPACTION_PROGRESS; \ })@@ -206,9 +206,9 @@ IF_HAVE_VM_SOFTDIRTY(VM_SOFTDIRTY, "softdirty" ) \EMe (COMPACTION_PROGRESS ,"progress" )
Quoted 14 lines
Quoted 13 lines
include/trace/events/mmflags.h +3
-3#define COMPACTION_PRIORITY \ - EM(COMPACT_PRIO_SYNC_FULL, "COMPACT_PRIO_SYNC_FULL") \ - EM(COMPACT_PRIO_SYNC_LIGHT, "COMPACT_PRIO_SYNC_LIGHT") \ - EMe(COMPACT_PRIO_ASYNC, "COMPACT_PRIO_ASYNC") + EM(COMPACT_PRIO_SYNC_FULL, "sync_full") \ + EM(COMPACT_PRIO_SYNC_LIGHT, "sync_light") \ + EMe(COMPACT_PRIO_ASYNC, "async")#else #define COMPACTION_STATUS #define COMPACTION_PRIORITY Signature · 1 line
2.11.0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>