* [PATCH] set EXEC_PAGESIZE to PAGE_SIZE
@ 2004-05-11 14:59 Greg Edwards
2004-05-11 16:10 ` David Mosberger
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Greg Edwards @ 2004-05-11 14:59 UTC (permalink / raw)
To: linux-ia64
The number of pages allocated for the gid_t * blocks[] array in the
group_info struct is calculated from EXEC_PAGESIZE. This is used when
the number of groups goes above 32. On ia64, this is currently
hard-coded at 65536, which results in only a 1/4 of the required pages
being allocated on a 16k page size kernel. A setgroups() call with a
gidsetsize of 65536 will end up tromping on memory. Patch below sets
EXEC_PAGESIZE to PAGE_SIZE.
=== include/asm-ia64/param.h 1.6 vs edited ==--- 1.6/include/asm-ia64/param.h Wed Feb 18 21:42:38 2004
+++ edited/include/asm-ia64/param.h Tue May 11 09:04:13 2004
@@ -10,7 +10,7 @@
* David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
*/
-#define EXEC_PAGESIZE 65536
+#define EXEC_PAGESIZE PAGE_SIZE
#ifndef NOGROUP
# define NOGROUP (-1)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] set EXEC_PAGESIZE to PAGE_SIZE
2004-05-11 14:59 [PATCH] set EXEC_PAGESIZE to PAGE_SIZE Greg Edwards
@ 2004-05-11 16:10 ` David Mosberger
2004-05-11 16:24 ` Andreas Schwab
2004-05-11 16:39 ` Greg Edwards
2 siblings, 0 replies; 4+ messages in thread
From: David Mosberger @ 2004-05-11 16:10 UTC (permalink / raw)
To: linux-ia64
>>>>> On Tue, 11 May 2004 09:59:23 -0500, edwardsg@sgi.com (Greg Edwards) said:
Greg> The number of pages allocated for the gid_t * blocks[] array
Greg> in the group_info struct is calculated from EXEC_PAGESIZE.
Sounds like a bug in the large-groups patch then, no?
--david
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] set EXEC_PAGESIZE to PAGE_SIZE
2004-05-11 14:59 [PATCH] set EXEC_PAGESIZE to PAGE_SIZE Greg Edwards
2004-05-11 16:10 ` David Mosberger
@ 2004-05-11 16:24 ` Andreas Schwab
2004-05-11 16:39 ` Greg Edwards
2 siblings, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2004-05-11 16:24 UTC (permalink / raw)
To: linux-ia64
edwardsg@sgi.com (Greg Edwards) writes:
> The number of pages allocated for the gid_t * blocks[] array in the
> group_info struct is calculated from EXEC_PAGESIZE. This is used when
> the number of groups goes above 32. On ia64, this is currently
> hard-coded at 65536, which results in only a 1/4 of the required pages
> being allocated on a 16k page size kernel. A setgroups() call with a
> gidsetsize of 65536 will end up tromping on memory. Patch below sets
> EXEC_PAGESIZE to PAGE_SIZE.
IMHO the real bug is that EXEC_PAGESIZE is used in the first place.
EXEC_PAGESIZE is supposed to be the biggest page size supported by any
executable, thus is should always be the max of all possible page sizes.
It has no relation to the actual page size of the running kernel.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] set EXEC_PAGESIZE to PAGE_SIZE
2004-05-11 14:59 [PATCH] set EXEC_PAGESIZE to PAGE_SIZE Greg Edwards
2004-05-11 16:10 ` David Mosberger
2004-05-11 16:24 ` Andreas Schwab
@ 2004-05-11 16:39 ` Greg Edwards
2 siblings, 0 replies; 4+ messages in thread
From: Greg Edwards @ 2004-05-11 16:39 UTC (permalink / raw)
To: linux-ia64
On Tue, May 11, 2004 at 06:24:22PM +0200, Andreas Schwab wrote:
| edwardsg@sgi.com (Greg Edwards) writes:
|
| > The number of pages allocated for the gid_t * blocks[] array in the
| > group_info struct is calculated from EXEC_PAGESIZE. This is used when
| > the number of groups goes above 32. On ia64, this is currently
| > hard-coded at 65536, which results in only a 1/4 of the required pages
| > being allocated on a 16k page size kernel. A setgroups() call with a
| > gidsetsize of 65536 will end up tromping on memory. Patch below sets
| > EXEC_PAGESIZE to PAGE_SIZE.
|
| IMHO the real bug is that EXEC_PAGESIZE is used in the first place.
| EXEC_PAGESIZE is supposed to be the biggest page size supported by any
| executable, thus is should always be the max of all possible page sizes.
| It has no relation to the actual page size of the running kernel.
Thanks for pointing that out, Andreas. I'll take a look and see if any
arches have a problem with calculating NGROUPS_PER_BLOCK from
PAGE_SIZE instead of EXEC_PAGESIZE, then I'll send something to lkml.
Greg
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-05-11 16:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-11 14:59 [PATCH] set EXEC_PAGESIZE to PAGE_SIZE Greg Edwards
2004-05-11 16:10 ` David Mosberger
2004-05-11 16:24 ` Andreas Schwab
2004-05-11 16:39 ` Greg Edwards
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox