On Mon, 2016-12-19 at 15:18 +0530, Aneesh Kumar K.V wrote:
quoted
+ pte = pte_start + pte_index(addr);
+ for (; addr < end; addr = next, pte++) {
+ next = (addr + PAGE_SIZE) & PAGE_MASK;
+ if (next > end)
+ next = end;
+
+ if (!pte_present(*pte))
+ continue;
+
+ spin_lock(&init_mm.page_table_lock);
+ pte_clear(&init_mm, addr, pte);
+ spin_unlock(&init_mm.page_table_lock);
+ }
+
+ flush_tlb_mm(&init_mm);
Why call a flush here. we do that at the end of remove_page_table .
Isn't that sufficient ?
All those lock/unlock ... what for ? Can't we just do the whole page ?
Also I agree, we can delay the flush of the PTEs to the end.
Ben.