linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: compaction: show gfp flag names in try_to_compact_pages tracepoint
@ 2019-03-02  4:38 Yafang Shao
  2019-03-02  4:38 ` [PATCH] mm: compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set Yafang Shao
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Yafang Shao @ 2019-03-02  4:38 UTC (permalink / raw)
  To: vbabka, mhocko, jrdr.linux
  Cc: akpm, linux-mm, linux-kernel, shaoyafang, Yafang Shao

show the gfp flag names instead of the gfp_mask could make the trace
more convenient.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
---
 include/trace/events/compaction.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h
index 6074eff..e66afb818 100644
--- a/include/trace/events/compaction.h
+++ b/include/trace/events/compaction.h
@@ -189,9 +189,9 @@
 		__entry->prio = prio;
 	),
 
-	TP_printk("order=%d gfp_mask=0x%x priority=%d",
+	TP_printk("order=%d gfp_mask=%s priority=%d",
 		__entry->order,
-		__entry->gfp_mask,
+		show_gfp_flags(__entry->gfp_mask),
 		__entry->prio)
 );
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH] mm: compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set
  2019-03-02  4:38 [PATCH] mm: compaction: show gfp flag names in try_to_compact_pages tracepoint Yafang Shao
@ 2019-03-02  4:38 ` Yafang Shao
  2019-03-12 16:18   ` Michal Hocko
  2019-03-02 23:04 ` [PATCH] mm: compaction: show gfp flag names in try_to_compact_pages tracepoint kbuild test robot
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Yafang Shao @ 2019-03-02  4:38 UTC (permalink / raw)
  To: vbabka, mhocko, jrdr.linux
  Cc: akpm, linux-mm, linux-kernel, shaoyafang, Yafang Shao

Only mm_compaction_isolate_{free, migrate}pages may be used when
CONFIG_COMPACTION is not set.
All others are used only when CONFIG_COMPACTION is set.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
---
 include/trace/events/compaction.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h
index 6074eff..3e42078 100644
--- a/include/trace/events/compaction.h
+++ b/include/trace/events/compaction.h
@@ -64,6 +64,7 @@
 	TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken)
 );
 
+#ifdef CONFIG_COMPACTION
 TRACE_EVENT(mm_compaction_migratepages,
 
 	TP_PROTO(unsigned long nr_all,
@@ -132,7 +133,6 @@
 		__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,
@@ -166,7 +166,6 @@
 		__entry->sync ? "sync" : "async",
 		__print_symbolic(__entry->status, COMPACTION_STATUS))
 );
-#endif
 
 TRACE_EVENT(mm_compaction_try_to_compact_pages,
 
@@ -195,7 +194,6 @@
 		__entry->prio)
 );
 
-#ifdef CONFIG_COMPACTION
 DECLARE_EVENT_CLASS(mm_compaction_suitable_template,
 
 	TP_PROTO(struct zone *zone,
@@ -296,7 +294,6 @@
 
 	TP_ARGS(zone, order)
 );
-#endif
 
 TRACE_EVENT(mm_compaction_kcompactd_sleep,
 
@@ -352,6 +349,7 @@
 
 	TP_ARGS(nid, order, classzone_idx)
 );
+#endif
 
 #endif /* _TRACE_COMPACTION_H */
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH] mm: compaction: show gfp flag names in try_to_compact_pages tracepoint
  2019-03-02  4:38 [PATCH] mm: compaction: show gfp flag names in try_to_compact_pages tracepoint Yafang Shao
  2019-03-02  4:38 ` [PATCH] mm: compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set Yafang Shao
@ 2019-03-02 23:04 ` kbuild test robot
  2019-03-04  2:25   ` Yafang Shao
  2019-03-12 16:17 ` Michal Hocko
  2019-03-14  8:30 ` Vlastimil Babka
  3 siblings, 1 reply; 10+ messages in thread
From: kbuild test robot @ 2019-03-02 23:04 UTC (permalink / raw)
  To: Yafang Shao
  Cc: kbuild-all, vbabka, mhocko, jrdr.linux, akpm, linux-mm,
	linux-kernel, shaoyafang, Yafang Shao

[-- Attachment #1: Type: text/plain, Size: 9042 bytes --]

Hi Yafang,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tip/perf/core]
[also build test WARNING on v5.0-rc8 next-20190301]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Yafang-Shao/mm-compaction-show-gfp-flag-names-in-try_to_compact_pages-tracepoint/20190302-212241
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

All warnings (new ones prefixed by >>):

>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t

sparse warnings: (new ones prefixed by >>)

   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: incorrect type in argument 3 (different base types)
>> include/trace/events/compaction.h:171:1: sparse:    expected unsigned long flags
>> include/trace/events/compaction.h:171:1: sparse:    got restricted gfp_t [usertype] gfp_mask
   include/trace/events/compaction.h:171:1: sparse: warning: cast to restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: cast to restricted gfp_t
   include/trace/events/compaction.h:171:1: sparse: warning: restricted gfp_t degrades to integer
   include/trace/events/compaction.h:171:1: sparse: warning: restricted gfp_t degrades to integer
   include/linux/gfp.h:318:27: sparse: warning: restricted gfp_t degrades to integer
   mm/compaction.c:1750:39: sparse: warning: incorrect type in initializer (different base types)
   mm/compaction.c:1750:39: sparse:    expected int may_perform_io
   mm/compaction.c:1750:39: sparse:    got restricted gfp_t
   mm/compaction.c:351:13: sparse: warning: context imbalance in 'compact_trylock_irqsave' - wrong count at exit
   include/linux/spinlock.h:384:9: sparse: warning: context imbalance in 'compact_unlock_should_abort' - unexpected unlock
   mm/compaction.c:545:39: sparse: warning: context imbalance in 'isolate_freepages_block' - unexpected unlock
   mm/compaction.c:943:53: sparse: warning: context imbalance in 'isolate_migratepages_block' - unexpected unlock

vim +171 include/trace/events/compaction.h

b7aba698 Mel Gorman      2011-01-13  170  
837d026d Joonsoo Kim     2015-02-11 @171  TRACE_EVENT(mm_compaction_try_to_compact_pages,
837d026d Joonsoo Kim     2015-02-11  172  
837d026d Joonsoo Kim     2015-02-11  173  	TP_PROTO(
837d026d Joonsoo Kim     2015-02-11  174  		int order,
837d026d Joonsoo Kim     2015-02-11  175  		gfp_t gfp_mask,
a5508cd8 Vlastimil Babka 2016-07-28  176  		int prio),
837d026d Joonsoo Kim     2015-02-11  177  
a5508cd8 Vlastimil Babka 2016-07-28  178  	TP_ARGS(order, gfp_mask, prio),
837d026d Joonsoo Kim     2015-02-11  179  
837d026d Joonsoo Kim     2015-02-11  180  	TP_STRUCT__entry(
837d026d Joonsoo Kim     2015-02-11  181  		__field(int, order)
837d026d Joonsoo Kim     2015-02-11  182  		__field(gfp_t, gfp_mask)
a5508cd8 Vlastimil Babka 2016-07-28  183  		__field(int, prio)
837d026d Joonsoo Kim     2015-02-11  184  	),
837d026d Joonsoo Kim     2015-02-11  185  
837d026d Joonsoo Kim     2015-02-11  186  	TP_fast_assign(
837d026d Joonsoo Kim     2015-02-11  187  		__entry->order = order;
837d026d Joonsoo Kim     2015-02-11  188  		__entry->gfp_mask = gfp_mask;
a5508cd8 Vlastimil Babka 2016-07-28  189  		__entry->prio = prio;
837d026d Joonsoo Kim     2015-02-11  190  	),
837d026d Joonsoo Kim     2015-02-11  191  
91811e0d Yafang Shao     2019-03-02  192  	TP_printk("order=%d gfp_mask=%s priority=%d",
837d026d Joonsoo Kim     2015-02-11  193  		__entry->order,
91811e0d Yafang Shao     2019-03-02  194  		show_gfp_flags(__entry->gfp_mask),
a5508cd8 Vlastimil Babka 2016-07-28  195  		__entry->prio)
837d026d Joonsoo Kim     2015-02-11  196  );
837d026d Joonsoo Kim     2015-02-11  197  

:::::: The code at line 171 was first introduced by commit
:::::: 837d026d560c5ef26abeca0441713d82e4e82cad mm/compaction: more trace to understand when/why compaction start/finish

:::::: TO: Joonsoo Kim <iamjoonsoo.kim@lge.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 67238 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] mm: compaction: show gfp flag names in try_to_compact_pages tracepoint
  2019-03-02 23:04 ` [PATCH] mm: compaction: show gfp flag names in try_to_compact_pages tracepoint kbuild test robot
