[comp.unix.wizards] What are the ramifications of increasing NGROUPS?

karl@triceratops.cis.ohio-state.edu (Karl Kleinpaste) (09/03/88)

I have a small research project in mind which will require the
possibility for much larger NGROUPS values on my systems than seem
typical.  Currently, I am looking at Suns, HPs, Pyramids, and Encore
MultiMaxen (Umax, not Mach) for this; the Suns and Multimax have
NGROUPS #defined as 8, whereas the HPs and Pyramids use 20.

I am inclined to send NGROUPS up quite a ways, possibly to 100 or
higher.  If one assumes that I have all sources to everything required
(not yet a true statement; but by the time I get around to doing
something about this, it should be), am I doing the necessary and
sufficient thing by merely editing <sys/param.h> and recompiling The
World?  Can I get away with recompiling just the kernel and
/bin/login?

I have never examined the implementation of BSD's multiple groups
concept closely; this is my first serious approach to this area.

--Karl

ekrell@hector.UUCP (Eduardo Krell) (09/03/88)

In article <21258@tut.cis.ohio-state.edu> karl@triceratops.cis.ohio-state.edu (Karl Kleinpaste) writes:

>I am inclined to send NGROUPS up quite a ways, possibly to 100 or
>higher.
>Can I get away with recompiling just the kernel and
>/bin/login?

I don't think so since the groups are kept in the user structure.
You would have to recompile anything that depends on the size of the user
structure.

>I have never examined the implementation of BSD's multiple groups
>concept closely; this is my first serious approach to this area.

You should consider the fact that it's just an array that gets searched
lineary. Linear search is OK with 8 or 20 groups, but 100?
    
Eduardo Krell                   AT&T Bell Laboratories, Murray Hill, NJ

UUCP: {att,decvax,ucbvax}!ulysses!ekrell  Internet: ekrell@ulysses.att.com

larry@hcr.UUCP (Larry Philps) (09/08/88)

In article <10573@ulysses.homer.nj.att.com> ekrell@hector.UUCP (Eduardo Krell) writes:
>In article <21258@tut.cis.ohio-state.edu> karl@triceratops.cis.ohio-state.edu (Karl Kleinpaste) writes:
>
>>I am inclined to send NGROUPS up quite a ways, possibly to 100 or higher.
>>Can I get away with recompiling just the kernel and /bin/login?
>
>I don't think so since the groups are kept in the user structure.  You would
>have to recompile anything that depends on the size of the user structure.
>
>You should consider the fact that it's just an array that gets searched
>lineary. Linear search is OK with 8 or 20 groups, but 100?
>    
>Eduardo Krell                   AT&T Bell Laboratories, Murray Hill, NJ

One other consideration is that by increasing the size of your u-block by any
significant amount you will decrease the size of your per-process kernel
stack.  You should check the size of both the old and new user blocks, and if
the new one crosses a page boundary that the old one did not, then increase
UPAGES by 1 as well in machine/machparam.h.  If you don't you may start start
getting random "kernel stack invalid" panics.

One more point, I increased USIZE once and the kernel Makefile did not contain
a dependency on machparam.h for assym.s.  Thus genassym.c did not get compiled
and run, and thus my locore.o did not agreed with the rest of the kernel on the
structure of the user block, and amazingly enough things stopped working.
Watch out!

Larry Philps                             HCR Corporation
130 Bloor St. West, 10th floor           Toronto, Ontario.  M5S 1N5
(416) 922-1937                           {utzoo,utcsri,decvax,ihnp4}!hcr!larry