linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hugetlb: cond_resched for set_max_huge_pages and follow_hugetlb_page
@ 2015-07-23 21:54 Spencer Baugh
  2015-07-23 22:08 ` David Rientjes
  2015-07-24  6:59 ` Michal Hocko
  0 siblings, 2 replies; 10+ messages in thread
From: Spencer Baugh @ 2015-07-23 21:54 UTC (permalink / raw)
  To: Andrew Morton, Naoya Horiguchi, David Rientjes, Davidlohr Bueso,
	Mike Kravetz, Luiz Capitulino, open list:MEMORY MANAGEMENT,
	open list
  Cc: Joern Engel, Spencer Baugh, Joern Engel, Spencer Baugh

From: Joern Engel <joern@logfs.org>

~150ms scheduler latency for both observed in the wild.

Signed-off-by: Joern Engel <joern@logfs.org>
Signed-off-by: Spencer Baugh <sbaugh@catern.com>
---
 mm/hugetlb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index a8c3087..2eb6919 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1836,6 +1836,7 @@ static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count,
 			ret = alloc_fresh_gigantic_page(h, nodes_allowed);
 		else
 			ret = alloc_fresh_huge_page(h, nodes_allowed);
+		cond_resched();
 		spin_lock(&hugetlb_lock);
 		if (!ret)
 			goto out;
@@ -3521,6 +3522,7 @@ long follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
 				spin_unlock(ptl);
 			ret = hugetlb_fault(mm, vma, vaddr,
 				(flags & FOLL_WRITE) ? FAULT_FLAG_WRITE : 0);
+			cond_resched();
 			if (!(ret & VM_FAULT_ERROR))
 				continue;
 
-- 
2.5.0.rc3

--
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] 10+ messages in thread

end of thread, other threads:[~2015-07-24 20:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-23 21:54 [PATCH] hugetlb: cond_resched for set_max_huge_pages and follow_hugetlb_page Spencer Baugh
2015-07-23 22:08 ` David Rientjes
2015-07-23 22:36   ` Jörn Engel
2015-07-23 22:54     ` David Rientjes
2015-07-23 23:09       ` Jörn Engel
2015-07-24 19:49         ` David Rientjes
2015-07-24 20:49           ` Jörn Engel
2015-07-24  6:59 ` Michal Hocko
2015-07-24 17:12   ` Jörn Engel
2015-07-24 20:28     ` Davidlohr Bueso

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