public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: Tim Hockin <thockin@sun.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [BK PATCH 1/2] Remove NGROUPS hardlimit (resend w/o qsort)
Date: Thu, 14 Nov 2002 17:30:33 -0800	[thread overview]
Message-ID: <3DD44E39.4703C2DA@digeo.com> (raw)
In-Reply-To: 3DD44CC0.40805@sun.com

Tim Hockin wrote:
> 
> Andrew Morton wrote:
> 
> > What are you actually using the search for?
> >
> >>From a quick look, it seems that it's purely to answer
> > the question "is this process a member of group X?".  Is
> > that correct?
> >
> > If so, test_bit() would work nicely.
> 
> This could work if we find the max gid, allocate an array of
> max_gid/CHAR_BITS + 1 bytes then test_bit, but given the non-contiguity
> (is that a word) of group memberships, we'll waste a lot of space on
> holes. Now, it could be argued that 10,000 groups are PROBABLY local
> enough.  Getting the groups back out will be nasty nastiness, though.
> 
> perhaps:
> 
> if (gidsetsize < (2 * EXEC_PAGESIZE)/sizeof(gid_t)) { /* or something */
>         /* use kmalloc() */
> else
>         /* use vmalloc() */
> 
> thoughts?
> 

10,000 bits isn't much.  Maybe:

- add `char groups[16]' to task_struct

- add `struct page *groups_page' to task_struct

- then
	if (getsetsize <= 256)
		use current->groups[]		/* 256 groups max */
	else
		use current->groups_page;	/* 32768 groups max */

  reply	other threads:[~2002-11-15  1:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1037316781.6599.linux-kernel2news@redhat.com>
2002-11-15  0:06 ` [BK PATCH 1/2] Remove NGROUPS hardlimit (resend w/o qsort) Pete Zaitcev
2002-11-15  0:14   ` Tim Hockin
2002-11-15  0:31     ` Pete Zaitcev
2002-11-15  0:46       ` Tim Hockin
2002-11-15  1:19         ` William Lee Irwin III
2002-11-15  1:45           ` Pete Zaitcev
2002-11-15  1:53             ` William Lee Irwin III
     [not found]         ` <3DD44742.2DFE4407@digeo.com>
2002-11-15  1:24           ` Tim Hockin
2002-11-15  1:30             ` Andrew Morton [this message]
2002-11-15  2:33               ` Tim Hockin
2002-11-15  2:41                 ` Andrew Morton
2002-11-15 15:13                   ` Alan Cox
2002-11-15  6:00               ` Aaron Lehmann
2002-11-15  1:04       ` Alan Cox
2002-11-15 13:32       ` Frank van Maarseveen
2002-11-14 23:26 Timothy Hockin
2002-11-15 16:30 ` Horst von Brand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3DD44E39.4703C2DA@digeo.com \
    --to=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thockin@sun.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox