Raid0 needs more memory.

Tall cool one (ice@mama.indstate.edu)
Mon, 30 Jun 1997 16:07:28 -0500


Hello,

I posted about this a week or so ago to the list, but seems like a few
other people's messages, it didn't get through, so I thought I'd repost it
because I see others are having the same problem I had.

Recently I tried to make a 12GB raid0 array of 3 4GB drives and watched the
system die horribly when the raid0 personalty failed to get the 240K or so it
asked for and proceeded to try to work without it anyway. The MD developers
should make the raid0 personality fail nicely if it can't get the memory it
allocated (two if statements as I recall), but in order to actually work,
kmalloc() needs to support larger bucket sizes (256K at least). Even two 4GB
drives for an 8GB array would fail when it needed 143K, although it would
sometimes succeed? (may have been playing with the chunk size at the time,
the hash seems to grow with larger chunks).

I think that kmalloc should provide some bigger bucket sizes in the newer
kernels for drivers written with the motto "Throw more resources at it". So
I provide a patch here which adds 256K, 512K and 1M bucket sizes (512K, 1M
and 2M on 8K page machines) applied against 2.0.30:

---------cut-----------
--- linux-orig/mm/kmalloc.c Sat Jun 8 10:12:33 1996
+++ linux/mm/kmalloc.c Thu Jun 19 09:54:42 1997
@@ -110,6 +110,9 @@
32768 - 16,
65536 - 16,
131072 - 16,
+ 262144 - 16,
+ 524288 - 16,
+ 1048576 - 16,
0
};

@@ -128,6 +131,9 @@
{NULL, NULL, 1, 0, 0, 0, 0, 3},
{NULL, NULL, 1, 0, 0, 0, 0, 4},
{NULL, NULL, 1, 0, 0, 0, 0, 5},
+ {NULL, NULL, 1, 0, 0, 0, 0, 6},
+ {NULL, NULL, 1, 0, 0, 0, 0, 7},
+ {NULL, NULL, 1, 0, 0, 0, 0, 8},
{NULL, NULL, 0, 0, 0, 0, 0, 0}
};
#elif PAGE_SIZE == 8192
@@ -145,6 +151,9 @@
65536 - 32,
131072 - 32,
262144 - 32,
+ 524288 - 32,
+ 1048576 - 32,
+ 2097152 - 32,
0
};

@@ -163,6 +172,9 @@
{NULL, NULL, 1, 0, 0, 0, 0, 3},
{NULL, NULL, 1, 0, 0, 0, 0, 4},
{NULL, NULL, 1, 0, 0, 0, 0, 5},
+ {NULL, NULL, 1, 0, 0, 0, 0, 6},
+ {NULL, NULL, 1, 0, 0, 0, 0, 7},
+ {NULL, NULL, 1, 0, 0, 0, 0, 8},
{NULL, NULL, 0, 0, 0, 0, 0, 0}
};
#else
---------cut-----------

Please let me know if this is a "bad-thing-to-do", but this patch worked
for me, even though I'm not using the 12GB array anymore.

- Steve

.--------------------------------------------------. # * # # # # # #
| Steve Baker | Barely Working | # ## # # # # #
| ice@mama.indstate.edu | System Administrator | # # # # # # # #
| Red-Hat Rulz! | Will work for hardware | # # # ## # # # #
`--- SYS-ADMIN FOR HIRE, HAVE UNIX, WILL TRAVEL ---' #### # # # ## # #