Re: [2.4.17/18pre] VM and swap - it's really unusable

M.H.VanLeeuwen
2002-01-04T02:15:50Z

[-- Attachment #1: Type: text/plain, Size: 4338 bytes --]

Stephan von Krawczynski wrote:
>
> On Mon, 31 Dec 2001 11:14:04 -0600
> "M.H.VanLeeuwen" <vanl@megsinet.net> wrote:
>
> > [...]
> > vmscan patch:
> >
> > a. instead of calling swap_out as soon as max_mapped is reached, continue to
> try> to free pages. this reduces the number of times we hit
> try_to_free_pages() and> swap_out().
>
> I experimented with this some time ago, but found out it hit performance and
> (to my own surprise) did not do any good at all. Have you tried this
> stand-alone/on top of the rest to view its results?
>
> Regards,
> Stephan

Stephan,

Here is what I've run thus far. I'll add nfs file copy into the mix also...

System: SMP 466 Celeron 192M RAM, running KDE, xosview, and other minor apps.

Each run after clean & cache builds has 1 more setiathome client running upto a
max if 8 seti clients. No, this isn't my normal way of running setiathome, but
each instance uses a nice chunk of memory.

Note: this is a single run for each of the columns using "make -j2 bzImage" each time.

I will try to run aa and rmap this evening and/or tomorrow.

Martin

----------------------------------------------------------------------------

STOCK KERNEL MH KERNEL STOCK + SWAP MH + SWAP
(no swap) (no swap)

CLEAN
BUILD real 7m19.428s 7m19.546s 7m26.852s 7m26.256s
user 12m53.640s 12m50.550s 12m53.740s 12m47.110s
sys 0m47.890s 0m54.960s 0m58.810s 1m1.090s
1.1M swp 0M swp

CACHE
BUILD real 7m3.823s 7m3.520s 7m4.040s 7m4.266s
user 12m47.710s 12m49.110s 12m47.640s 12m40.120s
sys 0m46.660s 0m46.270s 0m47.480s 0m51.440s
1.1M swp 0M swp

SETI 1
real 9m51.652s 9m50.601s 9m53.153s 9m53.668s
user 13m5.250s 13m4.420s 13m5.040s 13m4.470s
sys 0m49.020s 0m50.460s 0m51.190s 0m50.580s
1.1M swp 0M swp

SETI 2
real 13m9.730s 13m7.719s 13m4.279s 13m4.768s
user 13m16.810s 13m15.150s 13m15.950s 13m13.400s
sys 0m50.880s 0m50.460s 0m50.930s 0m52.520s
5.8M swp 1.9M swp

SETI 3
real 15m49.331s 15m41.264s 15m40.828s 15m45.551s
user 13m22.150s 13m21.560s 13m14.390s 13m20.790s
sys 0m49.250s 0m49.910s 0m49.850s 0m50.910s
16.2M swp 3.1M swp

SETI 4
real OOM KILLED 19m8.435s 19m5.584s 19m3.618s
user kdeinit 13m24.570s 13m24.000s 13m22.520s
sys 0m51.430s 0m50.320s 0m51.390s
18.7M swp 8.3M swp
SETI 5
real NA 21m35.515s 21m48.543s 22m0.240s
user 13m9.680s 13m22.030s 13m28.820s
sys 0m49.910s 0m50.850s 0m52.270s
31.7M swp 11.3M swp

SETI 6
real NA 24m37.167s 25m5.244s 25m13.429s
user 13m7.650s 13m26.590s 13m32.640s
sys 0m51.390s 0m51.260s 0m52.790s
35.3M swp 17.1M swp

SETI 7
real NA 28m40.446s 28m3.612s 28m12.981s
user 13m16.460s 13m26.130s 13m31.520s
sys 0m57.940s 0m52.510s 0m53.570s
38.8M swp 25.4M swp

SETI 8
real NA 29m31.743s 31m16.275s 32m29.534s
user 13m37.610s 13m27.740s 13m33.630s
sys 1m4.450s 0m52.100s 0m54.140s
41.5M swp 49.7M swp (hmmm?)

[-- Attachment #2: vmscan.patch.2.4.17.c --]
[-- Type: application/octet-stream, Size: 1275 bytes --]

--- linux.virgin/mm/vmscan.c Mon Dec 31 12:46:25 2001
+++ linux/mm/vmscan.c Thu Jan 3 19:43:02 2002
@@ -394,9 +394,9 @@
if (PageDirty(page) && is_page_cache_freeable(page) && page->mapping) {
/*
* It is not critical here to write it only if
- * the page is unmapped beause any direct writer
+ * the page is unmapped because any direct writer
* like O_DIRECT would set the PG_dirty bitflag
- * on the phisical page after having successfully
+ * on the physical page after having successfully
* pinned it and after the I/O to the page is finished,
* so the direct writes to the page cannot get lost.
*/
@@ -480,11 +480,14 @@

/*
* Alert! We've found too many mapped pages on the
- * inactive list, so we start swapping out now!
+ * inactive list.
+ * Move referenced pages to the active list.
*/
- spin_unlock(&pagemap_lru_lock);
- swap_out(priority, gfp_mask, classzone);
- return nr_pages;
+ if (PageReferenced(page)) {
+ del_page_from_inactive_list(page);
+ add_page_to_active_list(page);
+ }
+ continue;
}

/*
@@ -521,6 +524,9 @@
}
spin_unlock(&pagemap_lru_lock);

+ if (max_mapped <= 0 && nr_pages > 0)
+ swap_out(priority, gfp_mask, classzone);
+
return nr_pages;
}