Re: [PATCH v3 12/14] mm, page_owner: track and print last migrate reason

From: Vlastimil Babka
Date: Thu Jan 07 2016 - 08:18:01 EST


On 01/07/2016 11:54 AM, Michal Hocko wrote:
On Fri 18-12-15 10:03:24, Vlastimil Babka wrote:
During migration, page_owner info is now copied with the rest of the page, so
the stacktrace leading to free page allocation during migration is overwritten.
For debugging purposes, it might be however useful to know that the page has
been migrated since its initial allocation. This might happen many times during
the lifetime for different reasons and fully tracking this, especially with
stacktraces would incur extra memory costs. As a compromise, store and print
the migrate_reason of the last migration that occurred to the page. This is
enough to distinguish compaction, numa balancing etc.

So you know that the page has been migrated because of compaction the
last time. You do not know anything about the previous migrations
though. How would you use that information during debugging? Wouldn't it

The assumption is that if a migration does something bad, chances are it will manifest before another migration happens. I.e. the last migration is probably more related to the bug (e.g. catched by VM_BUG_ON_PAGE()) than the previous ones. Statistically if trinity sees more errors implying compaction than numa balancing, we should look for bugs in compaction, etc.

be sufficient to know that the page has been migrated (or count how many
times) instead? That would lead to less code and it might be sufficient
for practical use.

Yeah it's hard to predict how useful/sufficient this patch would be. The fact that migration happened should be definitely noted. How many times is not that useful IMHO. Migrate reason seemed appropriate and useful enough and we already distinguish them for tracepoints.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/