[comp.os.os2.misc] Virtual Memory Page Size

bradc@cognos.UUCP (Brad Cameron) (05/16/91)

Is the virtual memory page size (ie. the unit of swapping) adjustable
under OS/2 (version 1.3) or is it some fixed size such as 64K?

If it is adjustable, is this a function of the application, or it a
tunable parameter of the operating system?

We are trying to reduce the page size in an attempt to improve virtual
memory performance.


-- 
Brad Cameron          uucp: uunet!mitel!cunews!cognos!bradc
Cognos Incorporated   inet: bradc%cognos.uucp@uunet.uu.net
(613) 738-1440        mail: P.O. Box 9707, 3755 Riverside Drive, 
                            Ottawa Ontario, Canada. K1G 3Z4

Steven P. Sedlmeyer <SPS2@psuvm.psu.edu> (05/17/91)

In article <1991May17.171113.11939@unixg.ubc.ca>, ballard@ucs.ubc.ca (Alan
Ballard) says:
>
>OS/2 2.0 is a PAGED system. Anyone know what the page size is?
>
The page size in OS/2 2.0 is fixed at 4KB.  The size is a function of the pagin
g hardware of the 386 chip.

+-----------------------------------------------------------------------------+
|  Steve Sedlmeyer                       | SPS2@PSU.PSUVM.EDU                 |
|                                        | (703) 874-5156                     |
|                                        |                                    |
+-----------------------------------------------------------------------------+

ballard@ucs.ubc.ca (Alan Ballard) (05/18/91)

In article <9645@cognos.UUCP> bradc@cognos.UUCP () writes:
>Is the virtual memory page size (ie. the unit of swapping) adjustable
>under OS/2 (version 1.3) or is it some fixed size such as 64K?

OS/2 1.x uses SEGMENTED, not paged, virtual memory.  The pieces
swapped are the code and data segments as defined by the applications.
Using a larger number of smaller data segments might help. 

Actually, code segments aren't supposed to get swapped, they should be just 
reloaded from disk as needed, though this may not have worked until
1.3.  Smaller code segments will help reduce the disk activity 
needed to reload them, however. 
 
OS/2 2.0 is a PAGED system. Anyone know what the page size is?

>We are trying to reduce the page size in an attempt to improve virtual
>memory performance.

Are you running 1.3, which considerably improved memory performance?
Do you have the right MEMMAN options specified in config.sys 
(SWAP,MOVE,SWAPDOS)


-- 
Alan Ballard                   | Internet: ballard@ucs.ubc.ca
University Computing Services  |   Bitnet: USERAB1@UBCMTSG
University of British Columbia |    Phone: 604-822-3074
Vancouver B.C. Canada V6R 1Z2  |      Fax: 604-822-5116

wbonner@yoda.eecs.wsu.edu (Wim Bonner) (05/18/91)

In article <1991May17.171113.11939@unixg.ubc.ca> ballard@ucs.ubc.ca (Alan Ballard) writes:
>OS/2 2.0 is a PAGED system. Anyone know what the page size is?

I'm not certain, but doesn't the 386 usually use 4k pages?  I know I just 
dealt with a class on the unix operating system, and we dealt with paging 
algorithms in the course of the class.  Our machines were ATT 386 boxes, 
and I know that we were using 4k pages.

I knew that the page size was hardware dependent, but I never got to thinking
if it was hardware dependent in a range of sizes.

Wim.
-- 
|  wbonner@yoda.eecs.wsu.edu  | The Loft BBS
| 27313853@wsuvm1.csc.wsu.edu | Currently down for the summer.
|  72561.3135@CompuServe.com  | USR HST Dual Standard HST/V.32

chrisj@pdx024.intel.com (Chris Jones) (05/18/91)

