1999-01-25 17:02:33

by Stephen C. Tweedie

[permalink] [raw]
Subject: Re: [patch] dynamic buffer cache hash table size

Hi,

On Sat, 23 Jan 1999 0:00:23 MET, Heinz Mauelshagen
<[email protected]> said:

> Have to do that test run later, but have a look at the already existing
> one below.

> Ingo Molnar asked me just today for a profile.
> Most of the time is wasted in sync_buffers.

I am not surprised. Currently we have no way to flush completed
writeback buffers off the LOCKED list and back onto the CLEAN list.
sync() is therefore wandering over clean buffers all the time.

Could you try the following patch (against 2.2.0-pre9)? It allows both
sync and bdflush to refile such completed buffers back to the CLEAN
list.

--Stephen

----------------------------------------------------------------
--- fs/buffer.c.~1~ Wed Jan 20 13:35:22 1999
+++ fs/buffer.c Mon Jan 25 15:39:28 1999
@@ -247,6 +248,9 @@
}
wait_on_buffer (bh);
goto repeat2;
+ } else {
+ refile_buffer(bh);
+ goto repeat2;
}
}

@@ -1752,7 +1788,7 @@
#ifdef DEBUG
for(nlist = 0; nlist < NR_LIST; nlist++)
#else
- for(nlist = BUF_DIRTY; nlist <= BUF_DIRTY; nlist++)
+ for(nlist = BUF_LOCKED; nlist <= BUF_DIRTY; nlist++)
#endif
{
ndirty = 0;
@@ -1772,6 +1808,13 @@

/* Clean buffer on dirty list? Refile it */
if (nlist == BUF_DIRTY && !buffer_dirty(bh) && !buffer_locked(bh))
+ {
+ refile_buffer(bh);
+ continue;
+ }
+
+ /* Unlocked buffer on locked list? Refile it */
+ if (nlist == BUF_LOCKED && !buffer_locked(bh))
{
refile_buffer(bh);
continue;