Re: [PATCH 2/3] vmscan: make mapped executable pages the firstclass citizen

From: Wu Fengguang
Date: Tue Jun 09 2009 - 02:44:24 EST


On Tue, Jun 09, 2009 at 01:18:26AM +0800, Nai Xia wrote:
> On Mon, Jun 8, 2009 at 3:39 PM, Wu Fengguang<fengguang.wu@xxxxxxxxx> wrote:
> > On Wed, May 20, 2009 at 07:20:24PM +0800, Andi Kleen wrote:
> >> One scenario that might be useful to test is what happens when some very large
> >> processes, all mapped and executable exceed memory and fight each other
> >> for the working set. Do you have regressions then compared to without
> >> the patches?
> >
> > I managed to carry out some stress tests for memory tight desktops.
> > The outcome is encouraging: clock time and major faults are reduced
> > by 50%, and pswpin numbers are reduced to ~1/3.
> >
> > Here is the test scenario.
> > - nfsroot gnome desktop with 512M physical memory
> > - run some programs, and switch between the existing windows after
> > Âstarting each new program.
>
> I think this is a story of VM_EXEC pages fighting against other kind of pages,
> but as Andi said, did you test real regression case of VM_EXEC pages fighting
> against each other?

No. We'd better buy more memory if it's not enough for VM_EXEC pages :-)

Thanks,
Fengguang

