Message ID | 20220808125602.97747-8-goliath@infraroot.at |
---|---|
State | New |
Headers | show |
Series | Backport MEMCG changes from v5.17 | expand |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 4b5888bf0a60..50d2d5432018 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -774,10 +774,17 @@ void __mod_memcg_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, */ __memcg_stats_lock(); if (IS_ENABLED(CONFIG_DEBUG_VM)) { - if (idx == NR_ANON_MAPPED || idx == NR_FILE_MAPPED) + switch (idx) { + case NR_ANON_MAPPED: + case NR_FILE_MAPPED: + case NR_ANON_THPS: + case NR_SHMEM_PMDMAPPED: + case NR_FILE_PMDMAPPED: WARN_ON_ONCE(!in_task()); - else + break; + default: WARN_ON_ONCE(!irqs_disabled()); + } } /* Update memcg */