Commit 7714304f authored by Hui Su's avatar Hui Su Committed by Linus Torvalds

mm/slab_common.c: use list_for_each_entry in dump_unreclaimable_slab()

dump_unreclaimable_slab() acquires the slab_mutex first, and it won't
remove any slab_caches list entry when itering the slab_caches lists.

Thus we do not need list_for_each_entry_safe here, which is against
removal of list entry.

Link: https://lkml.kernel.org/r/20200926043440.GA180545@rlkSigned-off-by: default avatarHui Su <sh_def@163.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent a86ecfa6
...@@ -978,7 +978,7 @@ static int slab_show(struct seq_file *m, void *p) ...@@ -978,7 +978,7 @@ static int slab_show(struct seq_file *m, void *p)
void dump_unreclaimable_slab(void) void dump_unreclaimable_slab(void)
{ {
struct kmem_cache *s, *s2; struct kmem_cache *s;
struct slabinfo sinfo; struct slabinfo sinfo;
/* /*
...@@ -996,7 +996,7 @@ void dump_unreclaimable_slab(void) ...@@ -996,7 +996,7 @@ void dump_unreclaimable_slab(void)
pr_info("Unreclaimable slab info:\n"); pr_info("Unreclaimable slab info:\n");
pr_info("Name Used Total\n"); pr_info("Name Used Total\n");
list_for_each_entry_safe(s, s2, &slab_caches, list) { list_for_each_entry(s, &slab_caches, list) {
if (s->flags & SLAB_RECLAIM_ACCOUNT) if (s->flags & SLAB_RECLAIM_ACCOUNT)
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment