All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org
Cc: Qemu-block <qemu-block@nongnu.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Daniel P . Berrangé" <berrange@redhat.com>,
	"Greg Kurz" <groug@kaod.org>,
	"Linus Heckemann" <git@sphalerite.org>
Subject: Re: [PATCH v3] 9pfs: use GHashTable for fid table
Date: Fri, 09 Sep 2022 15:10:48 +0200	[thread overview]
Message-ID: <1948479.BV7xhjtDqn@silver> (raw)
In-Reply-To: <20220908112353.289267-1-git@sphalerite.org>

On Donnerstag, 8. September 2022 13:23:53 CEST Linus Heckemann wrote:
> The previous implementation would iterate over the fid table for
> lookup operations, resulting in an operation with O(n) complexity on
> the number of open files and poor cache locality -- for every open,
> stat, read, write, etc operation.
> 
> This change uses a hashtable for this instead, significantly improving
> the performance of the 9p filesystem. The runtime of NixOS's simple
> installer test, which copies ~122k files totalling ~1.8GiB from 9p,
> decreased by a factor of about 10.
> 
> Signed-off-by: Linus Heckemann <git@sphalerite.org>
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Reviewed-by: Greg Kurz <groug@kaod.org>
> ---

Queued on 9p.next:
https://github.com/cschoenebeck/qemu/commits/9p.next

I retained the BUG_ON() in get_fid(), Greg had a point there that continuing 
to work on a clunked fid would still be a bug.

I also added the suggested TODO comment for g_hash_table_steal_extended(), the 
actual change would be outside the scope of this patch.

And finally I gave this patch a whirl, and what can I say: that's just sick! 
Compiling sources with 9p is boosted by around factor 6..7 here! And running 
9p as root fs also no longer feels sluggish as before. I mean I knew that this 
fid list traversal performance issue existed and had it on my TODO list, but 
the actual impact exceeded my expectation by far.

Thanks!

Best regards,
Christian Schoenebeck




  parent reply	other threads:[~2022-09-09 13:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 11:23 [PATCH v3] 9pfs: use GHashTable for fid table Linus Heckemann
2022-09-08 12:18 ` Greg Kurz
2022-09-08 16:10   ` Linus Heckemann
2022-09-08 16:14     ` Greg Kurz
2022-09-09 13:10 ` Christian Schoenebeck [this message]
2022-09-19 17:34   ` Christian Schoenebeck
2022-09-22 11:43     ` Linus Heckemann
2022-09-22 13:24       ` Christian Schoenebeck

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=1948479.BV7xhjtDqn@silver \
    --to=qemu_oss@crudebyte.com \
    --cc=berrange@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=git@sphalerite.org \
    --cc=groug@kaod.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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.