From: Wu Fengguang <wfg@mail.ustc.edu.cn>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org, Wu Fengguang <wfg@mail.ustc.edu.cn>
Subject: [PATCH 5/5] readahead: remove size limit on read_ahead_kb
Date: Fri, 09 Jun 2006 16:08:06 +0800 [thread overview]
Message-ID: <349840680.23742@ustc.edu.cn> (raw)
Message-ID: <20060609081121.002572642@localhost.localdomain> (raw)
In-Reply-To: 20060609080801.741901069@localhost.localdomain
[-- Attachment #1: readahead-max-kb-sysfs-simplify.patch --]
[-- Type: text/plain, Size: 1389 bytes --]
Remove the unnecessary size limit on setting read_ahead_kb.
Also make possible large values harmless. The stock readahead
is protected by always consulting the avaiable memory before
applying this number. Other readahead paths have already did so.
read_ahead_kb used to be guarded by the queue's max_sectors,
which can be too rigid because some devices set max_sectors to
small values like 64kb. That leads to many user complains.
Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn>
---
block/ll_rw_blk.c | 5 -----
1 files changed, 5 deletions(-)
--- linux-2.6.17-rc6-mm1.orig/block/ll_rw_blk.c
+++ linux-2.6.17-rc6-mm1/block/ll_rw_blk.c
@@ -3810,12 +3810,7 @@ queue_ra_store(struct request_queue *q,
unsigned long ra_kb;
ssize_t ret = queue_var_store(&ra_kb, page, count);
- spin_lock_irq(q->queue_lock);
- if (ra_kb > (q->max_sectors >> 1))
- ra_kb = (q->max_sectors >> 1);
-
q->backing_dev_info.ra_pages = ra_kb >> (PAGE_CACHE_SHIFT - 10);
- spin_unlock_irq(q->queue_lock);
return ret;
}
--- linux-2.6.17-rc6-mm1.orig/mm/readahead.c
+++ linux-2.6.17-rc6-mm1/mm/readahead.c
@@ -156,7 +156,7 @@ EXPORT_SYMBOL_GPL(file_ra_state_init);
*/
static inline unsigned long get_max_readahead(struct file_ra_state *ra)
{
- return ra->ra_pages;
+ return max_sane_readahead(ra->ra_pages);
}
static inline unsigned long get_min_readahead(struct file_ra_state *ra)
--
prev parent reply other threads:[~2006-06-09 8:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20060609080801.741901069@localhost.localdomain>
2006-06-09 8:08 ` [PATCH 0/5] Adaptive readahead updates 2 Wu Fengguang
[not found] ` <20060609081119.231751179@localhost.localdomain>
2006-06-09 8:08 ` [PATCH 1/5] readahead: no RA_FLAG_EOF on single page file Wu Fengguang
[not found] ` <20060609081120.054527393@localhost.localdomain>
2006-06-09 8:08 ` [PATCH 3/5] readahead: call scheme - no fastcall for readahead_cache_hit() Wu Fengguang
[not found] ` <20060609081120.531013274@localhost.localdomain>
2006-06-09 8:08 ` [PATCH 4/5] readahead: backoff on I/O error Wu Fengguang
2006-06-10 18:33 ` Ingo Oeser
2006-06-10 19:48 ` Michael Tokarev
[not found] ` <20060612011245.GA5214@mail.ustc.edu.cn>
2006-06-12 1:12 ` Wu Fengguang
2006-06-12 3:43 ` Andrew Morton
2006-06-12 11:06 ` Michael Tokarev
2006-06-17 6:38 ` Michael Tokarev
2006-06-17 7:00 ` Michael Tokarev
[not found] ` <20060609081121.002572642@localhost.localdomain>
2006-06-09 8:08 ` Wu Fengguang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=349840680.23742@ustc.edu.cn \
--to=wfg@mail.ustc.edu.cn \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox