lkml.org 
[lkml]   [2002]   [Nov]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [BK PATCH 1/2] Remove NGROUPS hardlimit (resend w/o qsort)
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?

--
Tim Hockin
Systems Software Engineer
Sun Microsystems, Linux Kernel Engineering
thockin@sun.com

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

\
 
 \ /
  Last update: 2005-03-22 13:31    [W:1.668 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site