[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87jz63jmec.fsf@gmail.com>
Date: Mon, 26 May 2025 10:46:03 -0700
From: Collin Funk <collin.funk1@...il.com>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] groups: Use bsearch instead of hand rolled implementation
Hi Al,
Al Viro <viro@...iv.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
Powered by blists - more mailing lists