Re: test1-ac22-classzone performance

From: Rik van Riel (riel@conectiva.com.br)
Date: Thu Jun 22 2000 - 11:26:03 EST


On Tue, 20 Jun 2000, Andrea Arcangeli wrote:

> I bet the loss of responsiveness are due this below stuff (one
> of the two things is a bugfix) that is unrelated with classzone.
> I'm not yet sure though,

The buffer.c patch below is definately wrong.

The reason for that is that the order in which the VM subsystem
wants to have buffers flushed can be different than the order in
which buffer.c wants to have the buffers flushed.

The buffer LRU list flushes the buffers with the *oldest data*
while shrink_mmap() is somewhere between NRU and NFU. Suppose
that the oldest data in the buffer cache is in files which are
still in use and shrink_mmap() wants to flush out a buffer page
which was written to relatively recently but which has data that
was never accessed again...

This patch will make shrink_mmap() unable to chose which pages
it wants to have flushed. This will interfere badly with page
replacement. The only reason it works seems to be a bug in
kflushd (buffer.c::bdflush()) ... it turned out kflushd doesn't
actually flush pages for IO so it'll try to flush *all* pages
at once because the dirty buffer state doesn't change while
it's running.

> --- 2.4.0-test1-ac22-classzone-VM/fs/buffer.c.~1~ Tue Jun 20 00:55:39 2000
> +++ 2.4.0-test1-ac22-classzone-VM/fs/buffer.c Tue Jun 20 17:21:00 2000
> @@ -2379,25 +2379,6 @@
> #define BUFFER_BUSY_BITS ((1<<BH_Dirty) | (1<<BH_Lock) | (1<<BH_Protected))
> #define buffer_busy(bh) (atomic_read(&(bh)->b_count) | ((bh)->b_state & BUFFER_BUSY_BITS))
>
> -static int sync_page_buffers(struct buffer_head * bh)
> -{
> - struct buffer_head * tmp = bh;
> -
> - do {
> - if (buffer_dirty(tmp) && !buffer_locked(tmp))
> - ll_rw_block(WRITE, 1, &tmp);
> - tmp = tmp->b_this_page;
> - } while (tmp != bh);
> -
> - do {
> - if (buffer_busy(tmp))
> - return 1;
> - tmp = tmp->b_this_page;
> - } while (tmp != bh);
> -
> - return 0;
> -}
> -
> /*
> * try_to_free_buffers() checks if all the buffers on this particular page
> * are unused, and free's the page if so.
> @@ -2460,8 +2441,7 @@
> spin_unlock(&free_list[index].lock);
> write_unlock(&hash_table_lock);
> spin_unlock(&lru_list_lock);
> - if (!sync_page_buffers(bh))
> - goto again;
> + wakeup_bdflush(0);
> return 0;
> }

Rik

--
The Internet is not a network of computers. It is a network
of people. That is its real strength.

Wanna talk about the kernel? irc.openprojects.net / #kernelnewbies http://www.conectiva.com/ http://www.surriel.com/

- 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/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:24 EST