]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
mm,page_owner: drop unnecessary check
authorOscar Salvador <osalvador@suse.de>
Wed, 6 Mar 2024 12:32:17 +0000 (13:32 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 6 Mar 2024 21:04:20 +0000 (13:04 -0800)
stackdepot only saves stack_records which size is greather than 0,
so we cannot possibly have empty stack_records.
Drop the check.

Link: https://lkml.kernel.org/r/20240306123217.29774-3-osalvador@suse.de
Signed-off-by: Oscar Salvador <osalvador@suse.de>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@gmail.com>
Cc: kernel test robot <oliver.sang@intel.com>
Cc: Marco Elver <elver@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_owner.c

index 7163a1c44ccf1d8c407e2d5f16fc72de43ba2f0b..e7139952ffd9dee593fd51fa88a9c69d8d830cd3 100644 (file)
@@ -865,8 +865,7 @@ static int stack_print(struct seq_file *m, void *v)
        entries = stack_record->entries;
        stack_count = refcount_read(&stack_record->count) - 1;
 
-       if (!nr_entries || nr_entries < 0 || stack_count < 1 ||
-           stack_count < page_owner_stack_threshold)
+       if (stack_count < 1 || stack_count < page_owner_stack_threshold)
                return 0;
 
        for (i = 0; i < nr_entries; i++)