diff options
author | Joonsoo Kim <iamjoonsoo.kim@lge.com> | 2018-04-10 19:30:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-11 13:28:32 -0400 |
commit | b7d349c741293b694c552593dbd7d38ea7eb7143 (patch) | |
tree | a1e1391762d3a6f1c5094e6f50504728f6e77e1c /mm | |
parent | 3d2054ad8c2d5100b68b0c0405f89fd90bf4107b (diff) |
mm/thp: don't count ZONE_MOVABLE as the target for freepage reserving
There was a regression report for "mm/cma: manage the memory of the CMA
area by using the ZONE_MOVABLE" [1] and I think that it is related to
this problem. CMA patchset makes the system use one more zone
(ZONE_MOVABLE) and then increases min_free_kbytes. It reduces usable
memory and it could cause regression.
ZONE_MOVABLE only has movable pages so we don't need to keep enough
freepages to avoid or deal with fragmentation. So, don't count it.
This changes min_free_kbytes and thus min_watermark greatly if
ZONE_MOVABLE is used. It will make the user uses more memory.
System:
22GB ram, fakenuma, 2 nodes. 5 zones are used.
Before:
min_free_kbytes: 112640
zone_info (min_watermark):
Node 0, zone DMA
min 19
Node 0, zone DMA32
min 3778
Node 0, zone Normal
min 10191
Node 0, zone Movable
min 0
Node 0, zone Device
min 0
Node 1, zone DMA
min 0
Node 1, zone DMA32
min 0
Node 1, zone Normal
min 14043
Node 1, zone Movable
min 127
Node 1, zone Device
min 0
After:
min_free_kbytes: 90112
zone_info (min_watermark):
Node 0, zone DMA
min 15
Node 0, zone DMA32
min 3022
Node 0, zone Normal
min 8152
Node 0, zone Movable
min 0
Node 0, zone Device
min 0
Node 1, zone DMA
min 0
Node 1, zone DMA32
min 0
Node 1, zone Normal
min 11234
Node 1, zone Movable
min 102
Node 1, zone Device
min 0
[1] (lkml.kernel.org/r/20180102063528.GG30397%20()%20yexl-desktop)
Link: http://lkml.kernel.org/r/1522913236-15776-1-git-send-email-iamjoonsoo.kim@lge.com
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/khugepaged.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mm/khugepaged.c b/mm/khugepaged.c index c15da1ea7e63..eb32d0707c80 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c | |||
@@ -1879,8 +1879,16 @@ static void set_recommended_min_free_kbytes(void) | |||
1879 | int nr_zones = 0; | 1879 | int nr_zones = 0; |
1880 | unsigned long recommended_min; | 1880 | unsigned long recommended_min; |
1881 | 1881 | ||
1882 | for_each_populated_zone(zone) | 1882 | for_each_populated_zone(zone) { |
1883 | /* | ||
1884 | * We don't need to worry about fragmentation of | ||
1885 | * ZONE_MOVABLE since it only has movable pages. | ||
1886 | */ | ||
1887 | if (zone_idx(zone) > gfp_zone(GFP_USER)) | ||
1888 | continue; | ||
1889 | |||
1883 | nr_zones++; | 1890 | nr_zones++; |
1891 | } | ||
1884 | 1892 | ||
1885 | /* Ensure 2 pageblocks are free to assist fragmentation avoidance */ | 1893 | /* Ensure 2 pageblocks are free to assist fragmentation avoidance */ |
1886 | recommended_min = pageblock_nr_pages * nr_zones * 2; | 1894 | recommended_min = pageblock_nr_pages * nr_zones * 2; |