File: FAQ

package info (click to toggle)
spew 1.0.7-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,008 kB
  • ctags: 818
  • sloc: cpp: 5,950; sh: 5,523; makefile: 114
file content (51 lines) | stat: -rw-r--r-- 2,152 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
                                Spew FAQ
                                =============

This is the Spew FAQ.  Any suggestions/corrections/etc should be
directed to andrew.patterson@hp.com.  The FAQ answers the following questions:

    1) How do I get direct I/O working on RedHat Advanced Server 2.1?
    2) Who came up with the names "Spew"?
    3) How do I by-pass the buffer or disk cache to find the true 
       performance of a device?


 1) How do I get direct I/O working on RedHat Advanced Server 2.1?

    RHAS 2.1 has support in the kernel for direct I/O to a block device, but
    it is not completely enabled.  Applying the following patch will allow 
    direct I/O to any block device:

--- rhel2.lu3-test/fs/block_dev.c.orig  2004-07-27 16:48:20.000000000 -0600
+++ rhel2.lu3-test/fs/block_dev.c       2004-07-27 16:50:25.000000000 -0600
@@ -668,6 +668,7 @@
        sync_page: block_sync_page,
        prepare_write: blkdev_prepare_write,
        commit_write: blkdev_commit_write,
+       direct_IO: blkdev_direct_IO,    
 };
 
 struct file_operations def_blk_fops = {

  2) Who came up with the name "Spew"?

     Larry Fenske was the author of the original 20-line C version of Spew. 
     He also originated the name.  

  3) How do I by-pass the buffer or disk cache to find the true performance 
     of a device?

     You can use the -s|--synchronous option for writes.  This adds
     the O_SYNC option when the file is opened.  All writes will then
     block until flushed to disk (Note that your device itself may
     still cache).

     Reads are a little more complicated.  The O_SYNC option is
     ignored for reads.  On Linux, you can use spew's -d|--direct
     option which will bypass the buffer cache for both reads and
     writes.  It will also disable read-ahead for reads.  On other
     operating systems (like HP-UX) or old versions of Linux (kernels
     before 2.4.21 or so), you may have to use a special device
     file. On old versions of Linux, you would use raw device files
     (see raw(8)).  On HP-UX, you would use the the /dev/rdsk/* device
     files.  I have no idea what to use on Windows.