lkml.org 
[lkml]   [2006]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 18/33] readahead: initial method - guiding sizes
Introduce three guiding sizes for the initial readahead method.
- ra_pages0: recommended readahead on start-of-file
- ra_expect_bytes: expected read size on start-of-file
- ra_thrash_bytes: estimated thrashing threshold

Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn>
---


block/ll_rw_blk.c | 4 +---
include/linux/backing-dev.h | 3 +++
mm/readahead.c | 3 +++
3 files changed, 7 insertions(+), 3 deletions(-)

--- linux-2.6.17-rc4-mm3.orig/include/linux/backing-dev.h
+++ linux-2.6.17-rc4-mm3/include/linux/backing-dev.h
@@ -24,6 +24,9 @@ typedef int (congested_fn)(void *, int);

struct backing_dev_info {
unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */
+ unsigned long ra_pages0; /* recommended readahead on start of file */
+ unsigned long ra_expect_bytes; /* expected read size on start of file */
+ unsigned long ra_thrash_bytes; /* thrashing threshold */
unsigned long state; /* Always use atomic bitops on this */
unsigned int capabilities; /* Device capabilities */
congested_fn *congested_fn; /* Function pointer if device is md/dm */
--- linux-2.6.17-rc4-mm3.orig/mm/readahead.c
+++ linux-2.6.17-rc4-mm3/mm/readahead.c
@@ -116,6 +116,9 @@ EXPORT_SYMBOL(default_unplug_io_fn);

struct backing_dev_info default_backing_dev_info = {
.ra_pages = MAX_RA_PAGES,
+ .ra_pages0 = (128*1024) / PAGE_CACHE_SIZE,
+ .ra_expect_bytes = VM_MIN_READAHEAD*1024,
+ .ra_thrash_bytes = VM_MIN_READAHEAD*1024,
.state = 0,
.capabilities = BDI_CAP_MAP_COPY,
.unplug_io_fn = default_unplug_io_fn,
--- linux-2.6.17-rc4-mm3.orig/block/ll_rw_blk.c
+++ linux-2.6.17-rc4-mm3/block/ll_rw_blk.c
@@ -249,9 +249,6 @@ void blk_queue_make_request(request_queu
blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS);
blk_queue_max_hw_segments(q, MAX_HW_SEGMENTS);
q->make_request_fn = mfn;
- q->backing_dev_info.ra_pages = (VM_MAX_READAHEAD * 1024) / PAGE_CACHE_SIZE;
- q->backing_dev_info.state = 0;
- q->backing_dev_info.capabilities = BDI_CAP_MAP_COPY;
blk_queue_max_sectors(q, SAFE_MAX_SECTORS);
blk_queue_hardsect_size(q, 512);
blk_queue_dma_alignment(q, 511);
@@ -1850,6 +1847,7 @@ request_queue_t *blk_alloc_queue_node(gf
q->kobj.ktype = &queue_ktype;
kobject_init(&q->kobj);

+ q->backing_dev_info = default_backing_dev_info;
q->backing_dev_info.unplug_io_fn = blk_backing_dev_unplug;
q->backing_dev_info.unplug_io_data = q;

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-05-26 14:03    [W:0.154 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site