Skip to content

Commit f7d77df

Browse files
Baoquan Hedennisszhou
authored andcommitted
mm/percpu.c: print error message too if atomic alloc failed
The variable 'err' is assgigned to an error message if atomic alloc failed, while it has no chance to be printed if is_atomic is true. Here change to print error message too if atomic alloc failed, while avoid to call dump_stack() if that case. Signed-off-by: Baoquan He <[email protected]> Signed-off-by: Dennis Zhou <[email protected]>
1 parent 7ee1e75 commit f7d77df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

mm/percpu.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,13 +1890,15 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved,
18901890
fail:
18911891
trace_percpu_alloc_percpu_fail(reserved, is_atomic, size, align);
18921892

1893-
if (!is_atomic && do_warn && warn_limit) {
1893+
if (do_warn && warn_limit) {
18941894
pr_warn("allocation failed, size=%zu align=%zu atomic=%d, %s\n",
18951895
size, align, is_atomic, err);
1896-
dump_stack();
1896+
if (!is_atomic)
1897+
dump_stack();
18971898
if (!--warn_limit)
18981899
pr_info("limit reached, disable warning\n");
18991900
}
1901+
19001902
if (is_atomic) {
19011903
/* see the flag handling in pcpu_balance_workfn() */
19021904
pcpu_atomic_alloc_failed = true;

0 commit comments

Comments
 (0)