The quilt patch titled Subject: memcg-increase-the-valid-index-range-for-memcg-stats-v5 has been removed from the -mm tree. Its filename was memcg-increase-the-valid-index-range-for-memcg-stats-v5.patch This patch was dropped because it was folded into memcg-increase-the-valid-index-range-for-memcg-stats.patch ------------------------------------------------------ From: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx> Subject: memcg-increase-the-valid-index-range-for-memcg-stats-v5 Date: Tue, 30 Jul 2024 15:01:56 +0000 address a comment from Yosry Ahmed, renamed IS_INVALID(idx) to BAD_STAT_IDX(index), also made it more relaxed (>= instead of ==). Signed-off-by: Shakeel Butt <shakeel.butt@xxxxxxxxx> Co-developed-by: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx> Signed-off-by: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx> Cc: Domenico Cerasuolo <cerasuolodomenico@xxxxxxxxx> Cc: Kent Overstreet <kent.overstreet@xxxxxxxxx> Cc: Li Zhijian <lizhijian@xxxxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: Nhat Pham <nphamcs@xxxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: Suren Baghdasaryan <surenb@xxxxxxxxxx> Cc: Vlastimil Babka <vbabka@xxxxxxx> Cc: Zi Yan <ziy@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/memcontrol.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) --- a/mm/memcontrol.c~memcg-increase-the-valid-index-range-for-memcg-stats-v5 +++ a/mm/memcontrol.c @@ -320,7 +320,7 @@ static const unsigned int memcg_stat_ite #define NR_MEMCG_NODE_STAT_ITEMS ARRAY_SIZE(memcg_node_stat_items) #define MEMCG_VMSTAT_SIZE (NR_MEMCG_NODE_STAT_ITEMS + \ ARRAY_SIZE(memcg_stat_items)) -#define IS_INVALID(index) ((index) == U8_MAX) +#define BAD_STAT_IDX(index) ((u32)(index) >= U8_MAX) static u8 mem_cgroup_stats_index[MEMCG_NR_STAT] __read_mostly; static void init_memcg_stats(void) @@ -372,7 +372,7 @@ unsigned long lruvec_page_state(struct l return node_page_state(lruvec_pgdat(lruvec), idx); i = memcg_stats_index(idx); - if (WARN_ONCE(IS_INVALID(i), "%s: missing stat item %d\n", __func__, idx)) + if (WARN_ONCE(BAD_STAT_IDX(i), "%s: missing stat item %d\n", __func__, idx)) return 0; pn = container_of(lruvec, struct mem_cgroup_per_node, lruvec); @@ -395,7 +395,7 @@ unsigned long lruvec_page_state_local(st return node_page_state(lruvec_pgdat(lruvec), idx); i = memcg_stats_index(idx); - if (WARN_ONCE(IS_INVALID(i), "%s: missing stat item %d\n", __func__, idx)) + if (WARN_ONCE(BAD_STAT_IDX(i), "%s: missing stat item %d\n", __func__, idx)) return 0; pn = container_of(lruvec, struct mem_cgroup_per_node, lruvec); @@ -627,7 +627,7 @@ unsigned long memcg_page_state(struct me long x; int i = memcg_stats_index(idx); - if (WARN_ONCE(IS_INVALID(i), "%s: missing stat item %d\n", __func__, idx)) + if (WARN_ONCE(BAD_STAT_IDX(i), "%s: missing stat item %d\n", __func__, idx)) return 0; x = READ_ONCE(memcg->vmstats->state[i]); @@ -668,7 +668,7 @@ void __mod_memcg_state(struct mem_cgroup if (mem_cgroup_disabled()) return; - if (WARN_ONCE(IS_INVALID(i), "%s: missing stat item %d\n", __func__, idx)) + if (WARN_ONCE(BAD_STAT_IDX(i), "%s: missing stat item %d\n", __func__, idx)) return; __this_cpu_add(memcg->vmstats_percpu->state[i], val); @@ -681,7 +681,7 @@ unsigned long memcg_page_state_local(str long x; int i = memcg_stats_index(idx); - if (WARN_ONCE(IS_INVALID(i), "%s: missing stat item %d\n", __func__, idx)) + if (WARN_ONCE(BAD_STAT_IDX(i), "%s: missing stat item %d\n", __func__, idx)) return 0; x = READ_ONCE(memcg->vmstats->state_local[i]); @@ -700,7 +700,7 @@ static void __mod_memcg_lruvec_state(str struct mem_cgroup *memcg; int i = memcg_stats_index(idx); - if (WARN_ONCE(IS_INVALID(i), "%s: missing stat item %d\n", __func__, idx)) + if (WARN_ONCE(BAD_STAT_IDX(i), "%s: missing stat item %d\n", __func__, idx)) return; pn = container_of(lruvec, struct mem_cgroup_per_node, lruvec); @@ -816,7 +816,7 @@ void __count_memcg_events(struct mem_cgr if (mem_cgroup_disabled()) return; - if (WARN_ONCE(IS_INVALID(i), "%s: missing stat item %d\n", __func__, idx)) + if (WARN_ONCE(BAD_STAT_IDX(i), "%s: missing stat item %d\n", __func__, idx)) return; memcg_stats_lock(); @@ -829,7 +829,7 @@ unsigned long memcg_events(struct mem_cg { int i = memcg_events_index(event); - if (WARN_ONCE(IS_INVALID(i), "%s: missing stat item %d\n", __func__, event)) + if (WARN_ONCE(BAD_STAT_IDX(i), "%s: missing stat item %d\n", __func__, event)) return 0; return READ_ONCE(memcg->vmstats->events[i]); @@ -839,7 +839,7 @@ unsigned long memcg_events_local(struct { int i = memcg_events_index(event); - if (WARN_ONCE(IS_INVALID(i), "%s: missing stat item %d\n", __func__, event)) + if (WARN_ONCE(BAD_STAT_IDX(i), "%s: missing stat item %d\n", __func__, event)) return 0; return READ_ONCE(memcg->vmstats->events_local[i]); _ Patches currently in -mm which might be from pasha.tatashin@xxxxxxxxxx are memcg-increase-the-valid-index-range-for-memcg-stats.patch vmstat-kernel-stack-usage-histogram.patch task_stack-uninline-stack_not_used.patch