home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / sgi / 12553 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  2.6 KB

  1. Path: sparky!uunet!wupost!sdd.hp.com!mips!mash
  2. From: mash@mips.com (John Mashey)
  3. Newsgroups: comp.sys.sgi
  4. Subject: Re: finding page size?
  5. Date: 18 Aug 1992 18:45:01 GMT
  6. Organization: MIPS Computer Systems, Inc.
  7. Lines: 42
  8. Message-ID: <l92h9dINNeqj@spim.mips.com>
  9. References: <1992Aug18.072025.11920@CSD-NewsHost.Stanford.EDU> <onughl0@zuni.esd.sgi.com>
  10. NNTP-Posting-Host: winchester.mips.com
  11.  
  12. In article <onughl0@zuni.esd.sgi.com> olson@anchor.esd.sgi.com (Dave Olson) writes:
  13. >In <1992Aug18.072025.11920@CSD-NewsHost.Stanford.EDU> philip@ziggy.stanford.edu (Philip Machanick) writes:
  14. >
  15. >| I need to dynamically look up the page size (I know it is 4K now, but prefer  
  16. >| not to build such assumptions in).
  17. >| Is this a good constant to use (i.e. supported)?
  18.  
  19. >Yes, and no.  r4k systems can have multiple page sizes, and one
  20. >of these days we will use that feature.  Besides, it may not
  21. >be terribly portable.  See 'man getpagesize'.  ....
  22.  
  23. To amplify this a little more, and perhaps stir up some discussion
  24. about what people should be doing later:
  25.     a) As Dave says, R4000s support multiple page sizes, and you certainly
  26.     don't want to build 4K into your programs.
  27.     b) This means, not only might different programs have different
  28.     sized pages ... but different parts of the same program might
  29.     have different-sized pages ... and in fact, there are ways of
  30.     using the R4000 TLB where the page size of a given chunk of
  31.     virtual memory changes around during execution....
  32.  
  33. Hence, this leads to the question: if you are using the result of getpagesize,
  34. what are you expecting it to tell you, and how are you using it?
  35. This might provide some guidance about what getpagesize ought to do
  36. in an OS that really uses multiple sizes at the same time.
  37. Note that getpagesize explicitly says its return is not necesarily
  38. the size of underlying hardware pages....
  39.  
  40. In a multiple-page size environment, there are at least the following
  41. potential values that might make sense:
  42. a) 4K: the minimum possible size of allocation.
  43. b) 8K: 2 of those, since the R4000's TLB conveniently pairs pages,
  44. and there might be some advantage under some schemes in allocating 8K chunks.
  45. c) XK, where X is the *largest* size that the OS is willing to put in the TLB,
  46. i.e., so that asking for this much space could be a good hint to the OS to
  47. allocate this much much physical memory in one chunk and be able to map it
  48. with a single TLB entry.
  49. -- 
  50. -john mashey    DISCLAIMER: <generic disclaimer, I speak for me only, etc>
  51. UUCP:      mash@mips.com [soon to be mash@sgi.com, but not quite moved yet].
  52. DDD:      408-524-7015,  or 524-8253
  53. USPS:    (soon) Silicon Graphics, 2011 N. Shoreline Blvd, Mountain View, CA 94043
  54.