Question on swapping behavior of new kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I'm using a 2.6.26 kernel on an AMD64 machine. Im running some timing
experiments on the Linux swapping system.
My system has 2GB of RAM but I boot linux with mem=1GB.

There's is some behavior happening which I don't understand and I'm
hoping someone can explain it to me.

Here is what my experimental (simple) programs do. in sequence :

1) Process A grabs a lot of memory (calloc). It takes about 90% of memory
2) Process A does some reads/writes to all its allocated memory
3) Start process B. This also grabs a lot of memory (calloc).
4) Process B writes to all its allocated memory
5) OS swaps out Process A pages (to swap device) to make room for B
6) Process A does a timed read of all its pages.

In this case I was expecting it to take a while to do the timed read
since all its pages have been swapped to
disk. However this is not the case. It takes the same amount of time
as when I don't run Process B. This is
counter to my understanding of how it should work.

If I replace step 6) above with :

6) Process A does a timed write of all its pages

Then I see the expected behavior which is that it takes a long time
because all its pages are swapped in first.
Why is there this discrepancy between timed reads and writes ?
At first I thought it may be because AMD64 has a tagged cache and
tagged TLB which causes this behaviour
but I'm not really sure. Does anyone have an idea ?

Thanks
arn

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux