* [PATCH] mm/vmscan: expose cgroup_ino for shrink slab tracepoints
@ 2019-06-23 10:22 Yafang Shao
2019-06-23 22:58 ` kbuild test robot
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Yafang Shao @ 2019-06-23 10:22 UTC (permalink / raw)
To: akpm, mhocko; +Cc: linux-mm, shaoyafang, Yafang Shao
There may be many containers deployed on one host. But we only
want to trace the slab caches in a speficed container sometimes.
The exposed cgroup_ino in mm_shrink_slab_{start, end} tracepoints can
help us.
It can be used as bellow,
step 1, get the inode of the specified cgroup
$ ls -di /tmp/cgroupv2/foo
step 2, set this inode into tracepoint filter to trace this cgroup only
(assume the inode is 11)
$ cd /sys/kernel/debug/tracing/events/vmscan/
$ echo 'cgroup_ino == 11' > mm_shrink_slab_start/filter
$ echo 'cgroup_ino == 11' > mm_shrink_slab_end/filter
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
---
include/trace/events/vmscan.h | 23 +++++++++++++++--------
mm/vmscan.c | 3 ++-
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index c37e228..4f80fa3 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -248,6 +248,7 @@
__field(unsigned long long, delta)
__field(unsigned long, total_scan)
__field(int, priority)
+ __field(unsigned int, cgroup_ino)
),
TP_fast_assign(
@@ -260,9 +261,10 @@
__entry->delta = delta;
__entry->total_scan = total_scan;
__entry->priority = priority;
+ __entry->cgroup_ino = cgroup_ino(sc->memcg->css.cgroup);
),
- TP_printk("%pS %p: nid: %d objects to shrink %ld gfp_flags %s cache items %ld delta %lld total_scan %ld priority %d",
+ TP_printk("%pS %p: nid: %d objects to shrink %ld gfp_flags %s cache items %ld delta %lld total_scan %ld priority %d cgroup_ino %u",
__entry->shrink,
__entry->shr,
__entry->nid,
@@ -271,14 +273,16 @@
__entry->cache_items,
__entry->delta,
__entry->total_scan,
- __entry->priority)
+ __entry->priority,
+ __entry->cgroup_ino)
);
TRACE_EVENT(mm_shrink_slab_end,
- TP_PROTO(struct shrinker *shr, int nid, int shrinker_retval,
- long unused_scan_cnt, long new_scan_cnt, long total_scan),
+ TP_PROTO(struct shrinker *shr, struct shrink_control *sc,
+ int shrinker_retval, long unused_scan_cnt,
+ long new_scan_cnt, long total_scan),
- TP_ARGS(shr, nid, shrinker_retval, unused_scan_cnt, new_scan_cnt,
+ TP_ARGS(shr, sc, shrinker_retval, unused_scan_cnt, new_scan_cnt,
total_scan),
TP_STRUCT__entry(
@@ -289,26 +293,29 @@
__field(long, new_scan)
__field(int, retval)
__field(long, total_scan)
+ __field(unsigned int, cgroup_ino)
),
TP_fast_assign(
__entry->shr = shr;
- __entry->nid = nid;
+ __entry->nid = sc->nid;
__entry->shrink = shr->scan_objects;
__entry->unused_scan = unused_scan_cnt;
__entry->new_scan = new_scan_cnt;
__entry->retval = shrinker_retval;
__entry->total_scan = total_scan;
+ __entry->cgroup_ino = cgroup_ino(sc->memcg->css.cgroup);
),
- TP_printk("%pS %p: nid: %d unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d",
+ TP_printk("%pS %p: nid: %d unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d cgroup_ino %u",
__entry->shrink,
__entry->shr,
__entry->nid,
__entry->unused_scan,
__entry->new_scan,
__entry->total_scan,
- __entry->retval)
+ __entry->retval,
+ __entry->cgroup_ino)
);
TRACE_EVENT(mm_vmscan_lru_isolate,
diff --git a/mm/vmscan.c b/mm/vmscan.c
index d6c3fc8..a9a03a4 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -578,7 +578,8 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl,
else
new_nr = atomic_long_read(&shrinker->nr_deferred[nid]);
- trace_mm_shrink_slab_end(shrinker, nid, freed, nr, new_nr, total_scan);
+ trace_mm_shrink_slab_end(shrinker, shrinkctl, freed, nr, new_nr,
+ total_scan);
return freed;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/vmscan: expose cgroup_ino for shrink slab tracepoints
2019-06-23 10:22 [PATCH] mm/vmscan: expose cgroup_ino for shrink slab tracepoints Yafang Shao
@ 2019-06-23 22:58 ` kbuild test robot
2019-06-24 1:28 ` kbuild test robot
2019-06-24 3:12 ` kbuild test robot
2 siblings, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2019-06-23 22:58 UTC (permalink / raw)
To: Yafang Shao; +Cc: kbuild-all, akpm, mhocko, linux-mm, shaoyafang, Yafang Shao
[-- Attachment #1: Type: text/plain, Size: 3679 bytes --]
Hi Yafang,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/perf/core]
[also build test ERROR on v5.2-rc6 next-20190621]
[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-vmscan-expose-cgroup_ino-for-shrink-slab-tracepoints/20190624-042930
config: x86_64-randconfig-x019-201925 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
In file included from include/trace/define_trace.h:102:0,
from include/trace/events/vmscan.h:504,
from mm/vmscan.c:64:
include/trace/events/vmscan.h: In function 'trace_event_raw_event_mm_shrink_slab_start':
>> include/trace/events/vmscan.h:217:45: error: dereferencing pointer to incomplete type 'struct mem_cgroup'
__entry->cgroup_ino = cgroup_ino(sc->memcg->css.cgroup);
^
include/trace/trace_events.h:720:4: note: in definition of macro 'DECLARE_EVENT_CLASS'
{ assign; } \
^~~~~~
include/trace/trace_events.h:78:9: note: in expansion of macro 'PARAMS'
PARAMS(assign), \
^~~~~~
>> include/trace/events/vmscan.h:185:1: note: in expansion of macro 'TRACE_EVENT'
TRACE_EVENT(mm_shrink_slab_start,
^~~~~~~~~~~
>> include/trace/events/vmscan.h:207:2: note: in expansion of macro 'TP_fast_assign'
TP_fast_assign(
^~~~~~~~~~~~~~
vim +217 include/trace/events/vmscan.h
184
> 185 TRACE_EVENT(mm_shrink_slab_start,
186 TP_PROTO(struct shrinker *shr, struct shrink_control *sc,
187 long nr_objects_to_shrink, unsigned long cache_items,
188 unsigned long long delta, unsigned long total_scan,
189 int priority),
190
191 TP_ARGS(shr, sc, nr_objects_to_shrink, cache_items, delta, total_scan,
192 priority),
193
194 TP_STRUCT__entry(
195 __field(struct shrinker *, shr)
196 __field(void *, shrink)
197 __field(int, nid)
198 __field(long, nr_objects_to_shrink)
199 __field(gfp_t, gfp_flags)
200 __field(unsigned long, cache_items)
201 __field(unsigned long long, delta)
202 __field(unsigned long, total_scan)
203 __field(int, priority)
204 __field(unsigned int, cgroup_ino)
205 ),
206
> 207 TP_fast_assign(
208 __entry->shr = shr;
209 __entry->shrink = shr->scan_objects;
210 __entry->nid = sc->nid;
211 __entry->nr_objects_to_shrink = nr_objects_to_shrink;
212 __entry->gfp_flags = sc->gfp_mask;
213 __entry->cache_items = cache_items;
214 __entry->delta = delta;
215 __entry->total_scan = total_scan;
216 __entry->priority = priority;
> 217 __entry->cgroup_ino = cgroup_ino(sc->memcg->css.cgroup);
218 ),
219
220 TP_printk("%pS %p: nid: %d objects to shrink %ld gfp_flags %s cache items %ld delta %lld total_scan %ld priority %d cgroup_ino %u",
221 __entry->shrink,
222 __entry->shr,
223 __entry->nid,
224 __entry->nr_objects_to_shrink,
225 show_gfp_flags(__entry->gfp_flags),
226 __entry->cache_items,
227 __entry->delta,
228 __entry->total_scan,
229 __entry->priority,
230 __entry->cgroup_ino)
231 );
232
---
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: 29252 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/vmscan: expose cgroup_ino for shrink slab tracepoints
2019-06-23 10:22 [PATCH] mm/vmscan: expose cgroup_ino for shrink slab tracepoints Yafang Shao
2019-06-23 22:58 ` kbuild test robot
@ 2019-06-24 1:28 ` kbuild test robot
2019-06-24 3:12 ` kbuild test robot
2 siblings, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2019-06-24 1:28 UTC (permalink / raw)
To: Yafang Shao; +Cc: kbuild-all, akpm, mhocko, linux-mm, shaoyafang, Yafang Shao
[-- Attachment #1: Type: text/plain, Size: 4650 bytes --]
Hi Yafang,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/perf/core]
[also build test ERROR on v5.2-rc6 next-20190621]
[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-vmscan-expose-cgroup_ino-for-shrink-slab-tracepoints/20190624-042930
config: sparc64-defconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.4.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=sparc64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from include/trace/define_trace.h:102:0,
from include/trace/events/vmscan.h:504,
from mm/vmscan.c:64:
include/trace/events/vmscan.h: In function 'trace_event_raw_event_mm_shrink_slab_start':
>> include/trace/events/vmscan.h:217:25: error: implicit declaration of function 'cgroup_ino'; did you mean 'cgroup_init'? [-Werror=implicit-function-declaration]
__entry->cgroup_ino = cgroup_ino(sc->memcg->css.cgroup);
^
include/trace/trace_events.h:720:4: note: in definition of macro 'DECLARE_EVENT_CLASS'
{ assign; } \
^~~~~~
include/trace/trace_events.h:78:9: note: in expansion of macro 'PARAMS'
PARAMS(assign), \
^~~~~~
include/trace/events/vmscan.h:185:1: note: in expansion of macro 'TRACE_EVENT'
TRACE_EVENT(mm_shrink_slab_start,
^~~~~~~~~~~
include/trace/events/vmscan.h:207:2: note: in expansion of macro 'TP_fast_assign'
TP_fast_assign(
^~~~~~~~~~~~~~
include/trace/events/vmscan.h:217:45: error: dereferencing pointer to incomplete type 'struct mem_cgroup'
__entry->cgroup_ino = cgroup_ino(sc->memcg->css.cgroup);
^
include/trace/trace_events.h:720:4: note: in definition of macro 'DECLARE_EVENT_CLASS'
{ assign; } \
^~~~~~
include/trace/trace_events.h:78:9: note: in expansion of macro 'PARAMS'
PARAMS(assign), \
^~~~~~
include/trace/events/vmscan.h:185:1: note: in expansion of macro 'TRACE_EVENT'
TRACE_EVENT(mm_shrink_slab_start,
^~~~~~~~~~~
include/trace/events/vmscan.h:207:2: note: in expansion of macro 'TP_fast_assign'
TP_fast_assign(
^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +217 include/trace/events/vmscan.h
184
185 TRACE_EVENT(mm_shrink_slab_start,
186 TP_PROTO(struct shrinker *shr, struct shrink_control *sc,
187 long nr_objects_to_shrink, unsigned long cache_items,
188 unsigned long long delta, unsigned long total_scan,
189 int priority),
190
191 TP_ARGS(shr, sc, nr_objects_to_shrink, cache_items, delta, total_scan,
192 priority),
193
194 TP_STRUCT__entry(
195 __field(struct shrinker *, shr)
196 __field(void *, shrink)
197 __field(int, nid)
198 __field(long, nr_objects_to_shrink)
199 __field(gfp_t, gfp_flags)
200 __field(unsigned long, cache_items)
201 __field(unsigned long long, delta)
202 __field(unsigned long, total_scan)
203 __field(int, priority)
204 __field(unsigned int, cgroup_ino)
205 ),
206
207 TP_fast_assign(
208 __entry->shr = shr;
209 __entry->shrink = shr->scan_objects;
210 __entry->nid = sc->nid;
211 __entry->nr_objects_to_shrink = nr_objects_to_shrink;
212 __entry->gfp_flags = sc->gfp_mask;
213 __entry->cache_items = cache_items;
214 __entry->delta = delta;
215 __entry->total_scan = total_scan;
216 __entry->priority = priority;
> 217 __entry->cgroup_ino = cgroup_ino(sc->memcg->css.cgroup);
218 ),
219
220 TP_printk("%pS %p: nid: %d objects to shrink %ld gfp_flags %s cache items %ld delta %lld total_scan %ld priority %d cgroup_ino %u",
221 __entry->shrink,
222 __entry->shr,
223 __entry->nid,
224 __entry->nr_objects_to_shrink,
225 show_gfp_flags(__entry->gfp_flags),
226 __entry->cache_items,
227 __entry->delta,
228 __entry->total_scan,
229 __entry->priority,
230 __entry->cgroup_ino)
231 );
232
---
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: 18807 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm/vmscan: expose cgroup_ino for shrink slab tracepoints
2019-06-23 10:22 [PATCH] mm/vmscan: expose cgroup_ino for shrink slab tracepoints Yafang Shao
2019-06-23 22:58 ` kbuild test robot
2019-06-24 1:28 ` kbuild test robot
@ 2019-06-24 3:12 ` kbuild test robot
2 siblings, 0 replies; 4+ messages in thread
From: kbuild test robot @ 2019-06-24 3:12 UTC (permalink / raw)
To: Yafang Shao; +Cc: kbuild-all, akpm, mhocko, linux-mm, shaoyafang, Yafang Shao
[-- Attachment #1: Type: text/plain, Size: 7705 bytes --]
Hi Yafang,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on tip/perf/core]
[also build test ERROR on v5.2-rc6 next-20190621]
[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-vmscan-expose-cgroup_ino-for-shrink-slab-tracepoints/20190624-042930
config: x86_64-defconfig (attached as .config)
compiler: clang version 9.0.0 (git://gitmirror/llvm_project 1fa07ebd929383f769994818c3f8c55919bf0a0e)
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from mm/vmscan.c:64:
In file included from include/trace/events/vmscan.h:504:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:740:
>> include/trace/events/vmscan.h:217:45: error: incomplete definition of type 'struct mem_cgroup'
__entry->cgroup_ino = cgroup_ino(sc->memcg->css.cgroup);
~~~~~~~~~^
include/trace/trace_events.h:687:33: note: expanded from macro 'TP_fast_assign'
#define TP_fast_assign(args...) args
^~~~
include/trace/trace_events.h:78:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(assign), \
^~~~~~
include/linux/tracepoint.h:95:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^~~~
include/trace/trace_events.h:720:4: note: expanded from macro 'DECLARE_EVENT_CLASS'
{ assign; } \
^~~~~~
include/linux/mm_types.h:27:8: note: forward declaration of 'struct mem_cgroup'
struct mem_cgroup;
^
In file included from mm/vmscan.c:64:
In file included from include/trace/events/vmscan.h:504:
In file included from include/trace/define_trace.h:102:
In file included from include/trace/trace_events.h:740:
include/trace/events/vmscan.h:260:45: error: incomplete definition of type 'struct mem_cgroup'
__entry->cgroup_ino = cgroup_ino(sc->memcg->css.cgroup);
~~~~~~~~~^
include/trace/trace_events.h:687:33: note: expanded from macro 'TP_fast_assign'
#define TP_fast_assign(args...) args
^~~~
include/trace/trace_events.h:78:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(assign), \
^~~~~~
include/linux/tracepoint.h:95:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^~~~
include/trace/trace_events.h:720:4: note: expanded from macro 'DECLARE_EVENT_CLASS'
{ assign; } \
^~~~~~
include/linux/mm_types.h:27:8: note: forward declaration of 'struct mem_cgroup'
struct mem_cgroup;
^
In file included from mm/vmscan.c:64:
In file included from include/trace/events/vmscan.h:504:
In file included from include/trace/define_trace.h:103:
In file included from include/trace/perf.h:90:
>> include/trace/events/vmscan.h:217:45: error: incomplete definition of type 'struct mem_cgroup'
__entry->cgroup_ino = cgroup_ino(sc->memcg->css.cgroup);
~~~~~~~~~^
include/trace/trace_events.h:687:33: note: expanded from macro 'TP_fast_assign'
#define TP_fast_assign(args...) args
^~~~
include/trace/trace_events.h:78:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(assign), \
^~~~~~
include/linux/tracepoint.h:95:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^~~~
include/trace/perf.h:66:4: note: expanded from macro 'DECLARE_EVENT_CLASS'
{ assign; } \
^~~~~~
include/linux/mm_types.h:27:8: note: forward declaration of 'struct mem_cgroup'
struct mem_cgroup;
^
In file included from mm/vmscan.c:64:
In file included from include/trace/events/vmscan.h:504:
In file included from include/trace/define_trace.h:103:
In file included from include/trace/perf.h:90:
include/trace/events/vmscan.h:260:45: error: incomplete definition of type 'struct mem_cgroup'
__entry->cgroup_ino = cgroup_ino(sc->memcg->css.cgroup);
~~~~~~~~~^
include/trace/trace_events.h:687:33: note: expanded from macro 'TP_fast_assign'
#define TP_fast_assign(args...) args
^~~~
include/trace/trace_events.h:78:16: note: expanded from macro 'TRACE_EVENT'
PARAMS(assign), \
^~~~~~
include/linux/tracepoint.h:95:25: note: expanded from macro 'PARAMS'
#define PARAMS(args...) args
^~~~
include/trace/perf.h:66:4: note: expanded from macro 'DECLARE_EVENT_CLASS'
{ assign; } \
^~~~~~
include/linux/mm_types.h:27:8: note: forward declaration of 'struct mem_cgroup'
struct mem_cgroup;
^
4 errors generated.
vim +217 include/trace/events/vmscan.h
184
185 TRACE_EVENT(mm_shrink_slab_start,
186 TP_PROTO(struct shrinker *shr, struct shrink_control *sc,
187 long nr_objects_to_shrink, unsigned long cache_items,
188 unsigned long long delta, unsigned long total_scan,
189 int priority),
190
191 TP_ARGS(shr, sc, nr_objects_to_shrink, cache_items, delta, total_scan,
192 priority),
193
194 TP_STRUCT__entry(
195 __field(struct shrinker *, shr)
196 __field(void *, shrink)
197 __field(int, nid)
198 __field(long, nr_objects_to_shrink)
199 __field(gfp_t, gfp_flags)
200 __field(unsigned long, cache_items)
201 __field(unsigned long long, delta)
202 __field(unsigned long, total_scan)
203 __field(int, priority)
204 __field(unsigned int, cgroup_ino)
205 ),
206
207 TP_fast_assign(
208 __entry->shr = shr;
209 __entry->shrink = shr->scan_objects;
210 __entry->nid = sc->nid;
211 __entry->nr_objects_to_shrink = nr_objects_to_shrink;
212 __entry->gfp_flags = sc->gfp_mask;
213 __entry->cache_items = cache_items;
214 __entry->delta = delta;
215 __entry->total_scan = total_scan;
216 __entry->priority = priority;
> 217 __entry->cgroup_ino = cgroup_ino(sc->memcg->css.cgroup);
218 ),
219
220 TP_printk("%pS %p: nid: %d objects to shrink %ld gfp_flags %s cache items %ld delta %lld total_scan %ld priority %d cgroup_ino %u",
221 __entry->shrink,
222 __entry->shr,
223 __entry->nid,
224 __entry->nr_objects_to_shrink,
225 show_gfp_flags(__entry->gfp_flags),
226 __entry->cache_items,
227 __entry->delta,
228 __entry->total_scan,
229 __entry->priority,
230 __entry->cgroup_ino)
231 );
232
---
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: 28295 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-06-24 3:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-23 10:22 [PATCH] mm/vmscan: expose cgroup_ino for shrink slab tracepoints Yafang Shao
2019-06-23 22:58 ` kbuild test robot
2019-06-24 1:28 ` kbuild test robot
2019-06-24 3:12 ` kbuild test robot
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).