Re: [PATCH V3] mm/vmstat: Add events for THP migration without split

From: Andrew Morton
Date: Tue Jul 07 2020 - 16:04:08 EST


On Tue, 7 Jul 2020 05:36:55 +0530 Anshuman Khandual <anshuman.khandual@xxxxxxx> wrote:

> Add following new vmstat events which will help in validating THP migration
> without split. Statistics reported through these new VM events will help in
> performance debugging.
>
> 1. THP_MIGRATION_SUCCESS
> 2. THP_MIGRATION_FAILURE
> 3. THP_MIGRATION_SPLIT
>
> In addition, these new events also update normal page migration statistics
> appropriately via PGMIGRATE_SUCCESS and PGMIGRATE_FAILURE. While here, this
> updates current trace event 'mm_migrate_pages' to accommodate now available
> THP statistics.

Patch looks straightforward enough. It would be nice to see some
confirmation from others that these metrics are a desirable thing to
export.

> ...
>
> - trace_mm_migrate_pages(nr_succeeded, nr_failed, mode, reason);
> + if (nr_thp_succeeded)
> + count_vm_events(THP_MIGRATION_SUCCESS, nr_thp_succeeded);
> + if (nr_thp_failed)
> + count_vm_events(THP_MIGRATION_FAILURE, nr_thp_failed);
> + if (nr_thp_split)
> + count_vm_events(THP_MIGRATION_SPLIT, nr_thp_split);

Are these "if"s worthwhile to have?

> + trace_mm_migrate_pages(nr_succeeded, nr_failed, nr_thp_succeeded,
> + nr_thp_failed, nr_thp_split, mode, reason);