2.3.[789] without aging in page cache

Andrea Arcangeli (andrea@suse.de)
Tue, 29 Jun 1999 20:36:38 +0200 (CEST)


It seems to me that we are not setting anymore the referenced bit upon
succesfully find in the page/buffer cache.

This patch will give back the aging to the buffer and page cache (plus a
little optimization I couldn't avoid me to add using find_buffer directly
:). The touch_buffer in brelse is meaningless for me.

Index: linux/fs/buffer.c
===================================================================
RCS file: /var/cvs/linux/fs/buffer.c,v
retrieving revision 1.1.1.26
diff -u -r1.1.1.26 buffer.c
--- linux/fs/buffer.c 1999/06/28 15:07:22 1.1.1.26
+++ linux/fs/buffer.c 1999/06/29 18:31:16
@@ -785,8 +785,10 @@
int isize;

repeat:
- bh = get_hash_table(dev, block, size);
+ bh = find_buffer(dev, block, size);
if (bh) {
+ bh->b_count++;
+ touch_buffer(bh);
if (!buffer_dirty(bh)) {
bh->b_flushtime = 0;
}
@@ -910,8 +912,6 @@
*/
void __brelse(struct buffer_head * buf)
{
- touch_buffer(buf);
-
if (buf->b_count) {
buf->b_count--;
wake_up(&buffer_wait);
Index: linux/mm/filemap.c
===================================================================
RCS file: /var/cvs/linux/mm/filemap.c,v
retrieving revision 1.1.1.25
diff -u -r1.1.1.25 filemap.c
--- linux/mm/filemap.c 1999/06/25 13:34:46 1.1.1.25
+++ linux/mm/filemap.c 1999/06/29 18:25:14
@@ -359,6 +359,7 @@
if (page->offset == offset)
break;
}
+ set_bit(PG_referenced, &page->flags);
not_found:
return page;
}

Maybe that's the reason of the not too much fast kernel compile (someone
reported to the list) with the latest 2.3.x kernels?

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/