From: 김재원 <jaewon31.kim@samsung.com>
To: "Steven Rostedt" <rostedt@goodmis.org>, 김재원 <jaewon31.kim@samsung.com>
Cc: "yuzhao@google.com" <yuzhao@google.com>,
"tjmercier@google.com" <tjmercier@google.com>,
"kaleshsingh@google.com" <kaleshsingh@google.com>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"vbabka@suse.cz" <vbabka@suse.cz>,
"hannes@cmpxchg.org" <hannes@cmpxchg.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-trace-kernel@vger.kernel.org"
<linux-trace-kernel@vger.kernel.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"jaewon31.kim@gmail.com" <jaewon31.kim@gmail.com>
Subject: RE: (2) [PATCH] vmscan: add trace events for lru_gen
Date: Thu, 21 Sep 2023 15:09:15 +0900 [thread overview]
Message-ID: <20230921060915epcms1p6a03b613816b2a99d75ddfd1e8c4a44f7@epcms1p6> (raw)
In-Reply-To: <20230920103233.145ac387@gandalf.local.home>
>> Great. Thank you for your comment.
>>
>> For the putting the struct scan_control *sc inside the trace,
>> I couldn't do that because struct scan_control is defined in mm/vmscan.c.
>> I think I should not move it to a seperate header file.
>
>Well if you ever decide to do so, one thing to do is to move the
>trace/events/vmscan.h into mm/ as trace_vmscan.h so that it would have
>access to local header files. Then all you need to do is to move the
>struct scan_control into a local mm/X.h header file.
>
>>
>> As you may expect, I just made this by copying the existing
>> trace_mm_vmscan_lru_isolate and trace_mm_vmscan_lru_shrink_inactive
>>
>> I've tried to change like this.
>> Would this be good for you?
>
>The below looks fine to me. Thanks.
>
>-- Steve
Thank you for your comment.
But I still don't know if I can move the strut scan_control into a
new separate header file, mm/X.h. I guess it was meant to be located
in vmscan.c only.
Let me just send v2 patch with only this change, and wait for other
mm guys comments regarding the moving the struct scan_control thing.
Thank you very much.
>
>>
>>
>> --- a/include/trace/events/vmscan.h
>> +++ b/include/trace/events/vmscan.h
>> @@ -327,7 +327,7 @@ TRACE_EVENT(mm_vmscan_lru_isolate,
>> __print_symbolic(__entry->lru, LRU_NAMES))
>> );
>>
>> -TRACE_EVENT(mm_vmscan_lru_gen_scan,
>> +TRACE_EVENT_CONDITION(mm_vmscan_lru_gen_scan,
>> TP_PROTO(int highest_zoneidx,
>> int order,
>> unsigned long nr_requested,
>> @@ -339,6 +339,8 @@ TRACE_EVENT(mm_vmscan_lru_gen_scan,
>>
>> TP_ARGS(highest_zoneidx, order, nr_requested, nr_scanned, nr_skipped, nr_taken, isolate_mode, lru),
>>
>> + TP_CONDITION(nr_scanned),
>> +
>> TP_STRUCT__entry(
>> __field(int, highest_zoneidx)
>> __field(int, order)
>> @@ -494,7 +496,6 @@ TRACE_EVENT(mm_vmscan_lru_gen_evict,
>> TP_ARGS(nid, nr_reclaimed, stat, priority, file),
>>
>> TP_STRUCT__entry(
>> - __field(int, nid)
>> __field(unsigned long, nr_reclaimed)
>> __field(unsigned long, nr_dirty)
>> __field(unsigned long, nr_writeback)
>> @@ -504,6 +505,7 @@ TRACE_EVENT(mm_vmscan_lru_gen_evict,
>> __field(unsigned int, nr_activate1)
>> __field(unsigned long, nr_ref_keep)
>> __field(unsigned long, nr_unmap_fail)
>> + __field(int, nid)
>> __field(int, priority)
>> __field(int, reclaim_flags)
>> ),
>>
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -5131,10 +5131,9 @@ static int scan_folios(struct lruvec *lruvec, struct scan_control *sc,
>> __count_memcg_events(memcg, PGREFILL, sorted);
>> __count_vm_events(PGSCAN_ANON + type, isolated);
>>
>> - if (scanned)
>> - trace_mm_vmscan_lru_gen_scan(sc->reclaim_idx, sc->order,
>> - MAX_LRU_BATCH, scanned, skipped, isolated,
>> - sc->may_unmap ? 0 : ISOLATE_UNMAPPED, type);
>> + trace_mm_vmscan_lru_gen_scan(sc->reclaim_idx, sc->order, MAX_LRU_BATCH,
>> + scanned, skipped, isolated,
>> + sc->may_unmap ? 0 : ISOLATE_UNMAPPED, type);
>>
>>
>>
>> >
prev parent reply other threads:[~2023-09-21 6:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230919025012epcas1p2c2c57a34eea3299ef3bb643f4cbddf0b@epcas1p2.samsung.com>
2023-09-19 2:52 ` Jaewon Kim
2023-09-19 14:09 ` Steven Rostedt
[not found] ` <CGME20230919025012epcas1p2c2c57a34eea3299ef3bb643f4cbddf0b@epcms1p8>
2023-09-20 7:49 ` 김재원
2023-09-20 14:32 ` (2) " Steven Rostedt
[not found] ` <CGME20230919025012epcas1p2c2c57a34eea3299ef3bb643f4cbddf0b@epcms1p6>
2023-09-21 6:09 ` 김재원 [this message]
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=20230921060915epcms1p6a03b613816b2a99d75ddfd1e8c4a44f7@epcms1p6 \
--to=jaewon31.kim@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=jaewon31.kim@gmail.com \
--cc=kaleshsingh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=tjmercier@google.com \
--cc=vbabka@suse.cz \
--cc=yuzhao@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