Linus,

You forgot about wakeup_bdflush(1) stuff.

Here is the patch again (against test10).
===============================================================
There are several places where schedule() is called after wakeup_bdflush(1)
is called. This is completely unnecessary, since wakeup_bdflush(1) already
gave up the control, and when the control is returned to the calling thread
who called wakeup_bdflush(1), it should just go on. Calling schedule()
after wakeup_bdflush(1) will make the calling thread give up control again.
This is a problem for some of those latency sensitive benchmarks (like SPEC
SFS) and applications.

============
diff -ruN mm.orig/highmem.c mm.opt/highmem.c
--- mm.orig/highmem.c   Wed Oct 18 14:25:46 2000
+++ mm.opt/highmem.c    Fri Nov 10 17:51:39 2000
@@ -310,8 +310,6 @@
    bh = kmem_cache_alloc(bh_cachep, SLAB_BUFFER);
    if (!bh) {
        wakeup_bdflush(1);  /* Sets task->state to TASK_RUNNING */
-       current->policy |= SCHED_YIELD;
-       schedule();
        goto repeat_bh;
    }
    /*
@@ -324,8 +322,6 @@
    page = alloc_page(GFP_BUFFER);
    if (!page) {
        wakeup_bdflush(1);  /* Sets task->state to TASK_RUNNING */
-       current->policy |= SCHED_YIELD;
-       schedule();
        goto repeat_page;
    }
    set_bh_page(bh, page, 0);
diff -ruN fs.orig/buffer.c fs.opt/buffer.c
--- fs.orig/buffer.c    Thu Oct 12 14:19:32 2000
+++ fs.opt/buffer.c Fri Nov 10 20:05:44 2000
@@ -707,11 +707,8 @@
  */
 static void refill_freelist(int size)
 {
-   if (!grow_buffers(size)) {
+   if (!grow_buffers(size))
        wakeup_bdflush(1);  /* Sets task->state to TASK_RUNNING */
-       current->policy |= SCHED_YIELD;
-       schedule();
-   }
 }

 void init_buffer(struct buffer_head *bh, bh_end_io_t *handler, void
*private)
==============================


Ying Chen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/

Reply via email to