Messages in this thread Patch in this message | | | Date | Tue, 28 Dec 1999 01:01:12 +0100 (CET) | From | Andrea Arcangeli <> | Subject | Re: [PATCH] 2.3.34/pre-2.3.35-3 ramdisk/initrd NOT as a |
| |
On Mon, 27 Dec 1999, Andrea Arcangeli wrote:
>and that fixes the oom fine too as expected. I'll provide the real fix for >2.2.x too RSN.
This is an untested fix against 2.2.14pre16:
--- 2.2.14pre16/fs/buffer.c.~1~ Tue Dec 28 00:46:02 1999 +++ 2.2.14pre16/fs/buffer.c Tue Dec 28 00:51:00 1999 @@ -817,7 +817,9 @@ printk("Attempt to refile free buffer\n"); return; } - if (buffer_dirty(buf)) + if (buffer_protected(buf)) + dispose = BUF_PROTECTED; + else if (buffer_dirty(buf)) dispose = BUF_DIRTY; else if (buffer_locked(buf)) dispose = BUF_LOCKED; @@ -831,7 +833,7 @@ /* This buffer is dirty, maybe we need to start flushing. * If too high a percentage of the buffers are dirty... */ - if (nr_buffers_type[BUF_DIRTY] > too_many) + if ((nr_buffers_type[BUF_DIRTY]+nr_buffers_type[BUF_PROTECTED]) > too_many) wakeup_bdflush(1); /* If this is a loop device, and @@ -1503,7 +1505,7 @@ int found = 0, locked = 0, dirty = 0, used = 0, lastused = 0; int protected = 0; int nlist; - static char *buf_types[NR_LIST] = {"CLEAN","LOCKED","DIRTY"}; + static char *buf_types[NR_LIST] = {"CLEAN","LOCKED","DIRTY","PROTECTED",}; printk("Buffer memory: %8ldkB\n",buffermem>>10); printk("Buffer heads: %6d\n",nr_buffer_heads); --- 2.2.14pre16/include/linux/fs.h.~1~ Tue Dec 28 00:46:03 1999 +++ 2.2.14pre16/include/linux/fs.h Tue Dec 28 00:52:11 1999 @@ -759,7 +759,8 @@ #define BUF_CLEAN 0 #define BUF_LOCKED 1 /* Buffers scheduled for write */ #define BUF_DIRTY 2 /* Dirty buffers, not yet scheduled for write */ -#define NR_LIST 3 +#define BUF_PROTECTED 3 /* Ramdisk persistent storage */ +#define NR_LIST 4 void mark_buffer_uptodate(struct buffer_head * bh, int on); Andrea
PS. It's not urgent enough to go into 2.2.14 but this MM balance problem could be addressed in 2.2.15 if the reports will be successfully :)
- 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/
| |