All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch v2 0/3] mm: improve page aging fairness between zones/nodes
@ 2013-08-02 15:37 ` Johannes Weiner
  0 siblings, 0 replies; 82+ messages in thread
From: Johannes Weiner @ 2013-08-02 15:37 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Mel Gorman, Rik van Riel, Andrea Arcangeli, Zlatko Calusic,
	Minchan Kim, linux-mm, linux-kernel

Changes in version 2:
o remove per-cpu counter inaccuracy noise from Changelog of kswapd
  NUMA fix (Andrew)
o make fairness allocator work correctly with zone_reclaim_mode
  enabled (Andrea)
o make allocation batch accounting non-atomic (Andrea)

The way the page allocator interacts with kswapd creates aging
imbalances, where the amount of time a userspace page gets in memory
under reclaim pressure is dependent on which zone, which node the
allocator took the page frame from.

#1 fixes missed kswapd wakeups on NUMA systems, which lead to some
   nodes falling behind for a full reclaim cycle relative to the other
   nodes in the system

#3 fixes an interaction where kswapd and a continuous stream of page
   allocations keep the preferred zone of a task between the high and
   low watermark (allocations succeed + kswapd does not go to sleep)
   indefinitely, completely underutilizing the lower zones and
   thrashing on the preferred zone

The following test ran a foreground workload (memcachetest) with
background IO of various sizes on a 4 node 8G system (similar results
were observed with single-node 4G systems):

parallelio
                                              BASE                   FAIRALLOC
Ops memcachetest-0M              5170.00 (  0.00%)           5283.00 (  2.19%)
Ops memcachetest-791M            4740.00 (  0.00%)           5293.00 ( 11.67%)
Ops memcachetest-2639M           2551.00 (  0.00%)           4950.00 ( 94.04%)
Ops memcachetest-4487M           2606.00 (  0.00%)           3922.00 ( 50.50%)
Ops io-duration-0M                  0.00 (  0.00%)              0.00 (  0.00%)
Ops io-duration-791M               55.00 (  0.00%)             18.00 ( 67.27%)
Ops io-duration-2639M             235.00 (  0.00%)            103.00 ( 56.17%)
Ops io-duration-4487M             278.00 (  0.00%)            173.00 ( 37.77%)
Ops swaptotal-0M                    0.00 (  0.00%)              0.00 (  0.00%)
Ops swaptotal-791M             245184.00 (  0.00%)              0.00 (  0.00%)
Ops swaptotal-2639M            468069.00 (  0.00%)         108778.00 ( 76.76%)
Ops swaptotal-4487M            452529.00 (  0.00%)          76623.00 ( 83.07%)
Ops swapin-0M                       0.00 (  0.00%)              0.00 (  0.00%)
Ops swapin-791M                108297.00 (  0.00%)              0.00 (  0.00%)
Ops swapin-2639M               169537.00 (  0.00%)          50031.00 ( 70.49%)
Ops swapin-4487M               167435.00 (  0.00%)          34178.00 ( 79.59%)
Ops minorfaults-0M            1518666.00 (  0.00%)        1503993.00 (  0.97%)
Ops minorfaults-791M          1676963.00 (  0.00%)        1520115.00 (  9.35%)
Ops minorfaults-2639M         1606035.00 (  0.00%)        1799717.00 (-12.06%)
Ops minorfaults-4487M         1612118.00 (  0.00%)        1583825.00 (  1.76%)
Ops majorfaults-0M                  6.00 (  0.00%)              0.00 (  0.00%)
Ops majorfaults-791M            13836.00 (  0.00%)             10.00 ( 99.93%)
Ops majorfaults-2639M           22307.00 (  0.00%)           6490.00 ( 70.91%)
Ops majorfaults-4487M           21631.00 (  0.00%)           4380.00 ( 79.75%)

Positive percentage means improvement, negative regression.

                BASE   FAIRALLOC
User          287.78      460.97
System       2151.67     3142.51
Elapsed      9737.00     8879.34

Memcachetest, the foreground workload, runs for a fixed duration,
which is why user and system time increased so much: memcachetest
spends more time doing actual work and less time waiting for IO.

The elapsed time came down because the background IO on the other hand
is fixed in size and throughput increased.

                                  BASE   FAIRALLOC
Minor Faults                  53721925    57188551
Major Faults                    392195       15157
Swap Ins                       2994854      112770
Swap Outs                      4907092      134982
Direct pages scanned                 0       41824
Kswapd pages scanned          32975063     8128269
Kswapd pages reclaimed         6323069     7093495
Direct pages reclaimed               0       41824
Kswapd efficiency                  19%         87%
Kswapd velocity               3386.573     915.414
Direct efficiency                 100%        100%
Direct velocity                  0.000       4.710
Percentage direct scans             0%          0%
Zone normal velocity          2011.338     550.661
Zone dma32 velocity           1365.623     369.221
Zone dma velocity                9.612       0.242
Page writes by reclaim    18732404.000  614807.000
Page writes file              13825312      479825
Page writes anon               4907092      134982
Page reclaim immediate           85490        5647
Sector Reads                  12080532      483244
Sector Writes                 88740508    65438876
Page rescued immediate               0           0
Slabs scanned                    82560       12160
Direct inode steals                  0           0
Kswapd inode steals              24401       40013
Kswapd skipped wait                  0           0
THP fault alloc                      6           8
THP collapse alloc                5481        5812
THP splits                          75          22
THP fault fallback                   0           0
THP collapse fail                    0           0
Compaction stalls                    0          54
Compaction success                   0          45
Compaction failures                  0           9
Page migrate success            881492       82278
Page migrate failure                 0           0
Compaction pages isolated            0       60334
Compaction migrate scanned           0       53505
Compaction free scanned              0     1537605
Compaction cost                    914          86
NUMA PTE updates              46738231    41988419
NUMA hint faults              31175564    24213387
NUMA hint local faults        10427393     6411593
NUMA pages migrated             881492       55344
AutoNUMA cost                   156221      121361

The overall runtime was reduced, throughput for both the foreground
workload as well as the background IO improved, major faults, swapping
and reclaim activity shrunk significantly, reclaim efficiency more
than quadrupled.

 include/linux/mmzone.h |  1 +
 mm/page_alloc.c        | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------
 mm/vmscan.c            |  2 +-
 3 files changed, 69 insertions(+), 19 deletions(-)


^ permalink raw reply	[flat|nested] 82+ messages in thread

end of thread, other threads:[~2014-06-16  7:12 UTC | newest]

Thread overview: 82+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-02 15:37 [patch v2 0/3] mm: improve page aging fairness between zones/nodes Johannes Weiner
2013-08-02 15:37 ` Johannes Weiner
2013-08-02 15:37 ` [patch v2 1/3] mm: vmscan: fix numa reclaim balance problem in kswapd Johannes Weiner
2013-08-02 15:37   ` Johannes Weiner
2013-08-07 14:15   ` Mel Gorman
2013-08-07 14:15     ` Mel Gorman
2013-08-02 15:37 ` [patch v2 2/3] mm: page_alloc: rearrange watermark checking in get_page_from_freelist Johannes Weiner
2013-08-02 15:37   ` Johannes Weiner
2013-08-07 14:20   ` Mel Gorman
2013-08-07 14:20     ` Mel Gorman
2013-08-02 15:37 ` [patch v2 3/3] mm: page_alloc: fair zone allocator policy Johannes Weiner
2013-08-02 15:37   ` Johannes Weiner
2013-08-02 17:51   ` Rik van Riel
2013-08-02 17:51     ` Rik van Riel
2013-08-05  1:15   ` Minchan Kim
2013-08-05  1:15     ` Minchan Kim
2013-08-05  3:43     ` Johannes Weiner
2013-08-05  3:43       ` Johannes Weiner
2013-08-05  4:48       ` Minchan Kim
2013-08-05  4:48         ` Minchan Kim
2013-08-05  5:01         ` Johannes Weiner
2013-08-05  5:01           ` Johannes Weiner
2013-08-05 10:34   ` Wanpeng Li
2013-08-05 10:34   ` Wanpeng Li
2013-08-05 11:34     ` Andrea Arcangeli
2013-08-05 11:34       ` Andrea Arcangeli
2013-08-05 13:11       ` Wanpeng Li
2013-08-05 13:11       ` Wanpeng Li
2013-08-07 14:58   ` Mel Gorman
2013-08-07 14:58     ` Mel Gorman
2013-08-07 15:37     ` Johannes Weiner
2013-08-07 15:37       ` Johannes Weiner
2013-08-08  4:16       ` Johannes Weiner
2013-08-08  4:16         ` Johannes Weiner
2013-08-08  9:21         ` Mel Gorman
2013-08-08  9:21           ` Mel Gorman
2013-08-09 18:45         ` Rik van Riel
2013-08-09 18:45           ` Rik van Riel
2013-08-16 17:07         ` Kevin Hilman
2013-08-16 17:17         ` Kevin Hilman
2013-08-16 20:18           ` Johannes Weiner
2013-08-16 20:18             ` Johannes Weiner
2013-08-16 20:18             ` Johannes Weiner
2013-08-16 21:24             ` Stephen Warren
2013-08-16 21:24               ` Stephen Warren
2013-08-16 21:24               ` Stephen Warren
2013-08-16 21:52             ` Kevin Hilman
2013-08-16 21:52               ` Kevin Hilman
2013-08-16 21:52               ` Kevin Hilman
2013-08-19  0:48               ` Stephen Rothwell
2013-08-19  0:48                 ` Stephen Rothwell
2014-04-02 14:26   ` Thomas Schwinge
2014-04-02 14:26     ` Thomas Schwinge
2014-04-24 13:37     ` radeon: screen garbled after page allocator change, was: " Johannes Weiner
2014-04-24 13:37       ` Johannes Weiner
2014-04-24 13:37       ` Johannes Weiner
2014-04-25 21:47       ` Jerome Glisse
2014-04-25 21:47         ` Jerome Glisse
2014-04-25 21:47         ` Jerome Glisse
2014-04-25 21:50         ` Jerome Glisse
2014-04-25 21:50           ` Jerome Glisse
2014-04-25 23:03           ` Jerome Glisse
2014-04-25 23:03             ` Jerome Glisse
2014-04-25 23:03             ` Jerome Glisse
2014-04-28  8:03             ` Thomas Schwinge
2014-04-28  9:09               ` Thomas Schwinge
2014-04-27  3:31       ` Jerome Glisse
2014-04-27  3:31         ` Jerome Glisse
2014-04-27  3:31         ` Jerome Glisse
2014-04-27 19:55         ` Jerome Glisse
2014-04-27 19:55           ` Jerome Glisse
2014-04-27 19:55           ` Jerome Glisse
2014-04-28  7:30           ` Christian König
2014-04-28  7:30             ` Christian König
2014-04-28 12:51             ` Deucher, Alexander
2014-04-28 12:51               ` Deucher, Alexander
2014-04-28 12:52             ` Deucher, Alexander
2014-04-28 12:52               ` Deucher, Alexander
2014-04-28  8:09           ` Thomas Schwinge
2014-06-16  7:11             ` Thomas Schwinge
2013-08-02 19:59 ` [patch v2 0/3] mm: improve page aging fairness between zones/nodes Andrea Arcangeli
2013-08-02 19:59   ` Andrea Arcangeli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.