[PATCH] mm: slab less atomics
[sfrench/cifs-2.6.git] / include / linux / mmzone.h
index c34f4a2c62f8e252bc9c260ebad20d419a180750..ebfc238cc243482d9baa9b7bb3bd92391d4f6479 100644 (file)
@@ -38,7 +38,7 @@ struct pglist_data;
 #if defined(CONFIG_SMP)
 struct zone_padding {
        char x[0];
-} ____cacheline_maxaligned_in_smp;
+} ____cacheline_internodealigned_in_smp;
 #define ZONE_PADDING(name)     struct zone_padding name;
 #else
 #define ZONE_PADDING(name)
@@ -91,14 +91,25 @@ struct per_cpu_pageset {
  * be 8 (2 ** 3) zonelists.  GFP_ZONETYPES defines the number of possible
  * combinations of zone modifiers in "zone modifier space".
  *
+ * As an optimisation any zone modifier bits which are only valid when
+ * no other zone modifier bits are set (loners) should be placed in
+ * the highest order bits of this field.  This allows us to reduce the
+ * extent of the zonelists thus saving space.  For example in the case
+ * of three zone modifier bits, we could require up to eight zonelists.
+ * If the left most zone modifier is a "loner" then the highest valid
+ * zonelist would be four allowing us to allocate only five zonelists.
+ * Use the first form for GFP_ZONETYPES when the left most bit is not
+ * a "loner", otherwise use the second.
+ *
  * NOTE! Make sure this matches the zones in <linux/gfp.h>
  */
 #define GFP_ZONEMASK   0x07
-#define GFP_ZONETYPES  5
+/* #define GFP_ZONETYPES       (GFP_ZONEMASK + 1) */           /* Non-loner */
+#define GFP_ZONETYPES  ((GFP_ZONEMASK + 1) / 2 + 1)            /* Loner */
 
 /*
  * On machines where it is needed (eg PCs) we divide physical memory
- * into multiple physical zones. On a PC we have 4 zones:
+ * into multiple physical zones. On a 32bit PC we have 4 zones:
  *
  * ZONE_DMA      < 16 MB       ISA DMA capable memory
  * ZONE_DMA32       0 MB       Empty
@@ -149,14 +160,16 @@ struct zone {
        unsigned long           pages_scanned;     /* since last reclaim */
        int                     all_unreclaimable; /* All pages pinned */
 
-       /*
-        * Does the allocator try to reclaim pages from the zone as soon
-        * as it fails a watermark_ok() in __alloc_pages?
-        */
-       int                     reclaim_pages;
        /* A count of how many reclaimers are scanning this zone */
        atomic_t                reclaim_in_progress;
 
+       /*
+        * timestamp (in jiffies) of the last zone reclaim that did not
+        * result in freeing of pages. This is used to avoid repeated scans
+        * if all memory in the zone is in use.
+        */
+       unsigned long           last_unsuccessful_zone_reclaim;
+
        /*
         * prev_priority holds the scanning priority for this zone.  It is
         * defined as the scanning priority at which we achieved our reclaim
@@ -233,7 +246,7 @@ struct zone {
         * rarely used fields:
         */
        char                    *name;
-} ____cacheline_maxaligned_in_smp;
+} ____cacheline_internodealigned_in_smp;
 
 
 /*
@@ -437,6 +450,8 @@ int min_free_kbytes_sysctl_handler(struct ctl_table *, int, struct file *,
 extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES-1];
 int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *,
                                        void __user *, size_t *, loff_t *);
+int percpu_pagelist_fraction_sysctl_handler(struct ctl_table *, int, struct file *,
+                                       void __user *, size_t *, loff_t *);
 
 #include <linux/topology.h>
 /* Returns the number of the current Node. */