]> git.neil.brown.name Git - history.git/commit
[PATCH] readahead fix
authorAndrew Morton <akpm@zip.com.au>
Tue, 30 Apr 2002 06:51:50 +0000 (23:51 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Tue, 30 Apr 2002 06:51:50 +0000 (23:51 -0700)
commit00d6555e3c1568842beef2085045baaae59d347c
tree2a8bd17b14f41e5f58527e8d36f7aa445fba112b
parentd878155c293e65354c2acf653aef60011c4114bb
[PATCH] readahead fix

Changes the way in which the readahead code locates the readahead
setting for the underlying device.

- struct block_device and struct address_space gain a *pointer* to the
  current readahead tunable.

- The tunable lives in the request queue and is altered with the
  traditional ioctl.

- The value gets *copied* into the struct file at open() time.  So a
  fcntl() mode to modify it per-fd is simple.

- Filesystems which are not request_queue-backed get the address of the
  global `default_ra_pages'.  If we want, this can become a tunable.

- Filesystems are at liberty to alter address_space.ra_pages to point
  at some other fs-private default at new_inode/read_inode/alloc_inode
  time.

- The ra_pages pointer can become a structure pointer if, at some time
  in the future, high-level code needs more detailed information about
  device characteristics.

  In fact, it'll need to become a struct pointer for use by
  writeback: my current writeback code has the problem that multiple
  pdflush threads can get stuck on the same request queue.  That's a
  waste of resources.  I currently have a silly flag in the superblock
  to try to avoid this.

  The proper way to get this exclusion is for the high-level
  writeback code to be able to do a test-and-set against a
  per-request_queue flag.  That flag can live in a structure alongside
  ra_pages, conveniently accessible at the pagemap level.

One thing still to-be-done is going into all callers of blk_init_queue
and blk_queue_make_request and making sure that they're setting up a
sensible default.  ATA wants 248 sectors, and floppy drives don't want
128kbytes, I suspect.  Later.
drivers/block/blkpg.c
drivers/block/ll_rw_blk.c
drivers/md/md.c
fs/block_dev.c
fs/inode.c
fs/open.c
include/linux/blkdev.h
include/linux/fs.h
include/linux/mm.h
mm/readahead.c