Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed1aff26 authored by Laura Abbott's avatar Laura Abbott
Browse files

lowmemorykiller: Dump out slab state information



Leaks from the slab allocator are a very common cause of
out of memory issues and excessive lowmemorykiller killing.
Dump out the slab statistics as well to help with debugging.

Change-Id: Ia5e4eeb66092c76f2b761321c88fa75c4138927c
Signed-off-by: default avatarLaura Abbott <lauraa@codeaurora.org>
parent e5bc0581
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -380,6 +380,9 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
				"   Total reserve is %ldkB\n" \
				"   Total free pages is %ldkB\n" \
				"   Total file cache is %ldkB\n" \
				"   Slab Reclaimable is %ldkB\n" \
				"   Slab UnReclaimable is %ldkB\n" \
				"   Total Slab is %ldkB\n" \
				"   GFP mask is 0x%x\n",
			     selected->comm, selected->pid,
			     selected_oom_score_adj,
@@ -396,6 +399,14 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
				(long)(PAGE_SIZE / 1024),
			     global_page_state(NR_FILE_PAGES) *
				(long)(PAGE_SIZE / 1024),
			     global_page_state(NR_SLAB_RECLAIMABLE) *
				(long)(PAGE_SIZE / 1024),
			     global_page_state(NR_SLAB_UNRECLAIMABLE) *
				(long)(PAGE_SIZE / 1024),
			     global_page_state(NR_SLAB_RECLAIMABLE) *
				(long)(PAGE_SIZE / 1024) +
			     global_page_state(NR_SLAB_UNRECLAIMABLE) *
				(long)(PAGE_SIZE / 1024),
			     sc->gfp_mask);

		if (lowmem_debug_level >= 2 && selected_oom_score_adj == 0) {