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

From: Wu Fengguang
Date: Tue May 19 2009 - 02:53:55 EST


On Tue, May 19, 2009 at 12:41:38PM +0800, KOSAKI Motohiro wrote:
> Hi
>
> Thanks for great works.
>
>
> > SUMMARY
> > =======
> > The patch decreases the number of major faults from 50 to 3 during 10% cache hot reads.
> >
> >
> > SCENARIO
> > ========
> > The test scenario is to do 100000 pread(size=110 pages, offset=(i*100) pages),
> > where 10% of the pages will be activated:
> >
> > for i in `seq 0 100 10000000`; do echo $i 110; done > pattern-hot-10
> > iotrace.rb --load pattern-hot-10 --play /b/sparse
>
>
> Which can I download iotrace.rb?
>
>
> > and monitor /proc/vmstat during the time. The test box has 2G memory.
> >
> >
> > ANALYZES
> > ========
> >
> > I carried out two runs on fresh booted console mode 2.6.29 with the VM_EXEC
> > patch, and fetched the vmstat numbers on
> >
> > (1) begin: shortly after the big read IO starts;
> > (2) end: just before the big read IO stops;
> > (3) restore: the big read IO stops and the zsh working set restored
> >
> > nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree
> > begin: 2481 2237 8694 630 0 574299
> > end: 275 231976 233914 633 776271 20933042
> > restore: 370 232154 234524 691 777183 20958453
> >
> > begin: 2434 2237 8493 629 0 574195
> > end: 284 231970 233536 632 771918 20896129
> > restore: 399 232218 234789 690 774526 20957909
> >
> > and another run on 2.6.30-rc4-mm with the VM_EXEC logic disabled:
>
> I don't think it is proper comparision.
> you need either following comparision. otherwise we insert many guess into the analysis.
>
> - 2.6.29 with and without VM_EXEC patch
> - 2.6.30-rc4-mm with and without VM_EXEC patch

OK, here is the comparison on 2.6.30-rc4-mm with VM_EXEC logic disabled/enabled.

2.6.30-rc4-mm, VM_EXEC protection OFF
-------------------------------------
nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree
begin: 2479 2344 9659 210 0 579643
end: 284 232010 234142 260 772776 20917184
restore: 379 232159 234371 301 774888 20967849

2.6.30-rc4-mm, VM_EXEC protection ON
------------------------------------
begin: 2444 6652 50021 207 0 619959
end: 284 231752 233394 210 773879 20890132
restore: 399 231973 234352 251 776879 20960568

We can reach basically the same conclusion from the above data.

Thanks,
Fengguang
---

raw data for the 2.6.30-rc4-mm VM_EXEC ON case:

% vmmon nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree

nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree
2250 2291 9013 200 0 573898
2250 2291 9013 200 0 573900
2250 2291 9013 200 0 573913
2437 2291 9327 207 0 574340
2441 2291 9517 207 0 574342
2441 2880 15925 207 0 579328
2444 6652 50021 207 0 619959
2444 10392 84169 207 0 660463
2444 14132 117262 207 0 702806
2444 17934 151968 207 0 743335
2444 21714 186052 207 0 783837
2444 25505 220606 207 0 824341
2444 29284 254297 207 0 866686
2444 33157 288730 207 0 907190
2444 36917 322858 207 0 949533
2444 40809 357878 207 0 990043
2444 44547 391997 207 0 1030545
2444 48368 421647 207 2464 1077033
2444 53199 415457 207 4032 1146417
2444 56723 412522 207 5312 1220349
2444 60233 409352 207 5312 1293510
2444 63755 404683 207 5312 1366553
2444 67336 401214 207 5312 1440753
2444 70869 397266 207 5312 1515153

nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree
2444 74450 394610 207 5312 1588258
2444 77958 391189 207 5312 1662693
2444 81519 387134 207 5312 1737203
2444 85081 383314 207 5312 1811529
2444 88591 379561 207 5312 1885074
2444 92161 376554 207 5312 1960083
2444 95452 372158 207 5312 2033133
2444 98925 369920 207 5312 2106356
2444 102187 366606 207 5312 2179896
2444 105737 362151 207 5312 2252653
2444 109257 358798 207 5312 2326643
2444 112859 355582 207 5312 2400045
2444 116318 352572 207 5312 2474330
2444 119890 347888 207 5312 2548928
2444 123419 344722 207 5312 2621237
2444 127001 341163 207 5312 2695899
2444 130553 336876 207 5312 2770178
2444 134052 334230 207 5312 2842983
2444 137553 330367 207 5312 2915827
2444 141094 327120 207 5312 2988966
2444 144502 323269 207 5312 3061070
2444 148075 319689 207 5312 3135630
2444 151649 315738 207 5312 3209493
2444 155219 312595 207 5312 3283546

nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree
2444 158728 308908 207 5312 3357537
2444 162216 305892 207 5312 3431238
2444 165759 301320 207 5312 3503900
2444 169268 298617 207 5312 3577602
2444 172748 294222 207 5312 3650985
2444 176290 290673 207 5312 3723645
2444 179823 287268 207 5312 3796933
2444 183301 283988 207 5312 3870730
2444 186843 279829 207 5312 3943552
2444 190426 276280 207 5312 4018059
2444 193955 273202 207 5312 4090994
2444 197383 269182 207 5312 4164812
2444 200904 265426 207 5312 4237489
2444 204375 261999 207 5312 4310454
2444 207875 258741 207 5312 4382745
2444 211367 255351 207 5312 4455714
2444 214876 251224 207 5312 4528503
2444 218408 247664 207 5312 4602332
2444 221906 244700 207 5312 4675462
2444 225419 240555 207 5312 4748250
2444 228856 237982 207 5312 4820833
2444 232143 233737 207 5550 4893429
2444 232128 233872 207 9114 4966779
2444 232078 234631 207 12642 5040609

nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree
2444 231981 233576 207 16258 5113398
2444 231999 234358 207 19794 5186057
2444 231923 233510 207 23290 5258642
2444 231858 234035 207 26786 5331127
2426 231846 233471 207 30338 5403852
2426 231937 234323 207 33770 5476403
2426 231766 233470 207 37418 5550924
2426 231826 233872 207 40906 5623180
2426 231813 234446 207 44362 5696097
2426 231771 233369 207 47938 5768853
2426 231766 234365 207 51410 5841381
2426 231667 233473 207 54996 5914049
2426 231777 233364 207 58452 5988563
2426 231777 234418 207 61980 6061034
2426 231791 234341 207 65460 6135636
2426 231703 233374 207 69076 6208350
2426 231764 233762 207 72564 6281377
1769 231746 233342 207 76004 6353551
1104 231654 233722 207 79676 6427765
1104 231557 233789 207 83332 6502311
1104 231836 234211 207 86588 6575126
1104 231668 233772 207 90212 6649213
1104 231545 233735 207 93884 6722035
1104 231700 233686 207 97212 6794403

nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree
1104 231595 233749 207 100804 6867099
1104 231471 233649 207 104508 6941830
1104 231688 234647 207 107764 7014098
1104 231567 233713 207 111372 7086796
1104 231453 233667 207 115076 7161462
1104 231638 234665 207 118364 7233770
1104 231461 233659 207 122028 7306593
1104 231731 233324 207 125324 7380134
1104 231642 234630 207 128900 7453391
1104 231459 233629 207 132580 7527753
1104 231769 233350 207 135836 7601530
1104 231670 233833 207 139484 7673804
1104 231822 234320 207 142836 7746650
1104 231703 233352 207 146452 7819376
1104 231628 233907 207 150076 7893367
1104 231780 234362 207 153428 7966268
1104 231749 234316 207 156964 8040835
1104 231745 233343 207 160516 8113464
1104 231679 233889 207 164100 8187486
1104 231593 234422 207 167652 8260483
1104 231712 233312 207 171068 8333148
1104 231645 233795 207 174684 8407233
1104 231836 234275 207 178028 8480039
1104 231716 233308 207 181604 8552764

nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree
1104 231618 233726 207 185292 8626946
1104 231843 234268 207 188540 8699655
1104 231674 233734 207 192196 8772013
1104 231662 233746 207 195788 8846514
1104 231892 233620 207 199124 8919860
1104 231616 233728 207 202804 8991883
1104 231549 233699 207 206420 9066293
1104 231757 234610 207 209716 9138618
1104 231620 233724 207 213340 9212822
1104 231499 233653 207 217020 9286005
1104 231660 234739 207 220332 9358235
1104 231587 233661 207 223892 9431023
1104 231505 233615 207 227564 9505653
1104 231650 234685 207 230892 9577914
1104 231497 233623 207 234532 9650768
1104 231574 233163 207 238035 9724587
1104 231639 234696 207 241443 9797531
1104 231480 233640 207 245099 9870384
1104 231726 233329 207 248419 9943926
1104 231621 234618 207 252011 10017243
1104 231420 233540 207 255699 10090161
1104 231638 233642 207 258923 10162294
284 231494 233594 207 262595 10235150
275 231687 234616 207 265875 10307412

nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree
275 231454 233698 207 269595 10380201
275 231655 234744 207 272867 10452430
275 231574 233738 207 276435 10525155
275 231726 234737 207 279787 10597480
275 231546 233766 207 283433 10670269
275 231666 233295 207 286893 10744085
275 231675 233637 207 290357 10817230
275 231554 233726 207 293965 10889960
275 231696 233297 207 297413 10963738
275 231548 233764 207 300941 11035910
275 231536 233648 207 304533 11109697
275 231713 234718 207 307829 11181942
275 231600 233744 207 311429 11254679
275 231494 233690 207 315125 11329352
275 231781 234074 207 318373 11402151
275 231542 233706 207 322037 11476281
275 231796 233387 207 325349 11548003
275 231706 234629 207 328957 11621381
275 231503 233692 207 332637 11695235
275 231789 233373 207 335917 11767682
275 231730 233848 207 339525 11841744
275 231858 234327 207 342901 11914649
275 231785 233409 207 346461 11988352
275 231602 234616 207 350141 12060761

nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree
275 231810 234375 207 353437 12134278
275 231775 233419 207 357021 12206908
275 231926 233941 207 360405 12280740
275 231823 234393 207 364005 12353897
275 231662 233532 207 367653 12426715
275 231812 233991 207 371069 12500421
275 231804 234349 207 374533 12573548
275 231795 233400 207 378077 12646144
275 231729 233946 207 381661 12720171
275 231707 234511 207 385149 12793073
275 231786 233377 207 388605 12866206
275 231711 233932 207 392229 12939820
275 231870 234348 207 395605 13012722
275 231766 233365 207 399165 13085459
275 231661 233790 207 402829 13159645
275 231884 234270 207 406141 13232418
275 231763 233784 207 409749 13306504
275 231696 233787 207 413365 13379233
275 231950 233756 207 416677 13452487
275 231741 233785 207 420269 13524912
275 231615 233740 207 423965 13598978
275 231847 234691 207 427237 13671267
275 231709 233806 207 430893 13745773
275 231549 233678 207 434581 13818721

nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree
275 231827 233943 207 437869 13891638
275 231653 233798 207 441437 13965122
275 231555 233768 207 445125 14038243
275 231740 234766 207 448413 14110536
275 231587 233704 207 452053 14183389
275 231471 233660 207 455749 14258050
275 231751 234659 207 458973 14330216
275 231545 233682 207 462645 14403068
275 231799 233395 207 465957 14476579
275 231625 233730 207 469556 14549896
275 231486 233677 207 473244 14622749
275 231733 234133 207 476532 14695505
275 231528 233699 207 480172 14769641
275 231766 233396 207 483500 14841341
275 231662 233629 207 487060 14914691
275 231476 233719 207 490764 14987447
275 231647 233740 207 494004 15059709
275 231478 233717 207 497732 15132562
275 231680 233771 207 500972 15204760
275 231590 233797 207 504580 15277497
275 231735 234771 207 507908 15349860
275 231566 233725 207 511564 15422712
275 231840 234570 207 514794 15495070
275 231677 233813 207 518430 15567636

nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree
275 231892 234006 207 521774 15640698
275 231653 233766 207 525438 15712814
275 231586 233801 207 529054 15787349
275 231811 234760 207 532302 15859611
275 231672 233780 207 535958 15932401
275 231822 234365 207 539270 16005142
275 231739 233360 207 542862 16077868
275 231837 233428 207 546318 16151136
275 231683 233768 207 549878 16222632
275 231551 233841 207 553574 16297201
275 231827 234327 207 556766 16369911
275 231713 233786 207 560382 16442191
275 231888 234281 207 563710 16515003
275 231715 233818 207 567374 16587315
275 231664 233819 207 570966 16661855
275 231795 234346 207 574326 16734662
275 231618 233844 207 577982 16806982
275 231606 233717 207 581574 16881646
275 231802 234310 207 584862 16954315
275 231633 233797 207 588518 17026659
275 231597 233769 207 592134 17101225
275 231734 234687 207 595470 17173647
275 231607 233727 207 599094 17246374
275 231491 233651 207 602790 17321067

nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree
275 231748 233746 207 606006 17393169
275 231483 233723 207 609758 17466136
275 231708 234745 207 613006 17538366
275 231621 233809 207 616590 17611026
275 231481 233661 207 620310 17685821
275 231738 234779 207 623526 17757922
275 231561 233805 207 627190 17830711
275 231871 233686 207 630446 17903980
275 231595 233739 207 634126 17975859
275 231495 233743 207 637806 18050456
275 231822 234151 207 641014 18123181
275 231535 233735 207 644726 18196609
275 231805 233400 207 648022 18269081
275 231646 234679 207 651678 18342463
275 231501 233673 207 655310 18415252
275 231795 233410 207 658582 18488697
275 231619 233651 207 662214 18562111
275 231811 233394 207 665526 18634440
275 231714 234227 207 669182 18707545
275 231443 233603 207 672878 18781620
275 231793 233412 207 676094 18853428
275 231680 233654 207 679694 18926777
275 231778 233380 207 683086 18998607
275 231768 233949 207 686638 19072500

nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree
275 231513 233725 207 690318 19144649
275 231775 233430 207 693622 19218158
275 231600 233702 207 697222 19291540
275 231768 233405 207 700589 19363304
275 231689 233677 207 704165 19436591
275 231480 233726 207 707861 19509411
275 231766 233535 207 711141 19582761
284 231538 233727 210 714773 19654593
284 231806 233394 210 718061 19728136
284 231602 233695 210 721669 19799676
284 231771 234773 210 724973 19871907
284 231610 233751 210 728621 19944728
284 231779 234349 210 731925 20017438
284 231665 233856 210 735557 20089683
284 231812 234294 210 738861 20162544
284 231692 233838 210 742509 20234788
284 231840 234361 210 745803 20307594
284 231754 233808 210 749407 20379870
284 231812 234421 210 752791 20452676
284 231756 233432 210 756375 20525369
284 231771 234461 210 759847 20597791
284 231780 233398 210 763311 20671332
284 231657 233905 210 766983 20744601
284 231826 234375 210 770287 20817438

nr_mapped nr_active_file nr_inactive_file pgmajfault pgdeactivate pgfree
284 231752 233394 210 773879 20890132
408 231801 234393 246 776879 20959316
399 231973 234352 251 776879 20960036
399 231973 234352 251 776879 20960036
399 231973 234352 251 776879 20960201
399 231973 234352 251 776879 20960201
399 231973 234352 251 776879 20960202
399 231973 234352 251 776879 20960435
399 231973 234352 251 776879 20960436
399 231973 234352 251 776879 20960436
399 231973 234352 251 776879 20960525
399 231973 234352 251 776879 20960525
399 231973 234352 251 776879 20960539
399 231973 234352 251 776879 20960548
399 231973 234352 251 776879 20960550
399 231973 234352 251 776879 20960550
399 231973 234352 251 776879 20960554
399 231973 234352 251 776879 20960554
399 231973 234352 251 776879 20960555
399 231973 234352 251 776879 20960562
399 231973 234352 251 776879 20960562
399 231973 234352 251 776879 20960563
399 231973 234352 251 776879 20960567
399 231973 234352 251 776879 20960568

--
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/