path: root/mm/oom_kill.c
diff options
authorRoman Gushchin <>2020-08-06 23:20:39 -0700
committerLinus Torvalds <>2020-08-07 11:33:24 -0700
commitd42f3245c7e299e017213fa028c319316bcdb7f4 (patch)
tree36e68f295f165e31a4d5f2e8190f2cca96ddaa8b /mm/oom_kill.c
parentea426c2a7de8e575108b7cecd3374e0c15a9f25e (diff)
mm: memcg: convert vmstat slab counters to bytes
In order to prepare for per-object slab memory accounting, convert NR_SLAB_RECLAIMABLE and NR_SLAB_UNRECLAIMABLE vmstat items to bytes. To make it obvious, rename them to NR_SLAB_RECLAIMABLE_B and NR_SLAB_UNRECLAIMABLE_B (similar to NR_KERNEL_STACK_KB). Internally global and per-node counters are stored in pages, however memcg and lruvec counters are stored in bytes. This scheme may look weird, but only for now. As soon as slab pages will be shared between multiple cgroups, global and node counters will reflect the total number of slab pages. However memcg and lruvec counters will be used for per-memcg slab memory tracking, which will take separate kernel objects in the account. Keeping global and node counters in pages helps to avoid additional overhead. The size of slab memory shouldn't exceed 4Gb on 32-bit machines, so it will fit into atomic_long_t we use for vmstats. Signed-off-by: Roman Gushchin <> Signed-off-by: Andrew Morton <> Reviewed-by: Shakeel Butt <> Acked-by: Johannes Weiner <> Acked-by: Vlastimil Babka <> Cc: Christoph Lameter <> Cc: Michal Hocko <> Cc: Tejun Heo <> Link: Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm/oom_kill.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 6e94962893ee..d30ce75f23fb 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -184,7 +184,7 @@ static bool is_dump_unreclaim_slabs(void)
global_node_page_state(NR_ISOLATED_FILE) +
- return (global_node_page_state(NR_SLAB_UNRECLAIMABLE) > nr_lru);
+ return (global_node_page_state_pages(NR_SLAB_UNRECLAIMABLE_B) > nr_lru);