lkml.org 
[lkml]   [2001]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Tuning Linux for high-speed disk subsystems
> After some testing at Compaq's lab in Oslo, I've come to the conclusion
> that Linux cannot scale higher than about 30-40MB/sec in or out of a
> hardware or software RAID-0 set with several stripe/chunk sizes tried out.
> The set is based on 5 18GB 10k disks running SCSI-3 (160MBps) alone on a
> 32bit/33MHz PCI bus.

this isn't quite true. use either the RH kernel, the -ac series, or the
attached patch (for 2.4.15-pre4). Then set /proc/sys/vm/max-readahead to 511 or
1023 (power of 2 minus 1)

this should allow you to generate large enough io's for streaming reads to do
what you are looking for.

-- craig


-------------------------------------------------------------------------------
Craig I. Hagan "It's a small world, but I wouldn't want to back it up"
hagan(at)cih.com "True hackers don't die, their ttl expires"
"It takes a village to raise an idiot, but an idiot can raze a village"

Stop the spread of spam, use a sendmail condom!
http://www.cih.com/~hagan/smtpd-hacks

In Bandwidth we trust
diff -ur linux-orig/drivers/md/md.c linux/drivers/md/md.c
--- linux-orig/drivers/md/md.c Mon Nov 12 23:34:52 2001
+++ linux/drivers/md/md.c Mon Nov 12 23:31:17 2001
@@ -3398,7 +3398,7 @@
/*
* Tune reconstruction:
*/
- window = MAX_READAHEAD*(PAGE_SIZE/512);
+ window = vm_max_readahead*(PAGE_SIZE/512);
printk(KERN_INFO "md: using %dk window, over a total of %d blocks.\n",
window/2,max_sectors/2);

diff -ur linux-orig/include/linux/blkdev.h linux/include/linux/blkdev.h
--- linux-orig/include/linux/blkdev.h Mon Nov 12 23:33:20 2001
+++ linux/include/linux/blkdev.h Mon Nov 12 23:31:17 2001
@@ -180,10 +180,6 @@

#define PageAlignSize(size) (((size) + PAGE_SIZE -1) & PAGE_MASK)

-/* read-ahead in pages.. */
-#define MAX_READAHEAD 31
-#define MIN_READAHEAD 3
-
#define blkdev_entry_to_request(entry) list_entry((entry), struct request, queue)
#define blkdev_entry_next_request(entry) blkdev_entry_to_request((entry)->next)
#define blkdev_entry_prev_request(entry) blkdev_entry_to_request((entry)->prev)
diff -ur linux-orig/include/linux/mm.h linux/include/linux/mm.h
--- linux-orig/include/linux/mm.h Mon Nov 12 23:33:38 2001
+++ linux/include/linux/mm.h Mon Nov 12 23:31:17 2001
@@ -111,6 +111,10 @@
#define VM_SequentialReadHint(v) ((v)->vm_flags & VM_SEQ_READ)
#define VM_RandomReadHint(v) ((v)->vm_flags & VM_RAND_READ)

+/* read ahead limits */
+extern int vm_min_readahead;
+extern int vm_max_readahead;
+
/*
* mapping from the currently active vm_flags protection bits (the
* low four bits) to a page protection mask..
diff -ur linux-orig/include/linux/raid/md_k.h linux/include/linux/raid/md_k.h
--- linux-orig/include/linux/raid/md_k.h Mon Nov 12 23:33:02 2001
+++ linux/include/linux/raid/md_k.h Mon Nov 12 23:31:17 2001
@@ -91,7 +91,7 @@
/*
* default readahead
*/
-#define MD_READAHEAD MAX_READAHEAD
+#define MD_READAHEAD vm_max_readahead

static inline int disk_faulty(mdp_disk_t * d)
{
diff -ur linux-orig/include/linux/sysctl.h linux/include/linux/sysctl.h
--- linux-orig/include/linux/sysctl.h Mon Nov 12 23:34:36 2001
+++ linux/include/linux/sysctl.h Mon Nov 12 23:31:21 2001
@@ -139,7 +139,9 @@
VM_PAGECACHE=7, /* struct: Set cache memory thresholds */
VM_PAGERDAEMON=8, /* struct: Control kswapd behaviour */
VM_PGT_CACHE=9, /* struct: Set page table cache parameters */
- VM_PAGE_CLUSTER=10 /* int: set number of pages to swap together */
+ VM_PAGE_CLUSTER=10, /* int: set number of pages to swap together */
+ VM_MIN_READAHEAD=12, /* Min file readahead */
+ VM_MAX_READAHEAD=13 /* Max file readahead */
};


diff -ur linux-orig/kernel/sysctl.c linux/kernel/sysctl.c
--- linux-orig/kernel/sysctl.c Mon Nov 12 23:32:28 2001
+++ linux/kernel/sysctl.c Mon Nov 12 23:31:17 2001
@@ -270,6 +270,10 @@
&pgt_cache_water, 2*sizeof(int), 0644, NULL, &proc_dointvec},
{VM_PAGE_CLUSTER, "page-cluster",
&page_cluster, sizeof(int), 0644, NULL, &proc_dointvec},
+ {VM_MIN_READAHEAD, "min-readahead",
+ &vm_min_readahead,sizeof(int), 0644, NULL, &proc_dointvec},
+ {VM_MAX_READAHEAD, "max-readahead",
+ &vm_max_readahead,sizeof(int), 0644, NULL, &proc_dointvec},
{0}
};

diff -ur linux-orig/mm/filemap.c linux/mm/filemap.c
--- linux-orig/mm/filemap.c Mon Nov 12 23:32:44 2001
+++ linux/mm/filemap.c Mon Nov 12 23:31:21 2001
@@ -47,6 +47,12 @@
unsigned int page_hash_bits;
struct page **page_hash_table;

+int vm_max_readahead = 31;
+int vm_min_readahead = 3;
+EXPORT_SYMBOL(vm_max_readahead);
+EXPORT_SYMBOL(vm_min_readahead);
+
+
spinlock_t pagecache_lock ____cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
/*
* NOTE: to avoid deadlocking you must never acquire the pagemap_lru_lock
@@ -1129,7 +1135,7 @@
static inline int get_max_readahead(struct inode * inode)
{
if (!inode->i_dev || !max_readahead[MAJOR(inode->i_dev)])
- return MAX_READAHEAD;
+ return vm_max_readahead;
return max_readahead[MAJOR(inode->i_dev)][MINOR(inode->i_dev)];
}

@@ -1312,8 +1318,8 @@
if (filp->f_ramax < needed)
filp->f_ramax = needed;

- if (reada_ok && filp->f_ramax < MIN_READAHEAD)
- filp->f_ramax = MIN_READAHEAD;
+ if (reada_ok && filp->f_ramax < vm_min_readahead)
+ filp->f_ramax = vm_min_readahead;
if (filp->f_ramax > max_readahead)
filp->f_ramax = max_readahead;
}
--- linux-orig/drivers/ide/ide-probe.c Mon Nov 12 23:49:38 2001
+++ linux/drivers/ide/ide-probe.c Mon Nov 12 23:50:18 2001
@@ -779,7 +779,7 @@
/* IDE can do up to 128K per request. */
*max_sect++ = 255;
#endif
- *max_ra++ = MAX_READAHEAD;
+ *max_ra++ = vm_max_readahead;
}

for (unit = 0; unit < units; ++unit)
\
 
 \ /
  Last update: 2005-03-22 13:13    [W:0.094 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site