All of lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] round read ahead change
Date: Sat, 06 Jun 2009 18:49:04 +0200	[thread overview]
Message-ID: <4A2A9E00.40408@redhat.com> (raw)

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 <mbroz@redhat.com>
---
 tools/lvchange.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/lvchange.c b/tools/lvchange.c
index 10795e3..5abb6e5 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -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) {




             reply	other threads:[~2009-06-06 16:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-06 16:49 Milan Broz [this message]
2009-06-06 21:09 ` [PATCH] round read ahead change Alasdair G Kergon

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=4A2A9E00.40408@redhat.com \
    --to=mbroz@redhat.com \
    --cc=lvm-devel@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.