Eric Dumazet 1bf47346d7 kernel/sys.c: get rid of expensive divides in groups_sort()
groups_sort() can be quite long if user loads a large gid table.

This is because GROUP_AT(group_info, some_integer) uses an integer divide.
So having to do XXX thousand divides during one syscall can lead to very
high latencies.  (NGROUPS_MAX=65536)

In the past (25 Mar 2006), an analog problem was found in groups_search()
(commit d74beb9f33a5f16d2965f11b275e401f225c949d ) and at that time I
changed some variables to unsigned int.

I believe that a more generic fix is to make sure NGROUPS_PER_BLOCK is
unsigned.

Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-06 10:41:09 -08:00
..
2008-02-03 17:07:16 +02:00
2008-02-06 10:41:01 -08:00
2008-02-06 10:41:01 -08:00
2008-02-06 10:41:01 -08:00
2008-02-06 10:41:01 -08:00
2008-02-06 10:41:02 -08:00
2008-02-06 10:41:00 -08:00
2008-02-06 10:41:02 -08:00
2008-02-05 09:44:31 -08:00
2008-02-06 10:41:01 -08:00
2008-02-03 17:19:47 +02:00
2008-02-03 17:47:00 +02:00
2008-01-31 17:40:18 +01:00