Thread (11 messages) 11 messages, 3 authors, 2021-11-07

Re: [RFC PATCH 3/3] mm: compaction: Fix the migration stats in trace_mm_compaction_migratepages()

From: Baolin Wang <baolin.wang@linux.alibaba.com>
Date: 2021-11-04 09:18:11
Also in: lkml


On 2021/11/3 21:42, Steven Rostedt wrote:
On Wed,  3 Nov 2021 18:51:16 +0800
Baolin Wang [off-list ref] wrote:
quoted
@@ -2398,10 +2399,10 @@ bool compaction_zonelist_suitable(struct alloc_context *ac, int order,
  
  		err = migrate_pages(&cc->migratepages, compaction_alloc,
  				compaction_free, (unsigned long)cc, cc->mode,
-				MR_COMPACTION, NULL);
+				MR_COMPACTION, &nr_succeeded);
  
-		trace_mm_compaction_migratepages(cc->nr_migratepages, err,
-							&cc->migratepages);
+		trace_mm_compaction_migratepages(cc->nr_migratepages,
+						 nr_succeeded);
Also, I'm surprised you don't just pass in 'cc' and do the dereferencing in
the trace event macro. Accessing the pointers from the trace event and not
dereferencing them to the tracepoint function moves the changes out of line
here and helps with I$.

You could improve some of the other tracepoints that dereference 'cc' as
well in that file.
Sure. Will do in a separate patch.
But as for this change, I'm good with it.

For the tracing aspect:

Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help