From: Collin Funk <collin.funk1@gmail.com>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] groups: Use bsearch instead of hand rolled implementation
Date: Mon, 26 May 2025 10:46:03 -0700 [thread overview]
Message-ID: <87jz63jmec.fsf@gmail.com> (raw)
In-Reply-To: <20250526002519.GX2023217@ZenIV>
Hi Al,
Al Viro <viro@zeniv.linux.org.uk> writes:
> Careful - that really needs profiling with setups where processes have
> a bunch of supplementary groups.
>
> It *is* on hot paths, and while the current version will be inlined,
> yours will do a bunch of indirect calls. These days that can be
> costly.
Sure, makes sense.
I would assume that gid_cmp/gid_lt/gid_gt all get inlined no matter
what, but I am not sure if the conversion to 'grp' to a void pointer for
the generic bsearch prevents some optimizations.
> Reducing code duplication is a good thing, but not when it creates
> measurable regressions...
Yes, that makes sense.
There is '__inline_bsearch', but I'll have to do some expirementing to
make sure that gets optimized well.
Thanks,
Collin
prev parent reply other threads:[~2025-05-26 17:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-26 0:17 [PATCH] groups: Use bsearch instead of hand rolled implementation Collin Funk
2025-05-26 0:25 ` Al Viro
2025-05-26 17:46 ` Collin Funk [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=87jz63jmec.fsf@gmail.com \
--to=collin.funk1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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.