aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/pat_internal.h
diff options
context:
space:
mode:
authorPallipadi, Venkatesh <venkatesh.pallipadi@intel.com>2010-02-10 18:26:07 -0500
committerH. Peter Anvin <hpa@zytor.com>2010-02-18 18:41:36 -0500
commit9e41a49aab88a5a6c8f4875bf10a5543bc321f2d (patch)
tree65a4921f5a7973f017e66b9ca00b6427eb3a6c83 /arch/x86/mm/pat_internal.h
parentbe5a0c126ad1dea2128dc5aef12c87083518d1ab (diff)
x86, pat: Migrate to rbtree only backend for pat memtype management
Move pat backend to fully rbtree based implementation from the existing rbtree and linked list hybrid. New rbtree based solution uses interval trees (augmented rbtrees) in order to store the PAT ranges. The new code seprates out the pat backend to pat_rbtree.c file, making is cleaner. The change also makes the PAT lookup, reserve and free operations more optimal, as we don't have to traverse linear linked list of few tens of entries in normal case. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> LKML-Reference: <20100210232607.GB11465@linux-os.sc.intel.com> Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/mm/pat_internal.h')
-rw-r--r--arch/x86/mm/pat_internal.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/x86/mm/pat_internal.h b/arch/x86/mm/pat_internal.h
index 6c98780eb731..4f39eefa3e61 100644
--- a/arch/x86/mm/pat_internal.h
+++ b/arch/x86/mm/pat_internal.h
@@ -9,8 +9,8 @@ extern int pat_debug_enable;
9struct memtype { 9struct memtype {
10 u64 start; 10 u64 start;
11 u64 end; 11 u64 end;
12 u64 subtree_max_end;
12 unsigned long type; 13 unsigned long type;
13 struct list_head nd;
14 struct rb_node rb; 14 struct rb_node rb;
15}; 15};
16 16
@@ -25,4 +25,22 @@ static inline char *cattr_name(unsigned long flags)
25 } 25 }
26} 26}
27 27
28#ifdef CONFIG_X86_PAT
29extern int rbt_memtype_check_insert(struct memtype *new,
30 unsigned long *new_type);
31extern int rbt_memtype_erase(u64 start, u64 end);
32extern struct memtype *rbt_memtype_lookup(u64 addr);
33extern int rbt_memtype_copy_nth_element(struct memtype *out, loff_t pos);
34#else
35static inline int rbt_memtype_check_insert(struct memtype *new,
36 unsigned long *new_type)
37{ return 0; }
38static inline int rbt_memtype_erase(u64 start, u64 end)
39{ return 0; }
40static inline struct memtype *rbt_memtype_lookup(u64 addr)
41{ return NULL; }
42static inline int rbt_memtype_copy_nth_element(struct memtype *out, loff_t pos)
43{ return 0; }
44#endif
45
28#endif /* __PAT_INTERNAL_H_ */ 46#endif /* __PAT_INTERNAL_H_ */