round read ahead change
PATCH 1/1 round read ahead change
Round read_ahead more intelligently and print warning.
Round reah ahead at least to one page up. Print warning instead of verbose message. Fix printed page in KB, sector value is confusing.
[why we are rounding it to pagesize at all?
it is kernel who should optimize reads and align them to pages]
Signed-off-by Milan Broz <[email protected]>
--- tools/lvchange.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-)
tools/lvchange.c +6 -3
@@ -370,9 +370,12 @@ static int lvchange_readahead(struct cmd_context *cmd,if (read_ahead !=DM_READ_AHEAD_AUTO && read_ahead !=DM_READ_AHEAD_NONE && read_ahead % pagesize) { - read_ahead = (read_ahead / pagesize) * pagesize; -log_verbose ("Rounding down readahead to %u sectors, a multiple " -"of page size %u." , read_ahead, pagesize); +if (read_ahead < pagesize) + read_ahead = pagesize; +else + read_ahead = (read_ahead / pagesize) * pagesize; +log_warn ("WARNING: Overriding readahead to %u sectors, a multiple " +"of %uK page size." , read_ahead, pagesize >>1 ); }if (lv->read_ahead == read_ahead) {
PATCH 1/1 round read ahead change
Quoted 1 line · Milan Broz
Round
read_aheadmore intelligently and print warning.
Ack.
Alasdair