@ 2019-03-04  2:25   ` Yafang Shao
  0 siblings, 0 replies; 10+ messages in thread
From: Yafang Shao @ 2019-03-04  2:25 UTC (permalink / raw)
  To: kbuild test robot
  Cc: kbuild-all, Vlastimil Babka, Michal Hocko, Souptick Joarder,
	Andrew Morton, Linux MM, LKML, shaoyafang

On Sun, Mar 3, 2019 at 7:04 AM kbuild test robot <lkp@intel.com> wrote:
>
> Hi Yafang,
>
> Thank you for the patch! Perhaps something to improve:
>
> [auto build test WARNING on tip/perf/core]
> [also build test WARNING on v5.0-rc8 next-20190301]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url:    https://github.com/0day-ci/linux/commits/Yafang-Shao/mm-compaction-show-gfp-flag-names-in-try_to_compact_pages-tracepoint/20190302-212241
> reproduce:
>         # apt-get install sparse
>         make ARCH=x86_64 allmodconfig
>         make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
>
> All warnings (new ones prefixed by >>):
>
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
> >> include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>
> sparse warnings: (new ones prefixed by >>)
>
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast from restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: incorrect type in argument 3 (different base types)
> >> include/trace/events/compaction.h:171:1: sparse:    expected unsigned long flags
> >> include/trace/events/compaction.h:171:1: sparse:    got restricted gfp_t [usertype] gfp_mask
>    include/trace/events/compaction.h:171:1: sparse: warning: cast to restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: cast to restricted gfp_t
>    include/trace/events/compaction.h:171:1: sparse: warning: restricted gfp_t degrades to integer
>    include/trace/events/compaction.h:171:1: sparse: warning: restricted gfp_t degrades to integer
>    include/linux/gfp.h:318:27: sparse: warning: restricted gfp_t degrades to integer
>    mm/compaction.c:1750:39: sparse: warning: incorrect type in initializer (different base types)
>    mm/compaction.c:1750:39: sparse:    expected int may_perform_io
>    mm/compaction.c:1750:39: sparse:    got restricted gfp_t
>    mm/compaction.c:351:13: sparse: warning: context imbalance in 'compact_trylock_irqsave' - wrong count at exit
>    include/linux/spinlock.h:384:9: sparse: warning: context imbalance in 'compact_unlock_should_abort' - unexpected unlock
>    mm/compaction.c:545:39: sparse: warning: context imbalance in 'isolate_freepages_block' - unexpected unlock
>    mm/compaction.c:943:53: sparse: warning: context imbalance in 'isolate_migratepages_block' - unexpected unlock
>
> vim +171 include/trace/events/compaction.h
>
> b7aba698 Mel Gorman      2011-01-13  170
> 837d026d Joonsoo Kim     2015-02-11 @171  TRACE_EVENT(mm_compaction_try_to_compact_pages,
> 837d026d Joonsoo Kim     2015-02-11  172
> 837d026d Joonsoo Kim     2015-02-11  173        TP_PROTO(
> 837d026d Joonsoo Kim     2015-02-11  174                int order,
> 837d026d Joonsoo Kim     2015-02-11  175                gfp_t gfp_mask,
> a5508cd8 Vlastimil Babka 2016-07-28  176                int prio),
> 837d026d Joonsoo Kim     2015-02-11  177
> a5508cd8 Vlastimil Babka 2016-07-28  178        TP_ARGS(order, gfp_mask, prio),
> 837d026d Joonsoo Kim     2015-02-11  179
> 837d026d Joonsoo Kim     2015-02-11  180        TP_STRUCT__entry(
> 837d026d Joonsoo Kim     2015-02-11  181                __field(int, order)
> 837d026d Joonsoo Kim     2015-02-11  182                __field(gfp_t, gfp_mask)
> a5508cd8 Vlastimil Babka 2016-07-28  183                __field(int, prio)
> 837d026d Joonsoo Kim     2015-02-11  184        ),
> 837d026d Joonsoo Kim     2015-02-11  185
> 837d026d Joonsoo Kim     2015-02-11  186        TP_fast_assign(
> 837d026d Joonsoo Kim     2015-02-11  187                __entry->order = order;
> 837d026d Joonsoo Kim     2015-02-11  188                __entry->gfp_mask = gfp_mask;
> a5508cd8 Vlastimil Babka 2016-07-28  189                __entry->prio = prio;
> 837d026d Joonsoo Kim     2015-02-11  190        ),
> 837d026d Joonsoo Kim     2015-02-11  191
> 91811e0d Yafang Shao     2019-03-02  192        TP_printk("order=%d gfp_mask=%s priority=%d",
> 837d026d Joonsoo Kim     2015-02-11  193                __entry->order,
> 91811e0d Yafang Shao     2019-03-02  194                show_gfp_flags(__entry->gfp_mask),
> a5508cd8 Vlastimil Babka 2016-07-28  195                __entry->prio)
> 837d026d Joonsoo Kim     2015-02-11  196  );
> 837d026d Joonsoo Kim     2015-02-11  197
>
> :::::: The code at line 171 was first introduced by commit
> :::::: 837d026d560c5ef26abeca0441713d82e4e82cad mm/compaction: more trace to understand when/why compaction start/finish
>
> :::::: TO: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> :::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Seems this warning isn't introduced by my patch.
My patch is fine.

I will try to investigate how this warning is introduced.

Thanks
Yafang

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] mm: compaction: show gfp flag names in try_to_compact_pages tracepoint
  2019-03-02  4:38 [PATCH] mm: compaction: show gfp flag names in try_to_compact_pages tracepoint Yafang Shao
  2019-03-02  4:38 ` [PATCH] mm: compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set Yafang Shao
  2019-03-02 23:04 ` [PATCH] mm: compaction: show gfp flag names in try_to_compact_pages tracepoint kbuild test robot
@ 2019-03-12 16:17 ` Michal Hocko
  2019-03-14  8:30 ` Vlastimil Babka
  3 siblings, 0 replies; 10+ messages in thread
From: Michal Hocko @ 2019-03-12 16:17 UTC (permalink / raw)
  To: Yafang Shao; +Cc: vbabka, jrdr.linux, akpm, linux-mm, linux-kernel, shaoyafang

On Sat 02-03-19 12:38:57, Yafang Shao wrote:
> show the gfp flag names instead of the gfp_mask could make the trace
> more convenient.

Agreed

> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  include/trace/events/compaction.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h
> index 6074eff..e66afb818 100644
> --- a/include/trace/events/compaction.h
> +++ b/include/trace/events/compaction.h
> @@ -189,9 +189,9 @@
>  		__entry->prio = prio;
>  	),
>  
> -	TP_printk("order=%d gfp_mask=0x%x priority=%d",
> +	TP_printk("order=%d gfp_mask=%s priority=%d",
>  		__entry->order,
> -		__entry->gfp_mask,
> +		show_gfp_flags(__entry->gfp_mask),
>  		__entry->prio)
>  );
>  
> -- 
> 1.8.3.1
> 

-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] mm: compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set
  2019-03-02  4:38 ` [PATCH] mm: compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set Yafang Shao
@ 2019-03-12 16:18   ` Michal Hocko
  2019-03-12 16:29     ` Yafang Shao
  0 siblings, 1 reply; 10+ messages in thread
From: Michal Hocko @ 2019-03-12 16:18 UTC (permalink / raw)
  To: Yafang Shao; +Cc: vbabka, jrdr.linux, akpm, linux-mm, linux-kernel, shaoyafang

On Sat 02-03-19 12:38:58, Yafang Shao wrote:
> Only mm_compaction_isolate_{free, migrate}pages may be used when
> CONFIG_COMPACTION is not set.
> All others are used only when CONFIG_COMPACTION is set.

Why is this an improvement?

> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> ---
>  include/trace/events/compaction.h | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h
> index 6074eff..3e42078 100644
> --- a/include/trace/events/compaction.h
> +++ b/include/trace/events/compaction.h
> @@ -64,6 +64,7 @@
>  	TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken)
>  );
>  
> +#ifdef CONFIG_COMPACTION
>  TRACE_EVENT(mm_compaction_migratepages,
>  
>  	TP_PROTO(unsigned long nr_all,
> @@ -132,7 +133,6 @@
>  		__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,
> @@ -166,7 +166,6 @@
>  		__entry->sync ? "sync" : "async",
>  		__print_symbolic(__entry->status, COMPACTION_STATUS))
>  );
> -#endif
>  
>  TRACE_EVENT(mm_compaction_try_to_compact_pages,
>  
> @@ -195,7 +194,6 @@
>  		__entry->prio)
>  );
>  
> -#ifdef CONFIG_COMPACTION
>  DECLARE_EVENT_CLASS(mm_compaction_suitable_template,
>  
>  	TP_PROTO(struct zone *zone,
> @@ -296,7 +294,6 @@
>  
>  	TP_ARGS(zone, order)
>  );
> -#endif
>  
>  TRACE_EVENT(mm_compaction_kcompactd_sleep,
>  
> @@ -352,6 +349,7 @@
>  
>  	TP_ARGS(nid, order, classzone_idx)
>  );
> +#endif
>  
>  #endif /* _TRACE_COMPACTION_H */
>  
> -- 
> 1.8.3.1
> 

-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] mm: compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set
  2019-03-12 16:18   ` Michal Hocko
@ 2019-03-12 16:29     ` Yafang Shao
  2019-03-12 16:44       ` Michal Hocko
  0 siblings, 1 reply; 10+ messages in thread
From: Yafang Shao @ 2019-03-12 16:29 UTC (permalink / raw)
  To: Michal Hocko
  Cc: Vlastimil Babka, Souptick Joarder, Andrew Morton, Linux MM, LKML,
	shaoyafang

On Wed, Mar 13, 2019 at 12:18 AM Michal Hocko <mhocko@kernel.org> wrote:
>
> On Sat 02-03-19 12:38:58, Yafang Shao wrote:
> > Only mm_compaction_isolate_{free, migrate}pages may be used when
> > CONFIG_COMPACTION is not set.
> > All others are used only when CONFIG_COMPACTION is set.
>
> Why is this an improvement?
>

After this change, if CONFIG_COMPACTION is not set, the tracepoints
that only work when CONFIG_COMPACTION is set will not be exposed to
the usespace.
Without this change, they will always be expose in debugfs no matter
CONFIG_COMPACTION is set or not.

That's an improvement.

> > Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> > ---
> >  include/trace/events/compaction.h | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h
> > index 6074eff..3e42078 100644
> > --- a/include/trace/events/compaction.h
> > +++ b/include/trace/events/compaction.h
> > @@ -64,6 +64,7 @@
> >       TP_ARGS(start_pfn, end_pfn, nr_scanned, nr_taken)
> >  );
> >
> > +#ifdef CONFIG_COMPACTION
> >  TRACE_EVENT(mm_compaction_migratepages,
> >
> >       TP_PROTO(unsigned long nr_all,
> > @@ -132,7 +133,6 @@
> >               __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,
> > @@ -166,7 +166,6 @@
> >               __entry->sync ? "sync" : "async",
> >               __print_symbolic(__entry->status, COMPACTION_STATUS))
> >  );
> > -#endif
> >
> >  TRACE_EVENT(mm_compaction_try_to_compact_pages,
> >
> > @@ -195,7 +194,6 @@
> >               __entry->prio)
> >  );
> >
> > -#ifdef CONFIG_COMPACTION
> >  DECLARE_EVENT_CLASS(mm_compaction_suitable_template,
> >
> >       TP_PROTO(struct zone *zone,
> > @@ -296,7 +294,6 @@
> >
> >       TP_ARGS(zone, order)
> >  );
> > -#endif
> >
> >  TRACE_EVENT(mm_compaction_kcompactd_sleep,
> >
> > @@ -352,6 +349,7 @@
> >
> >       TP_ARGS(nid, order, classzone_idx)
> >  );
> > +#endif
> >
> >  #endif /* _TRACE_COMPACTION_H */
> >
> > --
> > 1.8.3.1
> >
>
> --
> Michal Hocko
> SUSE Labs

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] mm: compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set
  2019-03-12 16:29     ` Yafang Shao
@ 2019-03-12 16:44       ` Michal Hocko
  2019-03-12 16:48         ` Yafang Shao
  0 siblings, 1 reply; 10+ messages in thread
From: Michal Hocko @ 2019-03-12 16:44 UTC (permalink / raw)
  To: Yafang Shao
  Cc: Vlastimil Babka, Souptick Joarder, Andrew Morton, Linux MM, LKML,
	shaoyafang

On Wed 13-03-19 00:29:57, Yafang Shao wrote:
> On Wed, Mar 13, 2019 at 12:18 AM Michal Hocko <mhocko@kernel.org> wrote:
> >
> > On Sat 02-03-19 12:38:58, Yafang Shao wrote:
> > > Only mm_compaction_isolate_{free, migrate}pages may be used when
> > > CONFIG_COMPACTION is not set.
> > > All others are used only when CONFIG_COMPACTION is set.
> >
> > Why is this an improvement?
> >
> 
> After this change, if CONFIG_COMPACTION is not set, the tracepoints
> that only work when CONFIG_COMPACTION is set will not be exposed to
> the usespace.
> Without this change, they will always be expose in debugfs no matter
> CONFIG_COMPACTION is set or not.

And this is exactly something that the changelog should mention. I
wasn't aware that we do export tracepoints even when they are not used
by any code path. This whole macro based programming is just a black
magic.
-- 
Michal Hocko
SUSE Labs

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] mm: compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set
  2019-03-12 16:44       ` Michal Hocko
@ 2019-03-12 16:48         ` Yafang Shao
  0 siblings, 0 replies; 10+ messages in thread
From: Yafang Shao @ 2019-03-12 16:48 UTC (permalink / raw)
  To: Michal Hocko
  Cc: Vlastimil Babka, Souptick Joarder, Andrew Morton, Linux MM, LKML,
	shaoyafang

On Wed, Mar 13, 2019 at 12:44 AM Michal Hocko <mhocko@kernel.org> wrote:
>
> On Wed 13-03-19 00:29:57, Yafang Shao wrote:
> > On Wed, Mar 13, 2019 at 12:18 AM Michal Hocko <mhocko@kernel.org> wrote:
> > >
> > > On Sat 02-03-19 12:38:58, Yafang Shao wrote:
> > > > Only mm_compaction_isolate_{free, migrate}pages may be used when
> > > > CONFIG_COMPACTION is not set.
> > > > All others are used only when CONFIG_COMPACTION is set.
> > >
> > > Why is this an improvement?
> > >
> >
> > After this change, if CONFIG_COMPACTION is not set, the tracepoints
> > that only work when CONFIG_COMPACTION is set will not be exposed to
> > the usespace.
> > Without this change, they will always be expose in debugfs no matter
> > CONFIG_COMPACTION is set or not.
>
> And this is exactly something that the changelog should mention. I
> wasn't aware that we do export tracepoints even when they are not used
> by any code path. This whole macro based programming is just a black
> magic.
> --

Sure, I will modify the changelog and send v2.

Thanks
Yafang

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] mm: compaction: show gfp flag names in try_to_compact_pages tracepoint
  2019-03-02  4:38 [PATCH] mm: compaction: show gfp flag names in try_to_compact_pages tracepoint Yafang Shao
                   ` (2 preceding siblings ...)
  2019-03-12 16:17 ` Michal Hocko
@ 2019-03-14  8:30 ` Vlastimil Babka
  3 siblings, 0 replies; 10+ messages in thread
From: Vlastimil Babka @ 2019-03-14  8:30 UTC (permalink / raw)
  To: Yafang Shao, mhocko, jrdr.linux; +Cc: akpm, linux-mm, linux-kernel, shaoyafang

On 3/2/19 5:38 AM, Yafang Shao wrote:
> show the gfp flag names instead of the gfp_mask could make the trace
> more convenient.
> 
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  include/trace/events/compaction.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h
> index 6074eff..e66afb818 100644
> --- a/include/trace/events/compaction.h
> +++ b/include/trace/events/compaction.h
> @@ -189,9 +189,9 @@
>  		__entry->prio = prio;
>  	),
>  
> -	TP_printk("order=%d gfp_mask=0x%x priority=%d",
> +	TP_printk("order=%d gfp_mask=%s priority=%d",
>  		__entry->order,
> -		__entry->gfp_mask,
> +		show_gfp_flags(__entry->gfp_mask),
>  		__entry->prio)
>  );
>  
> 


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-03-14  8:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-02  4:38 [PATCH] mm: compaction: show gfp flag names in try_to_compact_pages tracepoint Yafang Shao
2019-03-02  4:38 ` [PATCH] mm: compaction: some tracepoints should be defined only when CONFIG_COMPACTION is set Yafang Shao
2019-03-12 16:18   ` Michal Hocko
2019-03-12 16:29     ` Yafang Shao
2019-03-12 16:44       ` Michal Hocko
2019-03-12 16:48         ` Yafang Shao
2019-03-02 23:04 ` [PATCH] mm: compaction: show gfp flag names in try_to_compact_pages tracepoint kbuild test robot
2019-03-04  2:25   ` Yafang Shao
2019-03-12 16:17 ` Michal Hocko
2019-03-14  8:30 ` Vlastimil Babka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).