From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wu Fengguang Subject: [PATCH 06/16] readahead: add notes on readahead size Date: Mon, 01 Mar 2010 13:26:57 +0800 Message-ID: <20100301053621.102557225@intel.com> References: <20100301052651.857984880@intel.com> Cc: Jens Axboe , Matt Mackall , Christian Ehrhardt , Rik van Riel , Wu Fengguang To: Andrew Morton Return-path: CC: Chris Mason CC: Peter Zijlstra CC: Clemens Ladisch CC: Olivier Galibert cc: Vivek Goyal CC: Nick Piggin cc: Linux Memory Management List CC: Cc: LKML Content-Disposition: inline; filename=readahead-size-comment.patch Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org Basically, currently the default max readahead size - is 512k - is boot time configurable with "readahead=" and is auto scaled down: - for small devices - for small memory systems (read-around size alone) CC: Matt Mackall CC: Christian Ehrhardt Acked-by: Rik van Riel Signed-off-by: Wu Fengguang --- mm/readahead.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) --- linux.orig/mm/readahead.c 2010-02-26 10:11:41.000000000 +0800 +++ linux/mm/readahead.c 2010-02-26 10:11:55.000000000 +0800 @@ -7,6 +7,28 @@ * Initial version. */ +/* + * Notes on readahead size. + * + * The default max readahead size is VM_MAX_READAHEAD=512k, + * which can be changed by user with boot time parameter "readahead=" + * or runtime interface "/sys/devices/virtual/bdi/default/read_ahead_kb". + * The latter normally only takes effect in future for hot added devices. + * + * The effective max readahead size for each block device can be accessed with + * 1) the `blockdev` command + * 2) /sys/block/sda/queue/read_ahead_kb + * 3) /sys/devices/virtual/bdi/$(env stat -c '%t:%T' /dev/sda)/read_ahead_kb + * + * They are typically initialized with the global default size, however may be + * auto scaled down for small devices in add_disk(). NFS, software RAID, btrfs + * etc. have special rules to setup their default readahead size. + * + * The mmap read-around size typically equals with readahead size, with an + * extra limit proportional to system memory size. For example, a 64MB box + * will have a 64KB read-around size limit, 128MB mem => 128KB limit, etc. + */ + #include #include #include -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org