aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/pageattr.c
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2008-09-23 17:00:40 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-10 13:29:15 -0400
commit55121b4369ced87863bf04da1f762a37e58aee4d (patch)
tree2457540a64011581ac4510cfeeba27399c4f92ae /arch/x86/mm/pageattr.c
parent0b8fdcbcd287a1fbe66817491e6149841ae25705 (diff)
x86, cpa: no need to check alias for __set_pages_p/__set_pages_np
No alias checking needed for setting present/not-present mapping. Otherwise, we may need to break large pages for 64-bit kernel text mappings (this adds to complexity if we want to do this from atomic context especially, for ex: with CONFIG_DEBUG_PAGEALLOC). Let's keep it simple! Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Cc: Suresh Siddha <suresh.b.siddha@intel.com> Cc: arjan@linux.intel.com Cc: venkatesh.pallipadi@intel.com Cc: jeremy@goop.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/mm/pageattr.c')
-rw-r--r--arch/x86/mm/pageattr.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 4b6968ba0864..162812b05d28 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -1121,7 +1121,13 @@ static int __set_pages_p(struct page *page, int numpages)
1121 .mask_clr = __pgprot(0), 1121 .mask_clr = __pgprot(0),
1122 .flags = 0}; 1122 .flags = 0};
1123 1123
1124 return __change_page_attr_set_clr(&cpa, 1); 1124 /*
1125 * No alias checking needed for setting present flag. otherwise,
1126 * we may need to break large pages for 64-bit kernel text
1127 * mappings (this adds to complexity if we want to do this from
1128 * atomic context especially). Let's keep it simple!
1129 */
1130 return __change_page_attr_set_clr(&cpa, 0);
1125} 1131}
1126 1132
1127static int __set_pages_np(struct page *page, int numpages) 1133static int __set_pages_np(struct page *page, int numpages)
@@ -1133,7 +1139,13 @@ static int __set_pages_np(struct page *page, int numpages)
1133 .mask_clr = __pgprot(_PAGE_PRESENT | _PAGE_RW), 1139 .mask_clr = __pgprot(_PAGE_PRESENT | _PAGE_RW),
1134 .flags = 0}; 1140 .flags = 0};
1135 1141
1136 return __change_page_attr_set_clr(&cpa, 1); 1142 /*
1143 * No alias checking needed for setting not present flag. otherwise,
1144 * we may need to break large pages for 64-bit kernel text
1145 * mappings (this adds to complexity if we want to do this from
1146 * atomic context especially). Let's keep it simple!
1147 */
1148 return __change_page_attr_set_clr(&cpa, 0);
1137} 1149}
1138 1150
1139void kernel_map_pages(struct page *page, int numpages, int enable) 1151void kernel_map_pages(struct page *page, int numpages, int enable)
@@ -1153,11 +1165,8 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
1153 1165
1154 /* 1166 /*
1155 * The return value is ignored as the calls cannot fail. 1167 * The return value is ignored as the calls cannot fail.
1156 * Large pages are kept enabled at boot time, and are 1168 * Large pages for identity mappings are not used at boot time
1157 * split up quickly with DEBUG_PAGEALLOC. If a splitup 1169 * and hence no memory allocations during large page split.
1158 * fails here (due to temporary memory shortage) no damage
1159 * is done because we just keep the largepage intact up
1160 * to the next attempt when it will likely be split up:
1161 */ 1170 */
1162 if (enable) 1171 if (enable)
1163 __set_pages_p(page, numpages); 1172 __set_pages_p(page, numpages);