In article <1991May17.194921.24025@serval.net.wsu.edu>, wbonner@yoda.eecs.wsu.edu (Wim Bonner) writes:
|> In article <1991May17.171113.11939@unixg.ubc.ca> ballard@ucs.ubc.ca (Alan Ballard) writes:
|> >OS/2 2.0 is a PAGED system. Anyone know what the page size is?
|> 
|> I'm not certain, but doesn't the 386 usually use 4k pages?  I know I just 
|> dealt with a class on the unix operating system, and we dealt with paging 
|> algorithms in the course of the class.  Our machines were ATT 386 boxes, 
|> and I know that we were using 4k pages.
|> 
|> I knew that the page size was hardware dependent, but I never got to thinking
|> if it was hardware dependent in a range of sizes.
|> 

The i386(tm) and i486(tm) have a page length which is hardware defined
to be 4kb.  Segments can range from 1 byte to 1Mb in size if byte granularity
is used, and can be from 4kb (1 page) to 4Gb (1 Mpage?) in size if page
granularity is used.

+----------------------------------+------------------------------------------+
{ Chris S Jones, Intel Corp.       | The opinions expressed above probably do }
{ 5200 NE Elam Young Pkwy, JF1-58  | not reflect the opinions of Intel. If    }
{ Hillsboro, OR 97124              | they actually do reflect the opinions of }
{ chrisj@ichips.intel.com          | Intel, it is purely coincidental, since  }
{ (503) 696-4022                   | Intel would never comment on such matters}
+----------------------------------+------------------------------------------+

Mahoney@emdisle.FIDONET.ORG (Mike Mahoney) (05/19/91)

In an article of <17 May 91 17:11:13 GMT>, ballard@ucs.ubc.ca (Alan Ballard) writes:

 AB>OS/2 2.0 is a PAGED system. Anyone know what the page size is?

  It's 4K.
--  
Mike Mahoney - via FidoNet node 1:300/14
UUCP: uunet...!noao!coyote!emdisle!Mahoney
INTERNET: Mahoney@emdisle.FIDONET.ORG

seg@ingres.com (scott e garfinkle) (05/23/91)

In article <9645@cognos.UUCP> bradc@cognos.UUCP () writes:
>Is the virtual memory page size (ie. the unit of swapping) adjustable
>under OS/2 (version 1.3) or is it some fixed size such as 64K?
OS/2 1.x does not use virtual pages (though 2.0 does) -- it swaps segments.
A segment is however large you asked for it to be, from 1 byte to 64kb.
IBM suggests using 32kb or 60kb as good sizes for swapping performance
(64kb requires two physical writes to swap).  It will probably help if
you are swapping many segments of the same size, too.
	-scott garfinkle

donh@microsoft.UUCP (Don HACHERL) (05/25/91)

In article <1991May17.171113.11939@unixg.ubc.ca> ballard@ucs.ubc.ca (Alan Ballard) writes:
>In article <9645@cognos.UUCP> bradc@cognos.UUCP () writes:
>>Is the virtual memory page size (ie. the unit of swapping) adjustable
>>under OS/2 (version 1.3) or is it some fixed size such as 64K?
>
>OS/2 1.x uses SEGMENTED, not paged, virtual memory.  The pieces
>swapped are the code and data segments as defined by the applications.
>Using a larger number of smaller data segments might help. 

Avoiding very large segments can help reduce swap latency on OS/2 1.x,
but you don't want to over do it.  Don't forget that the OS has a
fixed per-segment overhead that's taken out of resident memory, i.e.
more user segments -> less memory available to put them in.  As a rule
of thumb I'd try to tune code segments to be in the range 2-16k.  OS/2
2.0 is paged, though, and its behaviour is different.  Since page
fragments past the end of segments go unused (well, almost, but close
enough) and all swap I/O occurs 4k at a time no matter what the
segment size, you want to have large segments to minimize
fragmentation.  I've looked at a couple of apps that were swap tuned
for 1.x (or Windows) by using tiny segments and they wasted *amazing*
amounts of memory under 2.0.  A good compromise for the two systems
would be in the 16-32k range.

Don
-- 
Don Hacherl		"Sorry, no pithy quotes today"
donh%microsof@uunet.uu.net  or  {uunet|uw-beaver}!microsoft!donh
Disclaimer:  Little of what I say should be taken seriously, and none
	     should be taken as the opinion of my employer.