Re: RFC: Dynamic group limit

Frank van Maarseveen (F.vanMaarseveen@inter.NL.net)
Tue, 27 Jul 1999 21:40:19 +0200


On Tue, Jul 27, 1999 at 10:36:49AM +0200, Mattias.Gronlund wrote:
> The proposal is to add a sysctl parameter kernel/ngroups_max that
> is used as the maximum number of groups that a user can be member
> of at once. The ngroup variable and group array are removed from
> the task_struct and a pointer to a new groups_struct is added.
IMO it is better to make the limit really dynamic: not all
processes need the same number of groups. The size of a groups
array might vary, even during the lifetime of a process.

That would eliminate the need for a sysctl.

At my company we've set NGROUPS_MAX to 256 and adadpted the NFS
client code to handle >16 groups. I guess that adding 256*sizeof(gid_t)
to the struct task_struct (i.e. 0.5/1.0 Kb increase for every process) is
not a big memory issue when looking at the average size of a
process. However, this becomes interesting if you want to use
a really *large* number of groups, say 100K or more. Now memory
will be an issue and looking up a group id in the group list becomes
an additional performance problem (see in_group_p() in kernel/sys.c:
might want to use a hash table or a binary tree there).

So, for (let's say) <1000 groups a #define will do but otherwise a
whole new implementation will be necessary.

-- 
Frank van Maarseveen                               Driebergen
f.vanmaarseveen@inter.nl.net                  The Netherlands
-------------------------------------------------------------

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/