2001-11-15 15:29:15

by Jackie Meese

[permalink] [raw]
Subject: 32 Groups Maximum in 2.4

I'm not subscribed, so please cc: me on any replies.

I've been looking for some time on how to raise the maximum number of
groups for the 2.4 kernel. I've discovered how to do this kernel, with
a discussion a few months ago on this
list.http://www.cs.helsinki.fi/linux/linux-kernel/2001-13/0807.html

However the follow up of "You gotta change the task struct..." means
nothing to me.

Can someone be more specific as to the changes that need to be made to
accomplish this? Change the task struct where? I can find lots of
references to task_struct in the sources simply by grepping them, but I
can't since any that point to a 32 limit. I'm not a kernel hacker, but
I've read and edited a fair bit of source code in my time, so I thik I
just need a bit more of a clue in here.

TIA,
j.
--
Jackie Meese Institute for Distance and Distributed Learning, Va Tech
Phone: 231-3682 3027 Torgersen Hall MailCode:0445 http://www.iddl.vt.edu/
Education is the change in behavior that occurs as the result of
interaction with events in ones environment.


2001-11-15 15:41:55

by Tommy Reynolds

[permalink] [raw]
Subject: Re: 32 Groups Maximum in 2.4

It was a dark and stormy night. Suddenly
"Jackie Meese" <[email protected]> began to type furiously:

> I've been looking for some time on how to raise the maximum number of
> groups for the 2.4 kernel. I've discovered how to do this kernel, with
> a discussion a few months ago on this
> list.http://www.cs.helsinki.fi/linux/linux-kernel/2001-13/0807.html
>
> However the follow up of "You gotta change the task struct..." means
> nothing to me.
>
> Can someone be more specific as to the changes that need to be made to
> accomplish this? Change the task struct where? I can find lots of
> references to task_struct in the sources simply by grepping them, but I
> can't since any that point to a 32 limit. I'm not a kernel hacker, but
> I've read and edited a fair bit of source code in my time, so I thik I
> just need a bit more of a clue in here.

Look at the file "include/asm-<proc>/param.h to find the symbol "NGROUPS".
Change that to whatever value you like.

The "task_struct" is the per-process descriptor. You can find it in
"/usr/src/linux/include/linux/sched.h", but you shouldn't need to change
anything there.

Once you've changed "NGROUPS", then "make clean oldconfig dep bzImage modules"
as usual. That will change the kernel's idea how how many groups you can have.
You will probably need to recompile the userland stuff, from LIBC to the shells
because "NGROUPS" can be pervasive.

Your mileage may vary.

---------------------------------------------+-----------------------------
Tommy Reynolds | mailto: <[email protected]>
Red Hat, Inc., Embedded Development Services | Phone: +1.256.704.9286
307 Wynn Drive NW, Huntsville, AL 35805 USA | FAX: +1.256.837.3839
Senior Software Developer | Mobile: +1.919.641.2923


Attachments:
(No filename) (197.00 B)

2001-11-15 16:46:10

by Tim Hockin

[permalink] [raw]
Subject: Re: 32 Groups Maximum in 2.4

> > I've been looking for some time on how to raise the maximum number of
> > groups for the 2.4 kernel. I've discovered how to do this kernel, with
> > a discussion a few months ago on this
> > list.http://www.cs.helsinki.fi/linux/linux-kernel/2001-13/0807.html
>
> Look at the file "include/asm-<proc>/param.h to find the symbol "NGROUPS".
> Change that to whatever value you like.



We have a patch that we haven't submitted yet (out of mostlyt cowardice)
that makes this fully dynamic. task->groups is dynamically allocated and
handled, and can grow up to a sysctl() defined maximum.

It has been working wonderfully for 10,000+ groups. Does this patch have a
chance in hell of going standard?? (don't have the patch on hand, or I'd post
it).

2001-11-15 18:40:27

by Andreas Dilger

[permalink] [raw]
Subject: Re: 32 Groups Maximum in 2.4

On Nov 15, 2001 10:28 -0500, Jackie Meese wrote:
> I've been looking for some time on how to raise the maximum number of
> groups for the 2.4 kernel. I've discovered how to do this kernel, with
> a discussion a few months ago on this
> list.http://www.cs.helsinki.fi/linux/linux-kernel/2001-13/0807.html

Have you considered ACLs instead? http://acl.bestbits.at/
Also available for ext3 (I think reiserfs may also support ACLs, not sure).
It might not suit your needs, but maybe it does, and it is a better long-term
solution.

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

2001-11-15 19:03:27

by Jackie Meese

[permalink] [raw]
Subject: Re: 32 Groups Maximum in 2.4

Andreas Dilger wrote:

> On Nov 15, 2001 10:28 -0500, Jackie Meese wrote:
>
>>I've been looking for some time on how to raise the maximum number of
>>groups for the 2.4 kernel. I've discovered how to do this kernel, with
>>a discussion a few months ago on this
>>list.http://www.cs.helsinki.fi/linux/linux-kernel/2001-13/0807.html
>>
>
> Have you considered ACLs instead? http://acl.bestbits.at/
> Also available for ext3 (I think reiserfs may also support ACLs, not sure).
> It might not suit your needs, but maybe it does, and it is a better long-term
> solution.


The current backup software used for our servers is one big reason for
writing off ACL fairly quickly. Having to check for compatability on
other software we use is another reason this was ruled out.

--
Jackie Meese Institute for Distance and Distributed Learning, Va Tech
Phone: 231-3682 3027 Torgersen Hall MailCode:0445 http://www.iddl.vt.edu/
Education is the change in behavior that occurs as the result of
interaction with events in ones environment.

2001-11-15 19:26:29

by Tim Hockin

[permalink] [raw]
Subject: Re: 32 Groups Maximum in 2.4

> > Have you considered ACLs instead? http://acl.bestbits.at/

> The current backup software used for our servers is one big reason for
> writing off ACL fairly quickly. Having to check for compatability on
> other software we use is another reason this was ruled out.

Bingo.

2001-11-15 20:34:47

by Andreas Dilger

[permalink] [raw]
Subject: Re: 32 Groups Maximum in 2.4

On Nov 15, 2001 14:03 -0500, Jackie Meese wrote:
> Andreas Dilger wrote:
> > On Nov 15, 2001 10:28 -0500, Jackie Meese wrote:
> >>I've been looking for some time on how to raise the maximum number of
> >>groups for the 2.4 kernel. I've discovered how to do this kernel, with
> >>a discussion a few months ago on this
> >>list.http://www.cs.helsinki.fi/linux/linux-kernel/2001-13/0807.html
> >
> > Have you considered ACLs instead? http://acl.bestbits.at/
> > Also available for ext3 (I think reiserfs may also support ACLs, not sure).
> > It might not suit your needs, but maybe it does, and it is a better
> > long-term solution.
>
> The current backup software used for our servers is one big reason for
> writing off ACL fairly quickly. Having to check for compatability on
> other software we use is another reason this was ruled out.

Actually not. If you want to save/restore ACLs, you can easily do
something like the following before each backup:

getfacl -R --skip_base > .acl_backup

and if you need to restore ACLs, you to the reverse after a restore:

setacl --restore=.acl_backup

This puts the ACLs into a regular file that any backup system can handle.

The EA/ACL support will _likely_ be put into 2.5, so it will probably
be easier to use this than to always patch to support > 32 groups,
including all of the user tools, etc (which AFAIK is not anywhere on
the radar to go into the stock kernel, especially since it impacts the
fast-path for _every_ process either by making the tast struct bigger,
or requiring an extra dereference to get at a dynamically-allocated
group list).

Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/