Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!sun-barr!newstop!male!yavin!mike_s From: mike_s@EBay.Sun.COM (Mike "The Claw" Sullivan) Newsgroups: comp.unix.questions Subject: Re: More than one swap device ? Keywords: swap Message-ID: Date: 22 Mar 91 06:52:45 GMT References: <1991Mar21.132725@anusf.anu.edu.au> <1991Mar21.193820.752@ssd.kodak.com> <1991Mar22.125135@anusf.anu.edu.au> Sender: news@male.EBay.Sun.COM Lines: 28 In <1991Mar22.125135@anusf.anu.edu.au> mbl900@anusf.anu.edu.au (Mathew BM LIM) writes: >Yes, I know about swapon(8), but just what does "interleaved (supposedly >equally)" mean? Does the kernel remember which device it used last time and >use the other one for the next page? Are the devices selected randomly so that >on average they are equally used? Or is one device used all the time >until it fills up then overflows to the next? My guess is that it is >implementation dependant, does anyone have any hard knowledge on this subject? As of 4.1.1 (and I believe since 4.0, where swapon appeared), when you add a swap device it is added to a list of swap devices. The way the kernel spreads anonymous (swap) page allocations is by allocating a megabyte of consective pages on one device, then going on to the next. So yes, it remembers how much it has allocated on one swap device, and when it reaches 1MB, it goes to the next. No, it doesn't use up one device and then overflow to the next (unless that device was <1MB in size). It doesn't have any knowledge about relative access speeds of your separate swap devices; that is left up to the administrator. I believe you can patch the kernel variable swap_maxcontig to change the 1MB value above. Whether you would want to, I don't know. Mike -- Mike Sullivan Internet: msullivan@EBay.Sun.COM Sun Education UUCP: ..!sun!yavin!msullivan Software Course Developer Compuserve: 75365,764 "The old Maxwell Smart silhouette on the window shade trick. That's the