Subject: Re: CVS [email-masked]: linux

From: "Maciej W. Rozycki" <[email-masked]>
Date: Mon, 23 Aug 2004 11:29:46 +0200 (CEST)

On Fri, 20 Aug 2004 [email-masked] wrote:

> Log message:
> 	Undo change from rev 1.37; some userspace software is expecting
> 	PAGE_SIZE, PAGE_SHIFT and PAGE_MASK to be accessible through
> 	<asm/page.h>.  Sigh ...

 Fix that software then, instead of breaking good one (hint -- what is the
"right" value of PAGE_SHIFT and why it doesn't work for that system over
there?).  With these macros exported it's hard to guess whether the page
size can be hardcoded or it should get determined at the run time.  And 
with glibc you get a compilation error due to PAGE_SHIFT being undefined.  
Please revert the braindamage.

 What software is the offender, BTW?

  Maciej

---

From: Kumba <[email-masked]>
Date: Mon, 23 Aug 2004 05:54:19 -0400

>  What software is the offender, BTW?

procps is probably the trigger of this.  Me and some other Gentoo/MIPS 
devs/users got into a bit of a heated discussion w/ the procps 
maintainer, who didn't quite like the fact that A) We don't use 
"sanitized" kernel headers B) PAGE_SIZE was hidden on MIPS and C) 
"properly sanitized" headers would provide PAGE_SIZE.  We opted instead 
for a patch to procps that used sysconf(_SC_PAGESIZE) to fetch the 
value, and I guess this just didn't rub the right way w/ the maintainer. 
  Got me.

I can post the discussions for those interested (or just looking for 
amusement), and anyone curious enough can look at proc/procps.h in the 
procps tree for a rather amusing (IMHO) comment on MIPS at the top of 
the source.

--Kumba

-- 
"Such is oft the course of deeds that move the wheels of the world: 
small hands do them because they must, while the eyes of the great are 
elsewhere."  --Elrond

---

From: Ralf Baechle <[email-masked]>
Date: Mon, 23 Aug 2004 12:24:02 +0200

> Please revert the braindamage.

Due to PAGE_SHIFT being undefined?  You meant the opposite?

>  What software is the offender, BTW?

Procps but I have dark memories of other packages doing the same thing, so
I gave up and kludged the thing the same way other architectures do.
Even IA-64 which is suffering the same pains with variable page size.

  Ralf

---

From: Ralf Baechle <[email-masked]>
Date: Mon, 23 Aug 2004 12:58:50 +0200

> value, and I guess this just didn't rub the right way w/ the maintainer. 

Who happens to be Albert Calahan, just to mention the name.

As for the sanitized kernel headers package he's probably right.  At the
current state of Linux kernel headers - all architectures, not just MIPS -
mail threads like this will be unavoidable if we try to continue
supporting kernel headers in userspace.  I can be convinced to support
such use to the same point as i386 but not a single symbol beyond that.

> procps tree for a rather amusing (IMHO) comment on MIPS at the top of 

Whoever wrote that has a very screwed idea of the MIPS realities.

  Ralf

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Mon, 23 Aug 2004 13:40:14 +0200 (CEST)

> Due to PAGE_SHIFT being undefined?  You meant the opposite?

 Yes.  No.  PAGE_SHIFT is defined conditionally based on 
CONFIG_PAGE_SIZE_*, which is of course undefined in a generic set of 
headers.

 With PAGE_SIZE undefined you can fall back to sysconf(_SC_PAGESIZE) or 
the page size in the ELF auxiliary vector (depending on the context).  

> Even IA-64 which is suffering the same pains with variable page size.

 Do they?  Anyway that's not a way to fix broken software.  Perhaps we 
could do the following hack to teach the resistant:

#ifndef __KERNEL__
#warning PAGE_SIZE is not a user macro, fix your program!
#define PAGE_SIZE sysconf(_SC_PAGESIZE)
#endif

but glibc might not be especially happy about such an alias.

 If you really insist on PAGE_SIZE being constant, then please at least
define it to the maximum supported size for the userland, so that page
alignment rules are kept.  I don't see any reason to keep bugs alive,
though.

  Maciej