Re: Problems reclaiming VM cache = XFree86 startup annoyance

From: Paul Mather (paul_at_gromit.dlib.vt.edu)
Date: 12/25/03


Date: Wed, 24 Dec 2003 20:14:12 -0500
To: Gregory Bond <gnb@itga.com.au>

On Mon, Dec 22, 2003 at 10:10:01AM +1100, Gregory Bond wrote:

=> paul@gromit.dlib.vt.edu said:
=> > Not being a Python programmer, I don't know exactly how BitTorrent is
=> > accessing the files (e.g., using mmap),
=>
=> I'm no Matt Dillon when it comes to kernel guts, but I suspect if the system is
=> saturating the disk, mmap() vs open()/read() is not going to make any
=> difference. They all wind up at the same underlying VM machinery and banging
=> on the same overloaded disk.

I'm not sure what is overloading the disk other than the large amounts
of paging that are initiated the moment I invoke "startx". The last
time I did this, I looked at the disk activity beforehand via "systat
-vm 1". The disks were basically idle (all < 0.05 MB/s). As soon as
I executed "startx" the swap volume became very active (90--96% busy;
3--7 MB/sec) and the "SWAP PAGER" out column steadily showed paging
activity (nothing on the "in" column). (The 4 KB/t was a tell-tale
sign the system was doing nothing but paging.)

I guess my question is this: why so much paging? If, as someone else
has mentioned, "Cache" and "Free" pages are both "free" (i.e.,
allocable memory), with the subtle distinction being that "Cache"
pages used to hold disk blocks now discarded, then why not allocate
what is needed from them? As I stated in my original thread, all the
"Inactive" memory seems to get dumped over to "Cache" when I run
"startx", and there's usually almost about 400 MB of it when this
happens.

I guess adding another swap volume on another drive will speed up the
page grinding, but I'm not sure why it's happening at all. That, and
the fact that doing a "kill -STOP" on CPU-intensive jobs will let
XFree86 start up right away when it's thrashing around like this.
(Almost as if some reclamation thread is being allowed some CPU time
to do its thing.)

FWIW, here is my disk info (from dmesg):

>>>>>
FreeBSD 4.9-STABLE #0: Mon Dec 1 11:43:29 EST 2003
[[...]]
CPU: AMD Athlon(tm) Processor (1399.76-MHz 686-class CPU)
  Origin = "AuthenticAMD" Id = 0x644 Stepping = 4
  Features=0x183fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR>
  AMD Features=0xc0440000<RSVD,AMIE,DSP,3DNow!>
real memory = 536805376 (524224K bytes)
avail memory = 516378624 (504276K bytes)
[[...]]
atapci0: <VIA 8233 ATA100 controller> port 0xfc00-0xfc0f at device 17.1 on pci0
ata0: at 0x1f0 irq 14 on atapci0
ata1: at 0x170 irq 15 on atapci0
[[...]]
ad0: 57259MB <MAXTOR 6L060J3> [116336/16/63] at ata0-master UDMA100
ad1: 114473MB <WDC WD1200JB-00CRA1> [232581/16/63] at ata0-slave UDMA100
ad2: DMA limited to UDMA33, non-ATA66 cable or device
ad2: 57259MB <MAXTOR 6L060J3> [116336/16/63] at ata1-master UDMA33
acd0: CD-RW <24X10> at ata1-slave WDMA2
[[...]]
<<<<<

This is my swap device (after boot):

Device 1K-blocks Used Avail Capacity Type
/dev/rad1s1b 1048448 0 1048448 0% Interleaved

All the filesystems (except the root filesystem) are Vinum volumes
spread across ad1 and ad2. The BitTorrent content is on a concat plex
that joins together a slab of space from ad1 and ad2 to form a big
files partition.

It just feels wrong that this system should have such poor response to
the peak loading of starting up XFree86...

Cheers,

Paul.

e-mail: paul@gromit.dlib.vt.edu

"Without music to decorate it, time is just a bunch of boring production
 deadlines or dates by which bills must be paid."
        --- Frank Vincent Zappa
_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"



Relevant Pages

  • Re: mdconfig unable to allocate memory
    ... > one ensure that all the memory is being used for suitable file caching ... > disk, really; I assumed that it would immediately start dumping ... > anything I put in it, into swap, causing disk access. ... file system with 4GB of RAM without a problem, ...
    (freebsd-current)
  • Re: Att. Alex Nichol -VM cont.
    ... I find documentation that says a 4kb page in memory is written to the hard ... manner that a 4kb memory page is equal to a 4kb cluster written on the disk". ... So where is the basis for saying since 4kb paging in memory that 4kb clusters ...
    (microsoft.public.windowsxp.general)
  • [PATCH 0/4] compcache: compressed in-memory swapping
    ... It creates RAM based block devices which can be used as swap disks. ... Pages swapped to this device are compressed and stored in memory itself. ... these suffer from wear-leveling issues when used as swap disk ... exposes *bottlenecks* in ramzswap code due to which this gain ...
    (Linux-Kernel)
  • Re: dataset Performence Issue
    ... of data to hold in memory in some applications. ... Network and disk costs see to that. ... First of all, Dataset is guess what - Managed Code, and to send all the ... You need paging mechanisms etc. which are ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Cannot print any Word docs after upgrading to OS X 10.4.9
    ... It does not hurt, but, on a machine with plenty of memory, it would not ... the system creates swap files to deal with those awkward moments ... will page out a few megabytes of Word's working memory to disk and let ... Each one after the first 64MB swapfile0 doubles the total swapfile ...
    (microsoft.public.mac.office.word)