The patch titled readahead nfsd case: fix uninitialized ra_min/ra_max has been added to the -mm tree. Its filename is readahead-nfsd-case-fix-uninitialized-ra_min-ra_max.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: readahead nfsd case: fix uninitialized ra_min/ra_max From: Fengguang Wu <wfg@xxxxxxxxxxxxxxxx> ra_min/ra_max are not initialized, fix it. New benchmark numbers on hda: ST3250820A, ATA DISK drive hda: max request size: 512KiB hda: 488397168 sectors (250059 MB) w/8192KiB Cache, CHS=30401/255/63, UDMA(100) with nfs mount mount -o tcp,rsize=$((rsize<<10)) localhost:$EXPORT $MNT rsize stock adaptive ================================== f 8k 3.07 2.51 -18.2% 32k 2.40 2.17 -9.6% 128k 2.40 2.35 -2.1% ff 8k 12.44 6.40 -48.6% 32k 14.62 5.46 -62.7% 128k 15.79 5.19 -67.1% d 8k 2.84 2.48 -12.7% 32k 2.53 1.99 -21.3% 128k 2.18 2.00 -8.3% dd 8k 8.16 7.99 -2.1% 32k 8.27 6.88 -16.8% 128k 7.75 6.97 -10.1% The 4 patterns tested are: f: single file read ff: double file parallel read d: single dir read dd: double dir parallel read Signed-off-by: Fengguang Wu <wfg@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- mm/readahead.c | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-) diff -puN mm/readahead.c~readahead-nfsd-case-fix-uninitialized-ra_min-ra_max mm/readahead.c --- a/mm/readahead.c~readahead-nfsd-case-fix-uninitialized-ra_min-ra_max +++ a/mm/readahead.c @@ -1617,6 +1617,10 @@ page_cache_readahead_adaptive(struct add unsigned long ra_max; int ret; + /* no read-ahead */ + if (!ra->ra_pages) + return 0; + if (page) { ClearPageReadahead(page); @@ -1636,9 +1640,6 @@ page_cache_readahead_adaptive(struct add offset + LAPTOP_POLL_INTERVAL)) return 0; } - } else if (ra->flags & RA_FLAG_NFSD) { /* nfsd read */ - ra_size = max_sane_readahead(req_size); - goto readit; } if (page) @@ -1648,11 +1649,13 @@ page_cache_readahead_adaptive(struct add get_readahead_bounds(ra, &ra_min, &ra_max); - /* read-ahead disabled? */ - if (unlikely(!ra_max || !readahead_ratio)) { - ra_size = max_sane_readahead(req_size); + /* read as is */ + if (!readahead_ratio) + goto readit; + + /* nfsd read */ + if (!page && (ra->flags & RA_FLAG_NFSD)) goto readit; - } /* * Start of file. @@ -1699,11 +1702,11 @@ page_cache_readahead_adaptive(struct add return 0; } +readit: /* * Random read. */ ra_size = min(req_size, ra_max); -readit: ra_size = __do_page_cache_readahead(mapping, filp, offset, ra_size, 0); ra_account(ra, RA_EVENT_RANDOM_READ, ra_size); _ Patches currently in -mm which might be from wfg@xxxxxxxxxxxxxxxx are readahead-kconfig-options.patch readahead-kconfig-options-fix.patch radixtree-introduce-scan-hole-data-functions.patch mm-introduce-probe_page.patch mm-introduce-pg_readahead.patch readahead-add-look-ahead-support-to-__do_page_cache_readahead.patch readahead-insert-cond_resched-calls.patch readahead-minmax_ra_pages.patch readahead-events-accounting.patch readahead-events-accounting-make-readahead_debug_level-static.patch readahead-rescue_pages.patch readahead-sysctl-parameters.patch readahead-sysctl-parameters-use-ctl_unnumbered.patch readahead-sysctl-parameters-fix.patch readahead-min-max-sizes.patch readahead-state-based-method-aging-accounting.patch readahead-state-based-method-routines.patch readahead-state-based-method.patch readahead-context-based-method.patch readahead-context-based-method-locking-fix.patch readahead-context-based-method-locking-fix-2.patch readahead-initial-method-guiding-sizes.patch readahead-initial-method-thrashing-guard-size.patch readahead-initial-method-user-recommended-size.patch readahead-initial-method.patch readahead-backward-prefetching-method.patch readahead-thrashing-recovery-method.patch readahead-call-scheme.patch readahead-call-scheme-ifdef-fix.patch readahead-call-scheme-build-fix.patch readahead-laptop-mode.patch readahead-loop-case.patch readahead-nfsd-case.patch readahead-nfsd-case-fix.patch readahead-nfsd-case-fix-uninitialized-ra_min-ra_max.patch readahead-turn-on-by-default.patch readahead-remove-size-limit-on-read_ahead_kb.patch readahead-remove-size-limit-of-max_sectors_kb-on-read_ahead_kb.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html