Loading Documentation/sysctl/vm.txt +21 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ Currently, these files are in /proc/sys/vm: - swappiness - user_reserve_kbytes - vfs_cache_pressure - watermark_boost_factor - watermark_scale_factor - zone_reclaim_mode - want_old_faultaround_pte Loading Loading @@ -892,6 +893,26 @@ ten times more freeable objects than there are. ============================================================= watermark_boost_factor: This factor controls the level of reclaim when memory is being fragmented. It defines the percentage of the high watermark of a zone that will be reclaimed if pages of different mobility are being mixed within pageblocks. The intent is that compaction has less work to do in the future and to increase the success rate of future high-order allocations such as SLUB allocations, THP and hugetlbfs pages. To make it sensible with respect to the watermark_scale_factor parameter, the unit is in fractions of 10,000. The default value of 15,000 means that up to 150% of the high watermark will be reclaimed in the event of a pageblock being mixed due to fragmentation. The level of reclaim is determined by the number of fragmentation events that occurred in the recent past. If this value is smaller than a pageblock then a pageblocks worth of pages will be reclaimed (e.g. 2MB on 64-bit x86). A boost factor of 0 will disable the feature. ============================================================= watermark_scale_factor: This factor controls the aggressiveness of kswapd. It defines the Loading include/linux/mm.h +1 −0 Original line number Diff line number Diff line Loading @@ -2295,6 +2295,7 @@ extern void zone_pcp_reset(struct zone *zone); /* page_alloc.c */ extern int min_free_kbytes; extern int watermark_boost_factor; extern int watermark_scale_factor; /* nommu.c */ Loading include/linux/mmzone.h +14 −4 Original line number Diff line number Diff line Loading @@ -271,9 +271,10 @@ enum zone_watermarks { NR_WMARK }; #define min_wmark_pages(z) (z->watermark[WMARK_MIN]) #define low_wmark_pages(z) (z->watermark[WMARK_LOW]) #define high_wmark_pages(z) (z->watermark[WMARK_HIGH]) #define min_wmark_pages(z) (z->_watermark[WMARK_MIN] + z->watermark_boost) #define low_wmark_pages(z) (z->_watermark[WMARK_LOW] + z->watermark_boost) #define high_wmark_pages(z) (z->_watermark[WMARK_HIGH] + z->watermark_boost) #define wmark_pages(z, i) (z->_watermark[i] + z->watermark_boost) struct per_cpu_pages { int count; /* number of pages in the list */ Loading Loading @@ -364,7 +365,8 @@ struct zone { /* Read-mostly fields */ /* zone watermarks, access with *_wmark_pages(zone) macros */ unsigned long watermark[NR_WMARK]; unsigned long _watermark[NR_WMARK]; unsigned long watermark_boost; unsigned long nr_reserved_highatomic; Loading Loading @@ -530,6 +532,12 @@ enum pgdat_flags { PGDAT_RECLAIM_LOCKED, /* prevents concurrent reclaim */ }; enum zone_flags { ZONE_BOOSTED_WATERMARK, /* zone recently boosted watermarks. * Cleared when kswapd is woken. */ }; static inline unsigned long zone_end_pfn(const struct zone *zone) { return zone->zone_start_pfn + zone->spanned_pages; Loading Loading @@ -893,6 +901,8 @@ static inline int is_highmem(struct zone *zone) struct ctl_table; int min_free_kbytes_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); int watermark_boost_factor_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); int watermark_scale_factor_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES]; Loading kernel/sched/psi.c +1 −1 Original line number Diff line number Diff line Loading @@ -455,7 +455,7 @@ static void trace_event_helper(struct psi_group *group) u64 memstall = group->total[PSI_POLL][PSI_MEM_SOME]; for_each_populated_zone(zone) { wmark = zone->watermark[WMARK_HIGH]; wmark = high_wmark_pages(zone); free = zone_page_state(zone, NR_FREE_PAGES); cma = zone_page_state(zone, NR_FREE_CMA_PAGES); file = zone_page_state(zone, NR_ZONE_ACTIVE_FILE) + Loading kernel/sysctl.c +8 −0 Original line number Diff line number Diff line Loading @@ -1641,6 +1641,14 @@ static struct ctl_table vm_table[] = { .proc_handler = min_free_kbytes_sysctl_handler, .extra1 = &zero, }, { .procname = "watermark_boost_factor", .data = &watermark_boost_factor, .maxlen = sizeof(watermark_boost_factor), .mode = 0644, .proc_handler = watermark_boost_factor_sysctl_handler, .extra1 = &zero, }, { .procname = "watermark_scale_factor", .data = &watermark_scale_factor, Loading Loading
Documentation/sysctl/vm.txt +21 −0 Original line number Diff line number Diff line Loading @@ -65,6 +65,7 @@ Currently, these files are in /proc/sys/vm: - swappiness - user_reserve_kbytes - vfs_cache_pressure - watermark_boost_factor - watermark_scale_factor - zone_reclaim_mode - want_old_faultaround_pte Loading Loading @@ -892,6 +893,26 @@ ten times more freeable objects than there are. ============================================================= watermark_boost_factor: This factor controls the level of reclaim when memory is being fragmented. It defines the percentage of the high watermark of a zone that will be reclaimed if pages of different mobility are being mixed within pageblocks. The intent is that compaction has less work to do in the future and to increase the success rate of future high-order allocations such as SLUB allocations, THP and hugetlbfs pages. To make it sensible with respect to the watermark_scale_factor parameter, the unit is in fractions of 10,000. The default value of 15,000 means that up to 150% of the high watermark will be reclaimed in the event of a pageblock being mixed due to fragmentation. The level of reclaim is determined by the number of fragmentation events that occurred in the recent past. If this value is smaller than a pageblock then a pageblocks worth of pages will be reclaimed (e.g. 2MB on 64-bit x86). A boost factor of 0 will disable the feature. ============================================================= watermark_scale_factor: This factor controls the aggressiveness of kswapd. It defines the Loading
include/linux/mm.h +1 −0 Original line number Diff line number Diff line Loading @@ -2295,6 +2295,7 @@ extern void zone_pcp_reset(struct zone *zone); /* page_alloc.c */ extern int min_free_kbytes; extern int watermark_boost_factor; extern int watermark_scale_factor; /* nommu.c */ Loading
include/linux/mmzone.h +14 −4 Original line number Diff line number Diff line Loading @@ -271,9 +271,10 @@ enum zone_watermarks { NR_WMARK }; #define min_wmark_pages(z) (z->watermark[WMARK_MIN]) #define low_wmark_pages(z) (z->watermark[WMARK_LOW]) #define high_wmark_pages(z) (z->watermark[WMARK_HIGH]) #define min_wmark_pages(z) (z->_watermark[WMARK_MIN] + z->watermark_boost) #define low_wmark_pages(z) (z->_watermark[WMARK_LOW] + z->watermark_boost) #define high_wmark_pages(z) (z->_watermark[WMARK_HIGH] + z->watermark_boost) #define wmark_pages(z, i) (z->_watermark[i] + z->watermark_boost) struct per_cpu_pages { int count; /* number of pages in the list */ Loading Loading @@ -364,7 +365,8 @@ struct zone { /* Read-mostly fields */ /* zone watermarks, access with *_wmark_pages(zone) macros */ unsigned long watermark[NR_WMARK]; unsigned long _watermark[NR_WMARK]; unsigned long watermark_boost; unsigned long nr_reserved_highatomic; Loading Loading @@ -530,6 +532,12 @@ enum pgdat_flags { PGDAT_RECLAIM_LOCKED, /* prevents concurrent reclaim */ }; enum zone_flags { ZONE_BOOSTED_WATERMARK, /* zone recently boosted watermarks. * Cleared when kswapd is woken. */ }; static inline unsigned long zone_end_pfn(const struct zone *zone) { return zone->zone_start_pfn + zone->spanned_pages; Loading Loading @@ -893,6 +901,8 @@ static inline int is_highmem(struct zone *zone) struct ctl_table; int min_free_kbytes_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); int watermark_boost_factor_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); int watermark_scale_factor_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); extern int sysctl_lowmem_reserve_ratio[MAX_NR_ZONES]; Loading
kernel/sched/psi.c +1 −1 Original line number Diff line number Diff line Loading @@ -455,7 +455,7 @@ static void trace_event_helper(struct psi_group *group) u64 memstall = group->total[PSI_POLL][PSI_MEM_SOME]; for_each_populated_zone(zone) { wmark = zone->watermark[WMARK_HIGH]; wmark = high_wmark_pages(zone); free = zone_page_state(zone, NR_FREE_PAGES); cma = zone_page_state(zone, NR_FREE_CMA_PAGES); file = zone_page_state(zone, NR_ZONE_ACTIVE_FILE) + Loading
kernel/sysctl.c +8 −0 Original line number Diff line number Diff line Loading @@ -1641,6 +1641,14 @@ static struct ctl_table vm_table[] = { .proc_handler = min_free_kbytes_sysctl_handler, .extra1 = &zero, }, { .procname = "watermark_boost_factor", .data = &watermark_boost_factor, .maxlen = sizeof(watermark_boost_factor), .mode = 0644, .proc_handler = watermark_boost_factor_sysctl_handler, .extra1 = &zero, }, { .procname = "watermark_scale_factor", .data = &watermark_scale_factor, Loading