diff -urN 2.4.18pre1/fs/buffer.c lowlat/fs/buffer.c --- 2.4.18pre1/fs/buffer.c Fri Dec 21 20:06:42 2001 +++ lowlat/fs/buffer.c Tue Jan 8 14:30:31 2002 @@ -221,6 +221,8 @@ continue; spin_unlock(&lru_list_lock); + conditional_schedule(); + write_locked_buffers(array, count); return -EAGAIN; } @@ -228,6 +230,7 @@ __refile_buffer(bh); } spin_unlock(&lru_list_lock); + conditional_schedule(); if (count) write_locked_buffers(array, count); @@ -280,9 +283,11 @@ spin_unlock(&lru_list_lock); wait_on_buffer (bh); put_bh(bh); + conditional_schedule(); return -EAGAIN; } spin_unlock(&lru_list_lock); + conditional_schedule(); return 0; } @@ -1031,6 +1036,7 @@ for (;;) { struct buffer_head * bh; + conditional_schedule(); bh = get_hash_table(dev, block, size); if (bh) { touch_buffer(bh); diff -urN 2.4.18pre1/mm/filemap.c lowlat/mm/filemap.c --- 2.4.18pre1/mm/filemap.c Sat Jan 5 06:17:43 2002 +++ lowlat/mm/filemap.c Tue Jan 8 14:30:31 2002 @@ -402,11 +402,8 @@ } page_cache_release(page); - if (current->need_resched) { - __set_current_state(TASK_RUNNING); - schedule(); - } + conditional_schedule(); spin_lock(&pagecache_lock); goto restart; } @@ -697,6 +690,8 @@ struct page **hash = page_hash(mapping, offset); struct page *page; + conditional_schedule(); + spin_lock(&pagecache_lock); page = __find_page_nolock(mapping, offset, *hash); spin_unlock(&pagecache_lock);