From: Ingo Molnar <mingo@elte.hu>
To: Prasad Joshi <prasadjoshi124@gmail.com>
Cc: kvm@vger.kernel.org, penberg@kernel.org, asias.hejun@gmail.com,
gorcunov@gmail.com, levinsasha928@gmail.com,
chaitanyakulkarni15@gmail.com, ashwini.kulkarni@gmail.com,
anup shendkar <anupshendkar@gmail.com>
Subject: Re: [PATCH v2] kvm tools: Add QCOW level2 caching support
Date: Thu, 2 Jun 2011 10:57:29 +0200 [thread overview]
Message-ID: <20110602085729.GA7800@elte.hu> (raw)
In-Reply-To: <BANLkTimTyEgB3vugjbUXVw0V4BziehN1-g@mail.gmail.com>
* Prasad Joshi <prasadjoshi124@gmail.com> wrote:
> I am not sure how to induce the delay you mentioned. [...]
In the simplest version just add:
if (debug__io_delay)
udelay(1000);
to the code that does a read() from the disk image. This will
introduce a 1 msec delay - that should be plenty enough to simulate
most effects of IO delays.
Later on you could complicate it with some disk geometry
approximation:
delay = read_size_in_kb; /* 1 usec per KB read */
delay += seek_distance_in_kb; /* 1 usec per KB disk-head movement */
udelay(delay);
Where 'read_size_in_kb' is the number of bytes read in KB, while
seek_distance_in_kb measures the position of the the last byte read
by the previous read() call to the first byte of the current read().
( Also, instead of copying the disk image to /dev/shm you could add a
debug switch to mmap() and mlock() it directly. Assuming there's enough
RAM in the box. )
But i'd strongly suggest to keep the initial version simple.
Thanks,
Ingo
next prev parent reply other threads:[~2011-06-02 8:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-01 19:26 [PATCH v2] kvm tools: Add QCOW level2 caching support Prasad Joshi
2011-06-02 7:28 ` Ingo Molnar
2011-06-02 8:36 ` Prasad Joshi
2011-06-02 8:57 ` Ingo Molnar [this message]
2011-06-02 16:59 ` Prasad Joshi
2011-06-02 9:16 ` Ingo Molnar
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=20110602085729.GA7800@elte.hu \
--to=mingo@elte.hu \
--cc=anupshendkar@gmail.com \
--cc=ashwini.kulkarni@gmail.com \
--cc=asias.hejun@gmail.com \
--cc=chaitanyakulkarni15@gmail.com \
--cc=gorcunov@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=levinsasha928@gmail.com \
--cc=penberg@kernel.org \
--cc=prasadjoshi124@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox