aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mm_types.h9
-rw-r--r--include/linux/page-flags.h29
2 files changed, 38 insertions, 0 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 074eb98fe15..375e79eb009 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -54,6 +54,15 @@ struct page {
54 union { 54 union {
55 pgoff_t index; /* Our offset within mapping. */ 55 pgoff_t index; /* Our offset within mapping. */
56 void *freelist; /* slub/slob first free object */ 56 void *freelist; /* slub/slob first free object */
57 bool pfmemalloc; /* If set by the page allocator,
58 * ALLOC_PFMEMALLOC was set
59 * and the low watermark was not
60 * met implying that the system
61 * is under some pressure. The
62 * caller should try ensure
63 * this page is only used to
64 * free other pages.
65 */
57 }; 66 };
58 67
59 union { 68 union {
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index c88d2a9451a..b5d13841604 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -7,6 +7,7 @@
7 7
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/bug.h> 9#include <linux/bug.h>
10#include <linux/mmdebug.h>
10#ifndef __GENERATING_BOUNDS_H 11#ifndef __GENERATING_BOUNDS_H
11#include <linux/mm_types.h> 12#include <linux/mm_types.h>
12#include <generated/bounds.h> 13#include <generated/bounds.h>
@@ -453,6 +454,34 @@ static inline int PageTransTail(struct page *page)
453} 454}
454#endif 455#endif
455 456
457/*
458 * If network-based swap is enabled, sl*b must keep track of whether pages
459 * were allocated from pfmemalloc reserves.
460 */
461static inline int PageSlabPfmemalloc(struct page *page)
462{
463 VM_BUG_ON(!PageSlab(page));
464 return PageActive(page);
465}
466
467static inline void SetPageSlabPfmemalloc(struct page *page)
468{
469 VM_BUG_ON(!PageSlab(page));
470 SetPageActive(page);
471}
472
473static inline void __ClearPageSlabPfmemalloc(struct page *page)
474{
475 VM_BUG_ON(!PageSlab(page));
476 __ClearPageActive(page);
477}
478
479static inline void ClearPageSlabPfmemalloc(struct page *page)
480{
481 VM_BUG_ON(!PageSlab(page));
482 ClearPageActive(page);
483}
484
456#ifdef CONFIG_MMU 485#ifdef CONFIG_MMU
457#define __PG_MLOCKED (1 << PG_mlocked) 486#define __PG_MLOCKED (1 << PG_mlocked)
458#else 487#else