--- linux-2.4.0-test3-pre4/mm/filemap.c Thu Jul 6 20:23:47 2000 +++ linux-akpm/mm/filemap.c Fri Jul 7 01:39:02 2000 @@ -160,6 +160,8 @@ start = (lstart + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; repeat: + if (current->need_resched) + schedule(); /* LOWLATENCY sys_unlink() */ head = &mapping->pages; spin_lock(&pagecache_lock); curr = head->next; @@ -450,6 +452,10 @@ page_cache_get(page); spin_unlock(&pagecache_lock); + + if (current->need_resched) + schedule(); /* LOWLATENCY sys_sync() */ + lock_page(page); /* The buffers could have been free'd while we waited for the page lock */ @@ -1081,6 +1087,9 @@ * "pos" here (the actor routine has to update the user buffer * pointers and the remaining count). */ + if (current->need_resched) + schedule(); /* LOWLATENCY sys_read() */ + nr = actor(desc, page, offset, nr); offset += nr; index += offset >> PAGE_CACHE_SHIFT; @@ -1533,6 +1542,8 @@ * vma/file is guaranteed to exist in the unmap/sync cases because * mmap_sem is held. */ + if (current->need_resched) + schedule(); /* LOWLATENCY sys_msync() */ return page->mapping->a_ops->writepage(file, page); } @@ -2486,6 +2497,9 @@ while (count) { unsigned long bytes, index, offset; char *kaddr; + + if (current->need_resched) + schedule(); /* LOWLATENCY sys_write() */ /* * Try to find the page in the cache. If it isn't there,