Dear Ian,
On 24.05.19 01:16, Ian Kent wrote:
On Thu, 2019-05-23 at 17:22 -0300, Andreas Hasenack wrote:
Hi,
I'm updating the autofs version in Ubuntu from 5.1.2 to 5.1.5, and as
part of that process was looking over the patches we are carrying. I
found this one:
Author: Joel Ebel <jbebel@xxxxxxxxxx>
Bug-Ubuntu: https://launchpad.net/bugs/591100
Description: Increase group buffer size geometrically rather than
linearly when its found to be small.
.
This prevents package to eat the cpu if you have large groups.
--- a/lib/mounts.c
+++ b/lib/mounts.c
@@ -1245,7 +1245,7 @@
status = getgrgid_r(gid, pgr, gr_tmp, tmplen, ppgr);
if (status != ERANGE)
break;
- tmplen += grplen;
+ tmplen *= 2;
}
if (status || !pgr) {
That came from https://bugs.launchpad.net/ubuntu/+source/autofs5/+bug/591100,
and the intention is to speed up the scenario where a user belongs to
thousands of groups. grplen is 1024, and looping over getgrgid_r()
hundreds of times took a while of high CPU usage.
The patch doesn't apply cleanly anymore, but the tmplen+=grplen code
is still there. Would upstream be interested in adopting this change,
or something like it?
Sure, I've added the patch below to my patch queue, it will get
committed at some point.
You might also be interested in checking if anything at
https://mirrors.edge.kernel.org/pub/linux/daemons/autofs/v5/patches-5.1.6/
might be needed.
I have more patches, I'll post them for review on the autofs list
before committing them, some of those might be of interest to you
too.
If you run into problems ask here and I'll try and help out.
autofs-5.1.5 - Increase group buffer size geometrically
Andreas, thank you for pushing this upstream, and Ian, thank you for
picking it up so quickly.
From: Joel Ebel <jbebel@xxxxxxxxxx>
Increase group buffer size geometrically rather than linearly
when its found to be small.
This prevents package to eat the cpu if you have large groups.
Could you please reference the bug report in the commit message, and
even use Andreas’ summary as the message?
[…]
Kind regards,
Paul