public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: "Theodore Tso" <tytso@mit.edu>
To: Guan-Chun Wu <409411716@gms.tku.edu.tw>
Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org,
	linux-kernel@vger.kernel.org, visitorckw@gmail.com,
	david.laight.linux@gmail.com
Subject: Re: [PATCH v2] ext4: improve str2hashbuf by processing 4-byte chunks and removing function pointers
Date: Thu, 9 Apr 2026 10:10:50 -0400	[thread overview]
Message-ID: <20260409141050.GA59468@macsyma-wired.lan> (raw)
In-Reply-To: <20251122043929.1908643-1-409411716@gms.tku.edu.tw>

On Sat, Nov 22, 2025 at 12:39:29PM +0800, Guan-Chun Wu wrote:
> The original byte-by-byte implementation with modulo checks is less
> efficient. Refactor str2hashbuf_unsigned() and str2hashbuf_signed()
> to process input in explicit 4-byte chunks instead of using a
> modulus-based loop to emit words byte by byte.
> 
> Additionally, the use of function pointers for selecting the appropriate
> str2hashbuf implementation has been removed. Instead, the functions are
> directly invoked based on the hash type, eliminating the overhead of
> dynamic function calls.
> 
> Performance test (x86_64, Intel Core i7-10700 @ 2.90GHz, average over 10000
> runs, using kernel module for testing):
> 
>     len | orig_s | new_s | orig_u | new_u
>     ----+--------+-------+--------+-------
>       1 |   70   |   71  |   63   |   63
>       8 |   68   |   64  |   64   |   62
>      32 |   75   |   70  |   75   |   63
>      64 |   96   |   71  |  100   |   68
>     255 |  192   |  108  |  187   |   84
> 
> This change improves performance, especially for larger input sizes.
> 
> Signed-off-by: Guan-Chun Wu <409411716@gms.tku.edu.tw>

Apologies for the delay in looking at this.  It fell through the
cracks on my end.

Because of how I'm a bit late with reviewing patches before the merge
window, I'm going to be very conservative in which patches I'm going
to land.  So this is going to be deferred until the next cycle, but I
wanted to let you know that I haven't forgotten about it.

If this was a comprehensive set of Kunit tests for fs/ext4/hash.c, I
might have taken it.  And that's something that I would look at adding
for the next cycle, but if you'd be interested in creating the kunit
tests for hash.c, that would be great.

						- Ted

      reply	other threads:[~2026-04-09 14:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-22  4:39 [PATCH v2] ext4: improve str2hashbuf by processing 4-byte chunks and removing function pointers Guan-Chun Wu
2026-04-09 14:10 ` Theodore Tso [this message]

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=20260409141050.GA59468@macsyma-wired.lan \
    --to=tytso@mit.edu \
    --cc=409411716@gms.tku.edu.tw \
    --cc=adilger.kernel@dilger.ca \
    --cc=david.laight.linux@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=visitorckw@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