[patch] soft-RT latency (kswapd and update not check need_resched)

Andrea Arcangeli (andrea@suse.de)
Fri, 23 Jul 1999 00:48:54 +0200 (CEST)


Benno and Roger reported me that they got bad RT latency running an RT app
_and_ writing tons of data to disk at the same time.

It seems I spotted and fixed at least one of the reasons: kswapd and
sync_old_buffers was not checking if they should reschedule during their
loops (and they can sleep). I sent this patch for testing to Benno and
Roger and it seems it helps quite a bit.

Benno and Roger have the numbers.

(the patch is against 2.2.10)

--- linux-2.2.10/fs/buffer.c~ Tue Jul 13 00:33:14 1999
+++ linux-2.2.10/fs/buffer.c Mon Jul 19 17:22:34 1999
@@ -1636,6 +1636,8 @@
#endif
ll_rw_block(WRITE, 1, &bh);
bh->b_count--;
+ if (current->need_resched)
+ schedule();
next->b_count--;
}
}
@@ -1796,6 +1798,8 @@
if(nlist != BUF_DIRTY) ncount++;
#endif
bh->b_count--;
+ if (current->need_resched)
+ schedule();
next->b_count--;
}
}

Andrea

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/