[PATCH] bdflush param limits use hardcoded HZ

Patrik Rak (patrik@raxoft.cz)
Wed, 6 Jan 1999 08:35:55 +0100 (CET)


Hi!

While browsing through the sources of 2.2.0-pre4 kernel, I noticed that
block and superblock flush-time limits (kept in bdflush_min and
bdflush_max) are expressed in jiffies but do not expect HZ other than 100.

Also, I noticed that the static variable refilled is no longer reasonably
used, so I removed it together with some remaining (but useless) code
referencing it. (There is a chance that this one might need further
investigation, though, as it might allow for some other related changes).

That's what the patch below is for. I bet it's easy to understand.

--- linux-2.2.0-pre4/fs/buffer.c Sun Jan 3 11:49:34 1999
+++ linux/fs/buffer.c Wed Jan 6 08:10:08 1999
@@ -76,8 +76,6 @@
static int nr_buffers_type[NR_LIST] = {0,};
static int nr_buffer_heads = 0;
static int nr_unused_buffer_heads = 0;
-static int refilled = 0; /* Set NZ when a buffer freelist is refilled
- this is used by the loop device */

/* This is used by some architectures to estimate available memory. */
int buffermem = 0;
@@ -113,8 +111,8 @@
} bdf_prm = {{40, 500, 64, 256, 15, 30*HZ, 5*HZ, 1884, 2}};

/* These are the min and max parameter values that we will allow to be assigned */
-int bdflush_min[N_PARAM] = { 0, 10, 5, 25, 0, 100, 100, 1, 1};
-int bdflush_max[N_PARAM] = {100,5000, 2000, 2000,100, 60000, 60000, 2047, 5};
+int bdflush_min[N_PARAM] = { 0, 10, 5, 25, 0, 1*HZ, 1*HZ, 1, 1};
+int bdflush_max[N_PARAM] = {100,5000, 2000, 2000,100,600*HZ,600*HZ, 2047, 5};

void wakeup_bdflush(int);

@@ -1774,7 +1772,6 @@
#endif
{
ndirty = 0;
- refilled = 0;
repeat:

bh = lru_list[nlist];
@@ -1801,8 +1798,6 @@
major = MAJOR(bh->b_dev);
/* Should we write back buffers that are shared or not??
currently dirty buffers are not shared, so it does not matter */
- if (refilled && major == LOOP_MAJOR)
- continue;
next->b_count++;
bh->b_count++;
ndirty++;

Patrik

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