aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmzone.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mmzone.h')
-rw-r--r--include/linux/mmzone.h42
1 files changed, 38 insertions, 4 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index f4bfe824834f..4c4522a51a3b 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -7,6 +7,7 @@
7#include <linux/spinlock.h> 7#include <linux/spinlock.h>
8#include <linux/list.h> 8#include <linux/list.h>
9#include <linux/wait.h> 9#include <linux/wait.h>
10#include <linux/bitops.h>
10#include <linux/cache.h> 11#include <linux/cache.h>
11#include <linux/threads.h> 12#include <linux/threads.h>
12#include <linux/numa.h> 13#include <linux/numa.h>
@@ -262,10 +263,7 @@ struct zone {
262 unsigned long nr_scan_active; 263 unsigned long nr_scan_active;
263 unsigned long nr_scan_inactive; 264 unsigned long nr_scan_inactive;
264 unsigned long pages_scanned; /* since last reclaim */ 265 unsigned long pages_scanned; /* since last reclaim */
265 int all_unreclaimable; /* All pages pinned */ 266 unsigned long flags; /* zone flags, see below */
266
267 /* A count of how many reclaimers are scanning this zone */
268 atomic_t reclaim_in_progress;
269 267
270 /* Zone statistics */ 268 /* Zone statistics */
271 atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; 269 atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
@@ -343,6 +341,42 @@ struct zone {
343 const char *name; 341 const char *name;
344} ____cacheline_internodealigned_in_smp; 342} ____cacheline_internodealigned_in_smp;
345 343
344typedef enum {
345 ZONE_ALL_UNRECLAIMABLE, /* all pages pinned */
346 ZONE_RECLAIM_LOCKED, /* prevents concurrent reclaim */
347 ZONE_OOM_LOCKED, /* zone is in OOM killer zonelist */
348} zone_flags_t;
349
350static inline void zone_set_flag(struct zone *zone, zone_flags_t flag)
351{
352 set_bit(flag, &zone->flags);
353}
354
355static inline int zone_test_and_set_flag(struct zone *zone, zone_flags_t flag)
356{
357 return test_and_set_bit(flag, &zone->flags);
358}
359
360static inline void zone_clear_flag(struct zone *zone, zone_flags_t flag)
361{
362 clear_bit(flag, &zone->flags);
363}
364
365static inline int zone_is_all_unreclaimable(const struct zone *zone)
366{
367 return test_bit(ZONE_ALL_UNRECLAIMABLE, &zone->flags);
368}
369
370static inline int zone_is_reclaim_locked(const struct zone *zone)
371{
372 return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags);
373}
374
375static inline int zone_is_oom_locked(const struct zone *zone)
376{
377 return test_bit(ZONE_OOM_LOCKED, &zone->flags);
378}
379
346/* 380/*
347 * The "priority" of VM scanning is how much of the queues we will scan in one 381 * The "priority" of VM scanning is how much of the queues we will scan in one
348 * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the 382 * go. A value of 12 for DEF_PRIORITY implies that we will scan 1/4096th of the