History

mm, page_owner: keep owner info when freeing the page

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.

Vlastimil Babka committed 7 years ago

Commit 37389161 parent 7e2f2a02 files · +25 −10Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/page_ext.h+1−0
@@ -18,6 +18,7 @@ struct page_ext_operations { · 17 unmodified lines
18 18
19enum page_ext_flags {19enum page_ext_flags {
20 PAGE_EXT_OWNER,20 PAGE_EXT_OWNER,
21 PAGE_EXT_OWNER_ACTIVE,
21#if defined(CONFIG_IDLE_PAGE_TRACKING) && !defined(CONFIG_64BIT)22#if defined(CONFIG_IDLE_PAGE_TRACKING) && !defined(CONFIG_64BIT)
22 PAGE_EXT_YOUNG,23 PAGE_EXT_YOUNG,
23 PAGE_EXT_IDLE,24 PAGE_EXT_IDLE,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t