path: root/mm/page_reporting.h
Commit message (Collapse)AuthorAgeFilesLines
* mm/page_reporting: export reporting order as module parameterGavin Shan2021-06-291-3/+2
| | | | | | | | | | | | | | | | | | | | | | | The macro PAGE_REPORTING_MIN_ORDER is defined as the page reporting threshold. It can't be adjusted at runtime. This introduces a variable (@page_reporting_order) to replace the marcro (PAGE_REPORTING_MIN_ORDER). MAX_ORDER is assigned to it initially, meaning the page reporting is disabled. It will be specified by driver if valid one is provided. Otherwise, it will fall back to @pageblock_order. It's also exported so that the page reporting order can be adjusted at runtime. Link: Signed-off-by: Gavin Shan <> Suggested-by: David Hildenbrand <> Reviewed-by: Alexander Duyck <> Cc: Anshuman Khandual <> Cc: Catalin Marinas <> Cc: "Michael S. Tsirkin" <> Cc: Will Deacon <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
* mm: introduce include/linux/pgtable.hMike Rapoport2020-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The include/linux/pgtable.h is going to be the home of generic page table manipulation functions. Start with moving asm-generic/pgtable.h to include/linux/pgtable.h and make the latter include asm/pgtable.h. Signed-off-by: Mike Rapoport <> Signed-off-by: Andrew Morton <> Cc: Arnd Bergmann <> Cc: Borislav Petkov <> Cc: Brian Cain <> Cc: Catalin Marinas <> Cc: Chris Zankel <> Cc: "David S. Miller" <> Cc: Geert Uytterhoeven <> Cc: Greentime Hu <> Cc: Greg Ungerer <> Cc: Guan Xuetao <> Cc: Guo Ren <> Cc: Heiko Carstens <> Cc: Helge Deller <> Cc: Ingo Molnar <> Cc: Ley Foon Tan <> Cc: Mark Salter <> Cc: Matthew Wilcox <> Cc: Matt Turner <> Cc: Max Filippov <> Cc: Michael Ellerman <> Cc: Michal Simek <> Cc: Nick Hu <> Cc: Paul Walmsley <> Cc: Richard Weinberger <> Cc: Rich Felker <> Cc: Russell King <> Cc: Stafford Horne <> Cc: Thomas Bogendoerfer <> Cc: Thomas Gleixner <> Cc: Tony Luck <> Cc: Vincent Chen <> Cc: Vineet Gupta <> Cc: Will Deacon <> Cc: Yoshinori Sato <> Link: Signed-off-by: Linus Torvalds <>
* mm: introduce Reported pagesAlexander Duyck2020-04-071-0/+54
In order to pave the way for free page reporting in virtualized environments we will need a way to get pages out of the free lists and identify those pages after they have been returned. To accomplish this, this patch adds the concept of a Reported Buddy, which is essentially meant to just be the Uptodate flag used in conjunction with the Buddy page type. To prevent the reported pages from leaking outside of the buddy lists I added a check to clear the PageReported bit in the del_page_from_free_list function. As a result any reported page that is split, merged, or allocated will have the flag cleared prior to the PageBuddy value being cleared. The process for reporting pages is fairly simple. Once we free a page that meets the minimum order for page reporting we will schedule a worker thread to start 2s or more in the future. That worker thread will begin working from the lowest supported page reporting order up to MAX_ORDER - 1 pulling unreported pages from the free list and storing them in the scatterlist. When processing each individual free list it is necessary for the worker thread to release the zone lock when it needs to stop and report the full scatterlist of pages. To reduce the work of the next iteration the worker thread will rotate the free list so that the first unreported page in the free list becomes the first entry in the list. It will then call a reporting function providing information on how many entries are in the scatterlist. Once the function completes it will return the pages to the free area from which they were allocated and start over pulling more pages from the free areas until there are no longer enough pages to report on to keep the worker busy, or we have processed as many pages as were contained in the free area when we started processing the list. The worker thread will work in a round-robin fashion making its way though each zone requesting reporting, and through each reportable free list within that zone. Once all free areas within the zone have been processed it will check to see if there have been any requests for reporting while it was processing. If so it will reschedule the worker thread to start up again in roughly 2s and exit. Signed-off-by: Alexander Duyck <> Signed-off-by: Andrew Morton <> Acked-by: Mel Gorman <> Cc: Andrea Arcangeli <> Cc: Dan Williams <> Cc: Dave Hansen <> Cc: David Hildenbrand <> Cc: Konrad Rzeszutek Wilk <> Cc: Luiz Capitulino <> Cc: Matthew Wilcox <> Cc: Michael S. Tsirkin <> Cc: Michal Hocko <> Cc: Nitesh Narayan Lal <> Cc: Oscar Salvador <> Cc: Pankaj Gupta <> Cc: Paolo Bonzini <> Cc: Rik van Riel <> Cc: Vlastimil Babka <> Cc: Wei Wang <> Cc: Yang Zhang <> Cc: wei qi <> Link: Signed-off-by: Linus Torvalds <>