
From: Ingo Molnar <mingo@elte.hu>

The attached patch fixes long scheduling latencies in get_user_pages().

Has been tested as part of the -VP patchset.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/mm/memory.c |    2 ++
 1 files changed, 2 insertions(+)

diff -puN mm/memory.c~sched-mm-fix-scheduling-latencies-in-get_user_pages mm/memory.c
--- 25/mm/memory.c~sched-mm-fix-scheduling-latencies-in-get_user_pages	2004-11-18 23:47:53.138592424 -0800
+++ 25-akpm/mm/memory.c	2004-11-18 23:47:53.142591816 -0800
@@ -932,6 +932,8 @@ int get_user_pages(struct task_struct *t
 		do {
 			struct page *map;
 			int lookup_write = write;
+
+			cond_resched_lock(&mm->page_table_lock);
 			while (!(map = follow_page(mm, start, lookup_write))) {
 				/*
 				 * Shortcut for anonymous pages. We don't want
_
