Re: [PATCH 1/3] mm, page_owner: record page owner for each subpage

From: Vlastimil Babka
Date: Mon Aug 19 2019 - 07:46:43 EST

On 8/16/19 4:04 PM, Kirill A. Shutemov wrote:
> On Fri, Aug 16, 2019 at 12:13:59PM +0200, Vlastimil Babka wrote:
>> Currently, page owner info is only recorded for the first page of a high-order
>> allocation, and copied to tail pages in the event of a split page. With the
>> plan to keep previous owner info after freeing the page, it would be benefical
>> to record page owner for each subpage upon allocation. This increases the
>> overhead for high orders, but that should be acceptable for a debugging option.
>> The order stored for each subpage is the order of the whole allocation. This
>> makes it possible to calculate the "head" pfn and to recognize "tail" pages
>> (quoted because not all high-order allocations are compound pages with true
>> head and tail pages). When reading the page_owner debugfs file, keep skipping
>> the "tail" pages so that stats gathered by existing scripts don't get inflated.
>> Signed-off-by: Vlastimil Babka <vbabka@xxxxxxx>
> Hm. That's all reasonable, but I have a question: do you see how page
> owner thing works for THP now?
> I don't see anything in split_huge_page() path (do not confuse it with
> split_page() path) that would copy the information to tail pages. Do you?

You're right, it's missing. This patch fixes that and can be added e.g.
at the end of the series.