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

From: Matthew Wilcox
Date: Thu Jun 04 2020 - 07:34:41 EST


On Thu, Jun 04, 2020 at 09:30:45AM +0530, Anshuman Khandual wrote:
> Add the following new VM events which will help in validating THP migration
> without split. Statistics reported through these new events will help in
> performance debugging.
>
> 1. THP_MIGRATION_SUCCESS
> 2. THP_MIGRATION_FAILURE
>
> THP_MIGRATION_FAILURE in particular represents an event when a THP could
> not be migrated as a single entity following an allocation failure and
> ended up getting split into constituent normal pages before being retried.
> This event, along with PGMIGRATE_SUCCESS and PGMIGRATE_FAIL will help in
> quantifying and analyzing THP migration events including both success and
> failure cases.

> +Quantifying Migration
> +=====================
> +Following events can be used to quantify page migration.
> +
> +- PGMIGRATE_SUCCESS
> +- PGMIGRATE_FAIL
> +- THP_MIGRATION_SUCCESS
> +- THP_MIGRATION_FAILURE
> +
> +THP_MIGRATION_FAILURE in particular represents an event when a THP could not be
> +migrated as a single entity following an allocation failure and ended up getting
> +split into constituent normal pages before being retried. This event, along with
> +PGMIGRATE_SUCCESS and PGMIGRATE_FAIL will help in quantifying and analyzing THP
> +migration events including both success and failure cases.

First, I'd suggest running this paragraph through 'fmt'. That way you
don't have to care about line lengths.

Second, this paragraph doesn't really explain what I need to know to
understand the meaning of these numbers. When Linux attempts to migrate
a THP, one of three things can happen:

- It is migrated as a single THP
- It is migrated, but had to be split
- Migration fails

How do I turn these four numbers into an understanding of how often each
of those three situations happen? And why do we need four numbers to
report three situations?

Or is there something else that can happen? If so, I'd like that explained
here too ;-)