mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 00:48:50 +00:00
mm: introduce offset_in_thp
Mirroring offset_in_page(), this gives you the offset within this particular page, no matter what size page it is. It optimises down to offset_in_page() if CONFIG_TRANSPARENT_HUGEPAGE is not set. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: William Kucharski <william.kucharski@oracle.com> Reviewed-by: Zi Yan <ziy@nvidia.com> Cc: Mike Kravetz <mike.kravetz@oracle.com> Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> Link: http://lkml.kernel.org/r/20200629151959.15779-8-willy@infradead.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
2be1d71841
commit
ee6c400f5c
1 changed files with 1 additions and 0 deletions
|
@ -1594,6 +1594,7 @@ static inline void clear_page_pfmemalloc(struct page *page)
|
|||
extern void pagefault_out_of_memory(void);
|
||||
|
||||
#define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK)
|
||||
#define offset_in_thp(page, p) ((unsigned long)(p) & (thp_size(page) - 1))
|
||||
|
||||
/*
|
||||
* Flags passed to show_mem() and show_free_areas() to suppress output in
|
||||
|
|
Loading…
Reference in a new issue