]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/mm_types.h
Merge branch 'slab/for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penber...
[karo-tx-linux.git] / include / linux / mm_types.h
index 2fef4e720e7955547cb3070f06c083f14a800063..f8f5162a3571742ff0419638bd18fee62e04be72 100644 (file)
@@ -172,6 +172,10 @@ struct page {
         */
        void *shadow;
 #endif
+
+#ifdef CONFIG_NUMA_BALANCING
+       int _last_nid;
+#endif
 }
 /*
  * The struct page can be forced to be double word aligned so that atomic ops
@@ -221,7 +225,8 @@ struct vm_region {
  * library, the executable area etc).
  */
 struct vm_area_struct {
-       struct mm_struct * vm_mm;       /* The address space we belong to. */
+       /* The first cache line has the info for VMA tree walking. */
+
        unsigned long vm_start;         /* Our start address within vm_mm. */
        unsigned long vm_end;           /* The first byte after our end address
                                           within vm_mm. */
@@ -229,11 +234,22 @@ struct vm_area_struct {
        /* linked list of VM areas per task, sorted by address */
        struct vm_area_struct *vm_next, *vm_prev;
 
+       struct rb_node vm_rb;
+
+       /*
+        * Largest free memory gap in bytes to the left of this VMA.
+        * Either between this VMA and vma->vm_prev, or between one of the
+        * VMAs below us in the VMA rbtree and its ->vm_prev. This helps
+        * get_unmapped_area find a free area of the right size.
+        */
+       unsigned long rb_subtree_gap;
+
+       /* Second cache line starts here. */
+
+       struct mm_struct *vm_mm;        /* The address space we belong to. */
        pgprot_t vm_page_prot;          /* Access permissions of this VMA. */
        unsigned long vm_flags;         /* Flags, see mm.h. */
 
-       struct rb_node vm_rb;
-
        /*
         * For areas with an address space and backing store,
         * linkage into the address_space->i_mmap interval tree, or
@@ -319,6 +335,7 @@ struct mm_struct {
        unsigned long task_size;                /* size of task vm space */
        unsigned long cached_hole_size;         /* if non-zero, the largest hole below free_area_cache */
        unsigned long free_area_cache;          /* first hole of size cached_hole_size or larger */
+       unsigned long highest_vm_end;           /* highest vma end address */
        pgd_t * pgd;
        atomic_t mm_users;                      /* How many users with user space? */
        atomic_t mm_count;                      /* How many references to "struct mm_struct" (users count as 1) */
@@ -394,10 +411,37 @@ struct mm_struct {
 #endif
 #ifdef CONFIG_CPUMASK_OFFSTACK
        struct cpumask cpumask_allocation;
+#endif
+#ifdef CONFIG_NUMA_BALANCING
+       /*
+        * numa_next_scan is the next time when the PTEs will me marked
+        * pte_numa to gather statistics and migrate pages to new nodes
+        * if necessary
+        */
+       unsigned long numa_next_scan;
+
+       /* numa_next_reset is when the PTE scanner period will be reset */
+       unsigned long numa_next_reset;
+
+       /* Restart point for scanning and setting pte_numa */
+       unsigned long numa_scan_offset;
+
+       /* numa_scan_seq prevents two threads setting pte_numa */
+       int numa_scan_seq;
+
+       /*
+        * The first node a task was scheduled on. If a task runs on
+        * a different node than Make PTE Scan Go Now.
+        */
+       int first_nid;
 #endif
        struct uprobes_state uprobes_state;
 };
 
+/* first nid will either be a valid NID or one of these values */
+#define NUMA_PTE_SCAN_INIT     -1
+#define NUMA_PTE_SCAN_ACTIVE   -2
+
 static inline void mm_init_cpumask(struct mm_struct *mm)
 {
 #ifdef CONFIG_CPUMASK_OFFSTACK