This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PAGE_SIZE definition for MIPS XLP


On Tue, 19 Nov 2013, Andrew Pinski wrote:

> > MIPS' sys/user.h currently has a constant definition for PAGE_SIZE, and the
> > other related settings. This is not appropriate for XLP (and other MIPS?)
> > where the actual page size is a kernel configuration option.
> 
> The whole Octeon series of MIPS64 processors also supports other
> PAGE_SIZEs.  Also the generic MIPS glibc should support other page
> sizes too.

 Virtually all MIPS processors that have a TLB MMU, except a few old 
oddballs, support a configurable page size (on a page-by-page basis, but 
Linux sets the size globally).  The exceptions are the R2000/R3000 MIPS I 
ISA CPUs and their variations (fixed 4kB page size) and the R6000 MIPS II 
ISA CPU (fixed 16kB page size).  The latter hardly ever seen anywhere 
(being a costly ECL discrete CPU chip set) and never supported by Linux.  
Therefore there's no point ever in hardcoding any particular page size for 
the MIPS port.

 Of the sizes offered by standard hardware, ranging from 1kB up to 256TB 
at the every other power of 2, Linux chose to support 4kB, 16kB and 64kB 
pages.

> > Apart from the general principle of not having incorrect definitions, the
> > actual problem that needs to be solved is in
> > sysdeps/unix/sysv/linux/ifaddrs.c in which PAGE_SIZE is used by preference
> > as an optimization. Most of the other possible use cases prefer to call
> > __getpagesize or use sysconf, and so are unaffected.

 The case of ifaddrs.c seems ill-conceived to me.  If such a kind of 
optimisation is desired, then I think on targets that have a fixed page 
size getpagesize should simply be implemented as a static inline function 
so that GCC can reduce any calls to an instantiation of the constant 
returned.

  Maciej


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]