All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Pekka Enberg <penberg@kernel.org>
Cc: Prasad Joshi <prasadjoshi124@gmail.com>,
	kvm@vger.kernel.org, asias.hejun@gmail.com, gorcunov@gmail.com,
	levinsasha928@gmail.com, chaitanyakulkarni15@gmail.com,
	ashwini.kulkarni@gmail.com
Subject: Re: [PATCH v1 3/3] kvm tools: Add QCOW level2 caching support
Date: Wed, 18 May 2011 13:10:45 +0200	[thread overview]
Message-ID: <20110518111045.GD16556@elte.hu> (raw)
In-Reply-To: <BANLkTikYakE=82Ag=FoaX3VF0=TAUdPbRw@mail.gmail.com>


* Pekka Enberg <penberg@kernel.org> wrote:

> On Wed, May 18, 2011 at 1:17 PM, Prasad Joshi <prasadjoshi124@gmail.com> wrote:
> > QCOW uses two tables level1 (L1) table and level2
> > (L2) table. The L1 table points to offset of L2
> > table. When a QCOW image is probed, the L1 table is
> > cached in the memory to avoid reading it from disk
> > on every reference. This caching imporves the
> > performance. The similar performance improvment can
> > be observed when L2 tables are also cached. It is
> > impossible to cache all of the L2 tables because of
> > the memory constraint. The patch adds L2 table
> > caching capability for upto 128 L2 tables, it uses
> > combination of RB tree and List to manage the L2
> > cached tables. The link list implementation helps
> > in building simple LRU structure and RB tree helps
> > in improving the search time during read/write
> > operations.
> 
> Can you please split that text into more readable paragraphs? The line
> wrapping column seems rather aggressive that's also contributing to
> unreadability.
> 
> > @@ -16,6 +16,153 @@
> >  #include <linux/kernel.h>
> >  #include <linux/types.h>
> >
> > +static inline int insert(struct rb_root *root, struct qcow_l2_cache *new)
> > +{
> > +       struct rb_node **link = &(root->rb_node), *parent = NULL;
> > +       u64 offset = new->offset;
> > +
> > +       /* search the tree */
> > +       while (*link) {
> > +               struct qcow_l2_cache *t;
> > +
> > +               t = rb_entry(*link, struct qcow_l2_cache, node);
> > +               if (!t)
> > +                       goto error;
> > +
> 
> [snip, snip]
> 
> This function and others are way to big to be marked as "inline".

yep - just leave it static and the compiler should be able to sort it out.

If not we'll write a compiler too ;-)

Thanks,

	Ingo

  parent reply	other threads:[~2011-05-18 11:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-18 10:17 [PATCH v1 1/3] kvm tools: Close the disk images after the guest shuts down Prasad Joshi
2011-05-18 10:17 ` [PATCH v1 2/3] kvm tools: Release memoty allocated during virtio block initialization Prasad Joshi
2011-05-18 10:25   ` Pekka Enberg
2011-05-18 11:11   ` Ingo Molnar
2011-05-18 10:17 ` [PATCH v1 3/3] kvm tools: Add QCOW level2 caching support Prasad Joshi
2011-05-18 10:27   ` Pekka Enberg
2011-05-18 10:41     ` Prasad Joshi
2011-05-18 11:18       ` Pekka Enberg
2011-05-18 11:10     ` Ingo Molnar [this message]
2011-05-18 11:27   ` Sasha Levin
2011-05-18 10:31 ` [PATCH v1 1/3] kvm tools: Close the disk images after the guest shuts down Sasha Levin
2011-05-18 10:36   ` Prasad Joshi
2011-05-18 11:15 ` 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=20110518111045.GD16556@elte.hu \
    --to=mingo@elte.hu \
    --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 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.