tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [RFC] getgroups2 system call



On Wed, Dec 14, 2011 at 07:04:06AM +0100, Emmanuel Dreyfus wrote:
> I explored the option of modifying the FUSE protocol, and that is
> though. We can easily negociate an extended FUSE header that contains
> secondary groups, and I already submitted a patch that does exactly
> that, but then we face two conflicting requirements:
> 
> - a fixed lentgh header is highly desirable for performance
> optimization. For instance glusterfs fetches the header and the data
> using readv(2) with an iovec that has two slots. That way it gets write
> date aligned on a page boundary.
> 
> - a fixed length header means an array of secondary groups with
> NGROUPS_MAX slots, but Linux's NGROUPS_MAX is 65536, which means an
> insane waste of space. Therefore we need an array of secondary groups
> that is not bigger than the used slots.
> 
> As a tradeoff between the two requirements, I proposed that the
> filesystem could request a minimum size for secondary group array. That
> way, the header would be of fixed length most of the time, except when
> there are many groups (something that can only happen on Linux: NetBSD's
> NGROUPS_MAX is much more reasonable). Big amount of secondary groups

Ours is 16, which seems more like ridiculously limiting, rather than
"reasonable".  For instance, on one of the (Linux) machines at work
I'm in 22 different groups, and other people are in many more.  
Whatever solution is found for the FUSE problem, IMO it should be able
to efficiently handle at least a few dozen groups.

I know approximately nothing about the FUSE protocol, but would it to be
feasible to keep a fixed length header with a flag that says extra groups
can be found in the payload of the message, either before or after the regular
payload?

eric


Home | Main Index | Thread Index | Old Index