linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC patch] mm: hugetlb: fix __unmap_hugepage_range
@ 2014-10-31  4:22 Hillf Danton
  2014-10-31  9:28 ` Michal Hocko
  2014-11-03 23:36 ` David Rientjes
  0 siblings, 2 replies; 3+ messages in thread
From: Hillf Danton @ 2014-10-31  4:22 UTC (permalink / raw)
  To: 'Michal Hocko'
  Cc: Andrew Morton, Hillf Danton, linux-kernel, linux-mm

First, after flushing TLB, we have no need to scan pte from start again.
Second, before bail out loop, the address is forwarded one step.

Signed-off-by: Hillf Danton <hillf.zj@alibaba-inc.com>
---

--- a/mm/hugetlb.c	Fri Oct 31 11:47:25 2014
+++ b/mm/hugetlb.c	Fri Oct 31 11:52:42 2014
@@ -2641,8 +2641,9 @@ void __unmap_hugepage_range(struct mmu_g
 
 	tlb_start_vma(tlb, vma);
 	mmu_notifier_invalidate_range_start(mm, mmun_start, mmun_end);
+	address = start;
 again:
-	for (address = start; address < end; address += sz) {
+	for (; address < end; address += sz) {
 		ptep = huge_pte_offset(mm, address);
 		if (!ptep)
 			continue;
@@ -2689,6 +2690,7 @@ again:
 		page_remove_rmap(page);
 		force_flush = !__tlb_remove_page(tlb, page);
 		if (force_flush) {
+			address += sz;
 			spin_unlock(ptl);
 			break;
 		}
--


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-03 23:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-31  4:22 [RFC patch] mm: hugetlb: fix __unmap_hugepage_range Hillf Danton
2014-10-31  9:28 ` Michal Hocko
2014-11-03 23:36 ` David Rientjes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox