[PATCH 7/7] highmem: avoid page_address() in flush_all_zero_pkmaps()

From: Lai Jiangshan
Date: Wed Jun 06 2012 - 04:16:09 EST


We can get the virtual address from PKMAP_ADDR(i),
we don't need to call page_address() here.

Signed-off-by: Lai Jiangshan <laijs@xxxxxxxxxxxxxx>
---
mm/highmem.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/mm/highmem.c b/mm/highmem.c
index 6f028cb..994fd68 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -103,8 +103,6 @@ static void flush_all_zero_pkmaps(void)
flush_cache_kmaps();

for (i = 0; i < LAST_PKMAP; i++) {
- struct page *page;
-
/*
* zero means we don't have anything to do,
* >1 means that it is still in use. Only
@@ -125,9 +123,7 @@ static void flush_all_zero_pkmaps(void)
* getting the kmap_lock (which is held here).
* So no dangers, even with speculative execution.
*/
- page = pte_page(pkmap_page_table[i]);
- pte_clear(&init_mm, (unsigned long)page_address(page),
- &pkmap_page_table[i]);
+ pte_clear(&init_mm, PKMAP_ADDR(i), &pkmap_page_table[i]);

clear_high_page_map(i);
need_flush = 1;
--
1.7.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/