X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=kernel%2Finclude%2Flinux%2Fmm.h;h=b2085582d44e338f8c255723b570d6bf0d6542bd;hb=refs%2Fchanges%2F53%2F2653%2F1;hp=0755b9fd03a7d936e805efb71cfc1d371ddea0d6;hpb=342fa5dfa053559f47caad657132522496dcf1b3;p=kvmfornfv.git diff --git a/kernel/include/linux/mm.h b/kernel/include/linux/mm.h index 0755b9fd0..b2085582d 100644 --- a/kernel/include/linux/mm.h +++ b/kernel/include/linux/mm.h @@ -1001,6 +1001,34 @@ static inline int page_mapped(struct page *page) return atomic_read(&(page)->_mapcount) >= 0; } +/* + * Return true only if the page has been allocated with + * ALLOC_NO_WATERMARKS and the low watermark was not + * met implying that the system is under some pressure. + */ +static inline bool page_is_pfmemalloc(struct page *page) +{ + /* + * Page index cannot be this large so this must be + * a pfmemalloc page. + */ + return page->index == -1UL; +} + +/* + * Only to be called by the page allocator on a freshly allocated + * page. + */ +static inline void set_page_pfmemalloc(struct page *page) +{ + page->index = -1UL; +} + +static inline void clear_page_pfmemalloc(struct page *page) +{ + page->index = 0; +} + /* * Different kinds of faults, as returned by handle_mm_fault(). * Used to decide whether a process gets delivered SIGBUS or