* [ANNOUNCE] linux-libc-headers 2.6.8.1
@ 2004-08-29 20:32 Mariusz Mazur
2004-08-30 6:28 ` Erik Andersen
2004-08-30 9:22 ` Andrew Walrond
0 siblings, 2 replies; 9+ messages in thread
From: Mariusz Mazur @ 2004-08-29 20:32 UTC (permalink / raw)
To: linux-kernel
Available at http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
Changes:
- bugfix release, a couple of minor changes here and there
Nothing special, really. One bigger change - on archs that have >1 possible
page sizes (PAGE_SIZE definition in asm/page.h) we're now using a call to
libc's getpagesize(), so don't count on it being static on archs like ia64.
Enjoy.
--
In the year eighty five ten
God is gonna shake his mighty head
He'll either say,
"I'm pleased where man has been"
Or tear it down, and start again
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [ANNOUNCE] linux-libc-headers 2.6.8.1
2004-08-29 20:32 [ANNOUNCE] linux-libc-headers 2.6.8.1 Mariusz Mazur
@ 2004-08-30 6:28 ` Erik Andersen
2004-08-30 7:24 ` David S. Miller
2004-08-30 9:22 ` Andrew Walrond
1 sibling, 1 reply; 9+ messages in thread
From: Erik Andersen @ 2004-08-30 6:28 UTC (permalink / raw)
To: Mariusz Mazur; +Cc: linux-kernel
On Sun Aug 29, 2004 at 10:32:13PM +0200, Mariusz Mazur wrote:
> Nothing special, really. One bigger change - on archs that have >1 possible
> page sizes (PAGE_SIZE definition in asm/page.h) we're now using a call to
> libc's getpagesize(), so don't count on it being static on archs like ia64.
I really do not like this change. Since PAGE_SIZE has always
been a constant, the change you have made is likely to break a
fair amount of code, basically any code doing stuff like:
static int* foo[PAGE_SIZE];
Your change will result in cryptic errors such as
"error: variable-size type declared outside of any function"
"error: storage size of `foo' isn't constant"
depending on whether the declaration is outside a function or in one.
I think it would be much better to either
a) remove PAGE_SIZE or make using it an error somehow,
b) make PAGE_SIZE an install time config option
c) declare that on architectures such as mips that support
variable PAGE_SIZE values, the libc kernel headers shall
always provide the largest fixed size value of PAGE_SIZE
supported for that architecture and everyone just agrees
that using PAGE_SIZE rather than getpagesize(2) or
sysconf(_SC_PAGESIZE) is generally a bad idea. It should
be the largest value supported on that architecture, since
the the only cost of always using the largest possible
value is wasted ram, whereas the cost of always using the
smallest value is segfaults.
With any of the above 3 suggestions, things will either just
work, or the user will get a descriptive error message.
-Erik
--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [ANNOUNCE] linux-libc-headers 2.6.8.1
2004-08-30 6:28 ` Erik Andersen
@ 2004-08-30 7:24 ` David S. Miller
2004-08-30 7:48 ` Erik Andersen
0 siblings, 1 reply; 9+ messages in thread
From: David S. Miller @ 2004-08-30 7:24 UTC (permalink / raw)
To: andersen; +Cc: mmazur, linux-kernel
On Mon, 30 Aug 2004 00:28:56 -0600
Erik Andersen <andersen@codepoet.org> wrote:
> I really do not like this change. Since PAGE_SIZE has always
> been a constant, the change you have made is likely to break a
> fair amount of code, basically any code doing stuff like:
It has never been a constant, and any portable piece of
software needs to evaluate it not at compile time.
When I first did the sparc64 port, the biggest source of
portability problems was of the "uses PAGE_SIZE in some way"
nature.
This is a positive change, we should break the build of these
apps and thus get them fixed.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [ANNOUNCE] linux-libc-headers 2.6.8.1
2004-08-30 7:24 ` David S. Miller
@ 2004-08-30 7:48 ` Erik Andersen
2004-08-30 8:07 ` William Lee Irwin III
2004-08-30 11:17 ` Mariusz Mazur
0 siblings, 2 replies; 9+ messages in thread
From: Erik Andersen @ 2004-08-30 7:48 UTC (permalink / raw)
To: David S. Miller; +Cc: mmazur, linux-kernel
On Mon Aug 30, 2004 at 12:24:22AM -0700, David S. Miller wrote:
> On Mon, 30 Aug 2004 00:28:56 -0600
> Erik Andersen <andersen@codepoet.org> wrote:
>
> > I really do not like this change. Since PAGE_SIZE has always
> > been a constant, the change you have made is likely to break a
> > fair amount of code, basically any code doing stuff like:
>
> It has never been a constant, and any portable piece of
> software needs to evaluate it not at compile time.
>
> When I first did the sparc64 port, the biggest source of
> portability problems was of the "uses PAGE_SIZE in some way"
> nature.
>
> This is a positive change, we should break the build of these
> apps and thus get them fixed.
There is no question that using PAGE_SIZE should be considered
harmful. But this particular change to the linux-libc-headers
makes it easy for the common case (bog standard x86) folk to keep
using a fixed PAGE_SIZE value, and keep writing crap code which
is now _guaranteed_ to blow chunks on mips, x86_64, etc.
I think outright removal of PAGE_SIZE from user space may be a
much better choice, with some sortof #error perhaps... Wouldn't
it be better for the whole world if people would get errors like
foo.c:10:2: #error "Don't use PAGE_SIZE, use sysconf(_SC_PAGESIZE)"
making people actually fix their code?
-Erik
--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [ANNOUNCE] linux-libc-headers 2.6.8.1
2004-08-30 7:48 ` Erik Andersen
@ 2004-08-30 8:07 ` William Lee Irwin III
2004-08-30 8:43 ` Erik Andersen
2004-08-30 11:17 ` Mariusz Mazur
1 sibling, 1 reply; 9+ messages in thread
From: William Lee Irwin III @ 2004-08-30 8:07 UTC (permalink / raw)
To: andersen; +Cc: David S. Miller, mmazur, linux-kernel
On Mon Aug 30, 2004 at 12:24:22AM -0700, David S. Miller wrote:
>> It has never been a constant, and any portable piece of
>> software needs to evaluate it not at compile time.
>> When I first did the sparc64 port, the biggest source of
>> portability problems was of the "uses PAGE_SIZE in some way"
>> nature.
>> This is a positive change, we should break the build of these
>> apps and thus get them fixed.
On Mon, Aug 30, 2004 at 01:48:35AM -0600, Erik Andersen wrote:
> There is no question that using PAGE_SIZE should be considered
> harmful. But this particular change to the linux-libc-headers
> makes it easy for the common case (bog standard x86) folk to keep
> using a fixed PAGE_SIZE value, and keep writing crap code which
> is now _guaranteed_ to blow chunks on mips, x86_64, etc.
> I think outright removal of PAGE_SIZE from user space may be a
> much better choice, with some sortof #error perhaps... Wouldn't
> it be better for the whole world if people would get errors like
> foo.c:10:2: #error "Don't use PAGE_SIZE, use sysconf(_SC_PAGESIZE)"
> making people actually fix their code?
In general people #define PAGE_SIZE (getpagesize()) or some such.
-- wli
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [ANNOUNCE] linux-libc-headers 2.6.8.1
2004-08-30 8:07 ` William Lee Irwin III
@ 2004-08-30 8:43 ` Erik Andersen
0 siblings, 0 replies; 9+ messages in thread
From: Erik Andersen @ 2004-08-30 8:43 UTC (permalink / raw)
To: William Lee Irwin III, David S. Miller, mmazur, linux-kernel
On Mon Aug 30, 2004 at 01:07:57AM -0700, William Lee Irwin III wrote:
> On Mon Aug 30, 2004 at 12:24:22AM -0700, David S. Miller wrote:
> >> It has never been a constant, and any portable piece of
> >> software needs to evaluate it not at compile time.
> >> When I first did the sparc64 port, the biggest source of
> >> portability problems was of the "uses PAGE_SIZE in some way"
> >> nature.
> >> This is a positive change, we should break the build of these
> >> apps and thus get them fixed.
>
> On Mon, Aug 30, 2004 at 01:48:35AM -0600, Erik Andersen wrote:
> > There is no question that using PAGE_SIZE should be considered
> > harmful. But this particular change to the linux-libc-headers
> > makes it easy for the common case (bog standard x86) folk to keep
> > using a fixed PAGE_SIZE value, and keep writing crap code which
> > is now _guaranteed_ to blow chunks on mips, x86_64, etc.
> > I think outright removal of PAGE_SIZE from user space may be a
> > much better choice, with some sortof #error perhaps... Wouldn't
> > it be better for the whole world if people would get errors like
> > foo.c:10:2: #error "Don't use PAGE_SIZE, use sysconf(_SC_PAGESIZE)"
> > making people actually fix their code?
>
> In general people #define PAGE_SIZE (getpagesize()) or some such.
Then perhaps the right thing is for linux-libc-headers to always
provide such a define for PAGE_SIZE for _all_ architectures, not
just for those that happen to have variable PAGE_SIZE values.
-Erik
--
Erik B. Andersen http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [ANNOUNCE] linux-libc-headers 2.6.8.1
2004-08-29 20:32 [ANNOUNCE] linux-libc-headers 2.6.8.1 Mariusz Mazur
2004-08-30 6:28 ` Erik Andersen
@ 2004-08-30 9:22 ` Andrew Walrond
1 sibling, 0 replies; 9+ messages in thread
From: Andrew Walrond @ 2004-08-30 9:22 UTC (permalink / raw)
To: linux-kernel
On Sunday 29 Aug 2004 21:32, Mariusz Mazur wrote:
> Available at http://ep09.pld-linux.org/~mmazur/linux-libc-headers/
> Changes:
> - bugfix release, a couple of minor changes here and there
>
Just some positive feedback; thanks for this project. It has become a vital
and (dare I say it) trusted component of my work. Long may it continue :)
Andrew Walrond
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [ANNOUNCE] linux-libc-headers 2.6.8.1
2004-08-30 7:48 ` Erik Andersen
2004-08-30 8:07 ` William Lee Irwin III
@ 2004-08-30 11:17 ` Mariusz Mazur
1 sibling, 0 replies; 9+ messages in thread
From: Mariusz Mazur @ 2004-08-30 11:17 UTC (permalink / raw)
To: andersen; +Cc: David S. Miller, linux-kernel
On poniedziałek 30 sierpień 2004 09:48, Erik Andersen wrote:
> There is no question that using PAGE_SIZE should be considered
> harmful. But this particular change to the linux-libc-headers
> makes it easy for the common case (bog standard x86) folk to keep
> using a fixed PAGE_SIZE value, and keep writing crap code which
> is now _guaranteed_ to blow chunks on mips, x86_64, etc.
Good point. I'll switch to using getpagesize() everywhere in a release or two.
--
In the year eighty five ten
God is gonna shake his mighty head
He'll either say,
"I'm pleased where man has been"
Or tear it down, and start again
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [ANNOUNCE] linux-libc-headers 2.6.8.1
@ 2004-08-30 13:36 Albert Cahalan
0 siblings, 0 replies; 9+ messages in thread
From: Albert Cahalan @ 2004-08-30 13:36 UTC (permalink / raw)
To: linux-kernel mailing list; +Cc: andersen, mmazur
Erik Andersen writes:
> On Sun Aug 29, 2004 at 10:32:13PM +0200, Mariusz Mazur wrote:
>> Nothing special, really. One bigger change - on archs that
>> have >1 possible page sizes (PAGE_SIZE definition in asm/page.h)
>> we're now using a call to libc's getpagesize(), so don't count
>> on it being static on archs like ia64.
>
> I really do not like this change. Since PAGE_SIZE has always
> been a constant, the change you have made is likely to break a
> fair amount of code, basically any code doing stuff like:
>
> static int* foo[PAGE_SIZE];
SuSE has already done this, so it's nothing new.
> Your change will result in cryptic errors such as
>
> "error: variable-size type declared outside of any function"
> "error: storage size of `foo' isn't constant"
You'll get a line number too. At least it's a compile-time
error, instead of a quiet data-corrupting run-time error.
> depending on whether the declaration is outside a function or in one.
> I think it would be much better to either
>
> a) remove PAGE_SIZE or make using it an error somehow,
Nope. That breaks more code than necessary.
> b) make PAGE_SIZE an install time config option
Nope. Executables need to run on multiple kernels.
> c) declare that on architectures such as mips that support
> variable PAGE_SIZE values, the libc kernel headers shall
> always provide the largest fixed size value of PAGE_SIZE
Nope. This is silent data corruption.
You'll break stuff like this: P_rss *= (PAGE_SIZE/1024);
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2004-08-30 13:38 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-29 20:32 [ANNOUNCE] linux-libc-headers 2.6.8.1 Mariusz Mazur
2004-08-30 6:28 ` Erik Andersen
2004-08-30 7:24 ` David S. Miller
2004-08-30 7:48 ` Erik Andersen
2004-08-30 8:07 ` William Lee Irwin III
2004-08-30 8:43 ` Erik Andersen
2004-08-30 11:17 ` Mariusz Mazur
2004-08-30 9:22 ` Andrew Walrond
-- strict thread matches above, loose matches on Subject: below --
2004-08-30 13:36 Albert Cahalan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox