Re: [PATCH v2] mm/migrate_device: add class-based migration trace events

From: Balbir Singh

Date: Fri Aug 28 2026 - 00:16:54 EST


On 8/28/26 2:13 PM, Matthew Brost wrote:
> On Fri, Aug 28, 2026 at 02:08:17PM +1000, Balbir Singh wrote:
>> Device-private migrations currently require ad-hoc instrumentation to
>> understand selection, unmap, copy, and finalization behavior.
>>
>> Add reusable ftrace event classes for migrate_vma ranges, device
>> batches, and individual folios. Emit start, done traces with
>> ranges, flags, page counts, success/failure summaries, PFNs,
>> and migrate flags.
>>
>> Enabling all traces can make the migration traces verbose, when used
>> they can also help debug issues with device migration.
>>
>> Signed-off-by: Balbir Singh <balbirs@xxxxxxxxxx>
>> Suggested-by: Steven Rostedt <rostedt@xxxxxxxxxxx>
>
> This seems like a pretty good adding tracepoints - anytime I've had to
> debug issues in migrate_device.c it has basically start adding printks to
> figure out what is going on. Hopefully witth the right tracepoints, this
> would now be turn on ftrace.
>
> So +1 on the idea.
>
> In the middle of a few other things, but will circle back with an in
> depth look at individual tracepoints added here when a bit more time.

Thanks, I am hoping to add more tests and use these for debugging
corner cases and hopefully get easier debug for issues reported.

Balbir