On Wed, Feb 19, 2003 at 08:58:19AM -0500, Mike A. Harris wrote: >Here is the original patch comment, with my own comments below. >Please apply patch to 4.2.99.x, with plans of a better long term >solution for the future planned for later. > >=================================================================== >Patch by Chris Ahna: > >Fixes critical page size problems on ia64 architecture. See >following URL for details: > >https://external-lists.valinux.com/archives/linux-ia64/2001-August/002037.html >=================================================================== > > > >This probably should be rewritten to be outside of the drivers >themselves so that it doesn't have to be done per-driver. I'm >applying this to our XFree86 for now however until I've got time >to investigate doing it more generically. Architectures like >Itanium, and Alpha, and probably many others as well do not use >4Kb page size, at least not by default, and they may have a >different page size from one machine to the next, or from one OS >kernel build to the next. Linux allows the page size to be >configured at build time for processors that support it, however >the current XFree86 source either hard codes a fixed page size, >such as the case for Alpha, or uses a default of 4K which breaks >on other architectures. Some Alpha machines use 8Kb for example. > >The proper long term fix for this IMHO is to make either a DRI >global variable, or an X server global variable to store the >architecture's pagesize and pagemask at server startup, and let >drivers and modules use this information as needed. I think the >best place is probably in xf86Globals.c, but I want to >investigate it more first. > >The server should call an OS function to get the page size once >only, and then everywhere that needs to know it should use the >global. There are 2 choices at least for this that I am aware >of, and they are: > >1) getpagesize() >2) setconf(_SC_PAGESIZE)
sysconf(_SC_PAGESIZE) > >getpagesize() is considered legacy in POSIX, and not guaranteed >to be on all systems. HPUX does not have it for example. >setconf(_SC_PAGESIZE) is defined by SuSv3 at least, and perhaps >SuSv2 although I'd have to confirm that. > >In order to maximize portability, it would be best to determine >if the OS has setconf() and use it, and if not, to fall back to >getpagesize() instead, and if that isn't supported, to perhaps >allow 2 Imake defines to set the pagesize at buildtime. > >The only problem I can see with this, is the case where 2 >operating systems both on the same architecture, where one >supports setconf() lets say and the other does not. If we hard >code setconf on the OS building the X server, it is theoretically >possible that it wont run on other OS's and thus break the binary >compatibility across architectures idea. > >Thinking about that some more, I decided that if the call is done >in the X server itself, it should not be a problem really because >it is the drivers that are cross OS in one arch, not the server >itself. Also, to maximize portability anally, one could do a run >time test of return of getconf() and if not supported, fall back >to setconf() and then to hard coded compile time defaults. > >Any comments about any of this? xf86getpagesize() in os-support/shared/libc_wrapper.c already works like this, and the patch you sent makes no functional change for ia64. It does potentially make a functional change for other architectures, but that's not where you're saying the problem is. >https://external-lists.valinux.com/archives/linux-ia64/2001-August/002037.html Compare the patch there with the one you just sent. David -- David Dawes Release Engineer/Architect The XFree86 Project www.XFree86.org/~dawes _______________________________________________ Devel mailing list [EMAIL PROTECTED] http://XFree86.Org/mailman/listinfo/devel
