From: Vlastimil Babka <vbabka@suse.cz>
To: Joonsoo Kim <iamjoonsoo.kim@lge.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>,
David Rientjes <rientjes@google.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/5] mm/compaction: enhance tracepoint output for compaction begin/end
Date: Mon, 12 Jan 2015 15:32:54 +0100 [thread overview]
Message-ID: <54B3DB16.8030205@suse.cz> (raw)
In-Reply-To: <1421050875-26332-2-git-send-email-iamjoonsoo.kim@lge.com>
On 01/12/2015 09:21 AM, Joonsoo Kim wrote:
> We now have tracepoint for begin event of compaction and it prints
> start position of both scanners, but, tracepoint for end event of
> compaction doesn't print finish position of both scanners. It'd be
> also useful to know finish position of both scanners so this patch
> add it. It will help to find odd behavior or problem on compaction
> internal logic.
>
> And, mode is added to both begin/end tracepoint output, since
> according to mode, compaction behavior is quite different.
>
> And, lastly, status format is changed to string rather than
> status number for readability.
>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
> ---
> include/linux/compaction.h | 2 ++
> include/trace/events/compaction.h | 49 ++++++++++++++++++++++++++-----------
> mm/compaction.c | 14 +++++++++--
> 3 files changed, 49 insertions(+), 16 deletions(-)
>
> diff --git a/include/linux/compaction.h b/include/linux/compaction.h
> index 3238ffa..a9547b6 100644
> --- a/include/linux/compaction.h
> +++ b/include/linux/compaction.h
> @@ -12,6 +12,7 @@
> #define COMPACT_PARTIAL 3
> /* The full zone was compacted */
> #define COMPACT_COMPLETE 4
> +/* When adding new state, please change compaction_status_string, too */
>
> /* Used to signal whether compaction detected need_sched() or lock contention */
> /* No contention detected */
> @@ -22,6 +23,7 @@
> #define COMPACT_CONTENDED_LOCK 2
>
> #ifdef CONFIG_COMPACTION
> +extern char *compaction_status_string[];
> extern int sysctl_compact_memory;
> extern int sysctl_compaction_handler(struct ctl_table *table, int write,
> void __user *buffer, size_t *length, loff_t *ppos);
> diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h
> index 1337d9e..839f6fa 100644
> --- a/include/trace/events/compaction.h
> +++ b/include/trace/events/compaction.h
> @@ -85,46 +85,67 @@ TRACE_EVENT(mm_compaction_migratepages,
> );
>
> TRACE_EVENT(mm_compaction_begin,
> - TP_PROTO(unsigned long zone_start, unsigned long migrate_start,
> - unsigned long free_start, unsigned long zone_end),
> + TP_PROTO(unsigned long zone_start, unsigned long migrate_pfn,
> + unsigned long free_pfn, unsigned long zone_end, bool sync),
>
> - TP_ARGS(zone_start, migrate_start, free_start, zone_end),
> + TP_ARGS(zone_start, migrate_pfn, free_pfn, zone_end, sync),
>
> TP_STRUCT__entry(
> __field(unsigned long, zone_start)
> - __field(unsigned long, migrate_start)
> - __field(unsigned long, free_start)
> + __field(unsigned long, migrate_pfn)
> + __field(unsigned long, free_pfn)
> __field(unsigned long, zone_end)
> + __field(bool, sync)
> ),
>
> TP_fast_assign(
> __entry->zone_start = zone_start;
> - __entry->migrate_start = migrate_start;
> - __entry->free_start = free_start;
> + __entry->migrate_pfn = migrate_pfn;
> + __entry->free_pfn = free_pfn;
> __entry->zone_end = zone_end;
> + __entry->sync = sync;
> ),
>
> - TP_printk("zone_start=0x%lx migrate_start=0x%lx free_start=0x%lx zone_end=0x%lx",
> + TP_printk("zone_start=0x%lx migrate_pfn=0x%lx free_pfn=0x%lx zone_end=0x%lx, mode=%s",
> __entry->zone_start,
> - __entry->migrate_start,
> - __entry->free_start,
> - __entry->zone_end)
> + __entry->migrate_pfn,
> + __entry->free_pfn,
> + __entry->zone_end,
> + __entry->sync ? "sync" : "async")
> );
>
> TRACE_EVENT(mm_compaction_end,
> - TP_PROTO(int status),
> + TP_PROTO(unsigned long zone_start, unsigned long migrate_pfn,
> + unsigned long free_pfn, unsigned long zone_end, bool sync,
> + int status),
>
> - TP_ARGS(status),
> + TP_ARGS(zone_start, migrate_pfn, free_pfn, zone_end, sync, status),
>
> TP_STRUCT__entry(
> + __field(unsigned long, zone_start)
> + __field(unsigned long, migrate_pfn)
> + __field(unsigned long, free_pfn)
> + __field(unsigned long, zone_end)
> + __field(bool, sync)
> __field(int, status)
> ),
>
> TP_fast_assign(
> + __entry->zone_start = zone_start;
> + __entry->migrate_pfn = migrate_pfn;
> + __entry->free_pfn = free_pfn;
> + __entry->zone_end = zone_end;
> + __entry->sync = sync;
> __entry->status = status;
> ),
>
> - TP_printk("status=%d", __entry->status)
> + TP_printk("zone_start=0x%lx migrate_pfn=0x%lx free_pfn=0x%lx zone_end=0x%lx, mode=%s status=%s",
> + __entry->zone_start,
> + __entry->migrate_pfn,
> + __entry->free_pfn,
> + __entry->zone_end,
> + __entry->sync ? "sync" : "async",
> + compaction_status_string[__entry->status])
> );
>
> #endif /* _TRACE_COMPACTION_H */
> diff --git a/mm/compaction.c b/mm/compaction.c
> index 546e571..2d86a20 100644
> --- a/mm/compaction.c
> +++ b/mm/compaction.c
> @@ -19,6 +19,14 @@
> #include "internal.h"
>
> #ifdef CONFIG_COMPACTION
> +char *compaction_status_string[] = {
> + "deferred",
> + "skipped",
> + "continue",
> + "partial",
> + "complete",
> +};
> +
> static inline void count_compact_event(enum vm_event_item item)
> {
> count_vm_event(item);
> @@ -1197,7 +1205,8 @@ static int compact_zone(struct zone *zone, struct compact_control *cc)
> zone->compact_cached_migrate_pfn[1] = cc->migrate_pfn;
> }
>
> - trace_mm_compaction_begin(start_pfn, cc->migrate_pfn, cc->free_pfn, end_pfn);
> + trace_mm_compaction_begin(start_pfn, cc->migrate_pfn,
> + cc->free_pfn, end_pfn, sync);
>
> migrate_prep_local();
>
> @@ -1299,7 +1308,8 @@ out:
> zone->compact_cached_free_pfn = free_pfn;
> }
>
> - trace_mm_compaction_end(ret);
> + trace_mm_compaction_end(start_pfn, cc->migrate_pfn,
> + cc->free_pfn, end_pfn, sync, ret);
>
> return ret;
> }
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-01-12 14:32 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-12 8:21 [PATCH v2 1/5] mm/compaction: change tracepoint format from decimal to hexadecimal Joonsoo Kim
2015-01-12 8:21 ` [PATCH v2 2/5] mm/compaction: enhance tracepoint output for compaction begin/end Joonsoo Kim
2015-01-12 14:32 ` Vlastimil Babka [this message]
2015-01-12 8:21 ` [PATCH v2 3/5] mm/compaction: print current range where compaction work Joonsoo Kim
2015-01-12 14:34 ` Vlastimil Babka
2015-01-12 8:21 ` [PATCH v2 4/5] mm/compaction: more trace to understand when/why compaction start/finish Joonsoo Kim
2015-01-12 15:53 ` Vlastimil Babka
2015-01-13 7:16 ` Joonsoo Kim
2015-01-13 8:29 ` Vlastimil Babka
2015-01-12 8:21 ` [PATCH v2 5/5] mm/compaction: add tracepoint to observe behaviour of compaction defer Joonsoo Kim
2015-01-12 16:35 ` Vlastimil Babka
2015-01-13 7:18 ` Joonsoo Kim
2015-01-13 8:35 ` Vlastimil Babka
2015-01-12 14:23 ` [PATCH v2 1/5] mm/compaction: change tracepoint format from decimal to hexadecimal Vlastimil Babka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54B3DB16.8030205@suse.cz \
--to=vbabka@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox