• Vlastimil Babka's avatar
    mm, page_owner: keep owner info when freeing the page · 37389167
    Vlastimil Babka authored
    For debugging purposes it might be useful to keep the owner info even
    after page has been freed, and include it in e.g.  dump_page() when
    detecting a bad page state.  For that, change the PAGE_EXT_OWNER flag
    meaning to "page owner info has been set at least once" and add new
    PAGE_EXT_OWNER_ACTIVE for tracking whether page is supposed to be
    currently tracked allocated or free.  Adjust dump_page() accordingly,
    distinguishing free and allocated pages.  In the page_owner debugfs file,
    keep printing only allocated pages so that existing scripts are not
    confused, and also because free pages are irrelevant for the memory
    statistics or leak detection that's the typical use case of the file,
    anyway.
    
    Link: http://lkml.kernel.org/r/20190820131828.22684-4-vbabka@suse.czSigned-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
    Cc: Kirill A. Shutemov <kirill@shutemov.name>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Mel Gorman <mgorman@techsingularity.net>
    Cc: Michal Hocko <mhocko@kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    37389167
page_owner.c 15.5 KB