From: Theodore Ts'o <tytso@mit.edu>
To: Zach Brown <zab@zabbo.net>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH 3/6 -v3] libext2fs: add ext2fs_bitcount() function
Date: Tue, 27 Nov 2012 00:16:17 -0500 [thread overview]
Message-ID: <20121127051617.GA7080@thunk.org> (raw)
In-Reply-To: <20121127014505.GB25222@thunk.org>
On Mon, Nov 26, 2012 at 08:45:05PM -0500, Theodore Ts'o wrote:
> I suppose I should first check and see how much difference it makes to
> with a hard-coded use __builtin_popcnt(). If it makes a sufficiently
> large improvement, it's probably worth the hair of implementing the
> fallback machinery.
I did some quick benchmarking, and the difference it makes when
checking 4TB's worth of bitmaps is negligble:
slow popcount: 0.2623
fast popcount: 0.0700
For a 128TB's worth of bitmaps, the time difference is:
slow popcount: 8.0185
fast popcount: 2.2066
I measured running e2fsck on an empty 128TB file system, and that took
202 CPU seconds (assuming all of the fs metadata blocks are in cache),
so with this optimization we would save at most 3%. (For comparison,
using an unmodified 1.42.6 e2fsck, it burned 392.7 CPU seconds.)
My conclusion is that using __builtin_popcnt() is a nice-to-have, and
if someone sends me patches I'll probably take them as a optimization,
but it's not super high priority for me.
- Ted
next prev parent reply other threads:[~2012-11-27 5:16 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-26 16:39 [PATCH 0/6 -v2] Optimize e2fsck for large file systems Theodore Ts'o
2012-11-26 16:39 ` [PATCH 1/6 -v2] libext2fs: optimize rb_set_bmap_range() Theodore Ts'o
2012-11-27 7:16 ` Lukáš Czerner
2012-11-26 16:39 ` [PATCH 2/6 -v2] e2fsck: optimize pass1 for CPU time Theodore Ts'o
2012-11-26 16:39 ` [PATCH 3/6 -v3] libext2fs: add ext2fs_bitcount() function Theodore Ts'o
2012-11-26 23:17 ` Zach Brown
2012-11-27 1:45 ` Theodore Ts'o
2012-11-27 5:16 ` Theodore Ts'o [this message]
2012-11-27 17:50 ` Zach Brown
2012-11-27 19:37 ` Theodore Ts'o
2012-11-27 17:54 ` Zach Brown
2012-11-26 16:39 ` [PATCH 4/6 -v2] libext2fs: optimize rb_get_bmap_range() Theodore Ts'o
2012-11-26 16:39 ` [PATCH 5/6 -v2] libext2fs: optimize rb_get_bmap_range() for mostly allocated bmaps Theodore Ts'o
2012-11-26 16:39 ` [PATCH 6/6 -v2] e2fsck: optimize pass 5 for CPU utilization Theodore Ts'o
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=20121127051617.GA7080@thunk.org \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
--cc=zab@zabbo.net \
/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;
as well as URLs for NNTP newsgroup(s).