> "
> One scenario that might be useful to test is what happens when some very large
> processes, all mapped and executable exceed memory and fight each other
> for the working set. Do you have regressions then compared to without
> the patches?
>
> -Andi
> "
>
> My experices with Compcache(http://code.google.com/p/compcache/) show that
> it also has similar improvement in similar case on LTSP
> (http://code.google.com/p/compcache/wiki/Performance).
> But it does has a non-trivial performance loss even when doing kernel
> compilation.
> I am not a little surprised when Andrew said it "There must be some cost
> somewhere".
>
> So you have found the spots where your patch doing great,
> make double sure it will not do something bad in all places,
> and that will be perfect. :-)
>
> >
> > The progress timing (seconds) is:
> >
> > Âbefore    after  Âprograms
> > Â Â0.02 Â Â Â Â0.02 Â ÂN xeyes
> > Â Â0.75 Â Â Â Â0.76 Â ÂN firefox
> > Â Â2.02 Â Â Â Â1.88 Â ÂN nautilus
> > Â Â3.36 Â Â Â Â3.17 Â ÂN nautilus --browser
> > Â Â5.26 Â Â Â Â4.89 Â ÂN gthumb
> > Â Â7.12 Â Â Â Â6.47 Â ÂN gedit
> > Â Â9.22 Â Â Â Â8.16 Â ÂN xpdf /usr/share/doc/shared-mime-info/shared-mime-info-spec.pdf
> > Â 13.58 Â Â Â 12.55 Â ÂN xterm
> > Â 15.87 Â Â Â 14.57 Â ÂN mlterm
> > Â 18.63 Â Â Â 17.06 Â ÂN gnome-terminal
> > Â 21.16 Â Â Â 18.90 Â ÂN urxvt
> > Â 26.24 Â Â Â 23.48 Â ÂN gnome-system-monitor
> > Â 28.72 Â Â Â 26.52 Â ÂN gnome-help
> > Â 32.15 Â Â Â 29.65 Â ÂN gnome-dictionary
> > Â 39.66 Â Â Â 36.12 Â ÂN /usr/games/sol
> > Â 43.16 Â Â Â 39.27 Â ÂN /usr/games/gnometris
> > Â 48.65 Â Â Â 42.56 Â ÂN /usr/games/gnect
> > Â 53.31 Â Â Â 47.03 Â ÂN /usr/games/gtali
> > Â 58.60 Â Â Â 52.05 Â ÂN /usr/games/iagno
> > Â 65.77 Â Â Â 55.42 Â ÂN /usr/games/gnotravex
> > Â 70.76 Â Â Â 61.47 Â ÂN /usr/games/mahjongg
> > Â 76.15 Â Â Â 67.11 Â ÂN /usr/games/gnome-sudoku
> > Â 86.32 Â Â Â 75.15 Â ÂN /usr/games/glines
> > Â 92.21 Â Â Â 79.70 Â ÂN /usr/games/glchess
> > Â103.79 Â Â Â 88.48 Â ÂN /usr/games/gnomine
> > Â113.84 Â Â Â 96.51 Â ÂN /usr/games/gnotski
> > Â124.40 Â Â Â102.19 Â ÂN /usr/games/gnibbles
> > Â137.41 Â Â Â114.93 Â ÂN /usr/games/gnobots2
> > Â155.53 Â Â Â125.02 Â ÂN /usr/games/blackjack
> > Â179.85 Â Â Â135.11 Â ÂN /usr/games/same-gnome
> > Â224.49 Â Â Â154.50 Â ÂN /usr/bin/gnome-window-properties
> > Â248.44 Â Â Â162.09 Â ÂN /usr/bin/gnome-default-applications-properties
> > Â282.62 Â Â Â173.29 Â ÂN /usr/bin/gnome-at-properties
> > Â323.72 Â Â Â188.21 Â ÂN /usr/bin/gnome-typing-monitor
> > Â363.99 Â Â Â199.93 Â ÂN /usr/bin/gnome-at-visual
> > Â394.21 Â Â Â206.95 Â ÂN /usr/bin/gnome-sound-properties
> > Â435.14 Â Â Â224.49 Â ÂN /usr/bin/gnome-at-mobility
> > Â463.05 Â Â Â234.11 Â ÂN /usr/bin/gnome-keybinding-properties
> > Â503.75 Â Â Â248.59 Â ÂN /usr/bin/gnome-about-me
> > Â554.00 Â Â Â276.27 Â ÂN /usr/bin/gnome-display-properties
> > Â615.48 Â Â Â304.39 Â ÂN /usr/bin/gnome-network-preferences
> > Â693.03 Â Â Â342.01 Â ÂN /usr/bin/gnome-mouse-properties
> > Â759.90 Â Â Â388.58 Â ÂN /usr/bin/gnome-appearance-properties
> > Â937.90 Â Â Â508.47 Â ÂN /usr/bin/gnome-control-center
> > Â1109.75 Â Â Â587.57 Â ÂN /usr/bin/gnome-keyboard-properties
> > Â1399.05 Â Â Â758.16 Â ÂN : oocalc
> > Â1524.64 Â Â Â830.03 Â ÂN : oodraw
> > Â1684.31 Â Â Â900.03 Â ÂN : ooimpress
> > Â1874.04 Â Â Â993.91 Â ÂN : oomath
> > Â2115.12 Â Â 1081.89 Â ÂN : ooweb
> > Â2369.02 Â Â 1161.99 Â ÂN : oowriter
> >
> > Note that the oo* commands are actually commented out.
> >
> > The vmstat numbers are (some relevant ones are marked with *):
> >
> >              Âbefore  Âafter
> > Ânr_free_pages       Â1293   Â3898
> > Ânr_inactive_anon      59956   53460
> > Ânr_active_anon       26815   30026
> > Ânr_inactive_file      2657   Â3218
> > Ânr_active_file       2019   Â2806
> > Ânr_unevictable       4     4
> > Ânr_mlock          4     4
> > Ânr_anon_pages       Â26706   27859
> > *nr_mapped         Â3542   Â4469
> > Ânr_file_pages       Â72232   67681
> > Ânr_dirty          1     0
> > Ânr_writeback        123    19
> > Ânr_slab_reclaimable    Â3375   Â3534
> > Ânr_slab_unreclaimable   Â11405   10665
> > Ânr_page_table_pages    Â8106   Â7864
> > Ânr_unstable        Â0     0
> > Ânr_bounce         Â0     0
> > *nr_vmscan_write      Â394776  Â230839
> > Ânr_writeback_temp     Â0     0
> > Ânuma_hit          6843353  3318676
> > Ânuma_miss         Â0     0
> > Ânuma_foreign        0     0
> > Ânuma_interleave      Â1719   Â1719
> > Ânuma_local         6843353  3318676
> > Ânuma_other         0     0
> > *pgpgin           5954683  2057175
> > *pgpgout          Â1578276  922744
> > *pswpin           1486615  512238
> > *pswpout          Â394568  Â230685
> > Âpgalloc_dma        Â277432  Â56602
> > Âpgalloc_dma32 Â Â Â Â Â Â Â6769477 Â 3310348
> > Âpgalloc_normal       0     0
> > Âpgalloc_movable      Â0     0
> > Âpgfree           7048396  3371118
> > Âpgactivate         2036343  1471492
> > Âpgdeactivate        2189691  1612829
> > Âpgfault          Â3702176  3100702
> > *pgmajfault         452116  Â201343
> > Âpgrefill_dma        12185   7127
> > Âpgrefill_dma32 Â Â Â Â Â Â 334384 Â Â653703
> > Âpgrefill_normal      Â0     0
> > Âpgrefill_movable      0     0
> > Âpgsteal_dma        Â74214   22179
> > Âpgsteal_dma32 Â Â Â Â Â Â Â3334164 Â 1638029
> > Âpgsteal_normal       0     0
> > Âpgsteal_movable      Â0     0
> > Âpgscan_kswapd_dma     Â1081421  1216199
> > Âpgscan_kswapd_dma32 Â Â Â Â58979118 Â46002810
> > Âpgscan_kswapd_normal    0     0
> > Âpgscan_kswapd_movable   Â0     0
> > Âpgscan_direct_dma     Â2015438  1086109
> > Âpgscan_direct_dma32 Â Â Â Â55787823 Â36101597
> > Âpgscan_direct_normal    0     0
> > Âpgscan_direct_movable   Â0     0
> > Âpginodesteal        3461   Â7281
> > Âslabs_scanned       Â564864  Â527616
> > Âkswapd_steal        2889797  1448082
> > Âkswapd_inodesteal     Â14827   14835
> > Âpageoutrun         43459   21562
> > Âallocstall         9653   Â4032
> > Âpgrotated         Â384216  Â228631
> > Âhtlb_buddy_alloc_success  0     0
> > Âhtlb_buddy_alloc_fail   Â0     0
> > Âunevictable_pgs_culled   0     0
> > Âunevictable_pgs_scanned  Â0     0
> > Âunevictable_pgs_rescued  Â0     0
> > Âunevictable_pgs_mlocked  Â4     4
> > Âunevictable_pgs_munlocked Â0 Â Â Â Â 0
> > Âunevictable_pgs_cleared  Â0     0
> > Âunevictable_pgs_stranded  0     0
> > Âunevictable_pgs_mlockfreed 0 Â Â Â Â 0
> >
> > --
> > To unsubscribe, send a message with 'unsubscribe linux-mm' in
> > the body to majordomo@xxxxxxxxxx ÂFor more info on Linux MM,
> > see: http://www.linux-mm.org/ .
> > Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>
> >
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/