summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorBaoquan He <bhe@redhat.com>2023-07-28 06:02:55 +0300
committerDennis Zhou <dennis@kernel.org>2023-08-25 18:04:59 +0300
commitf7d77dfc91f747f64cb00884fd6d7940c3b49fca (patch)
treec8a77083e4cb1ffcbe999072841c2f36e2ef2050 /mm
parent7ee1e758bebe13d96217bcfd5230892ed44760e7 (diff)
downloadlinux-f7d77dfc91f747f64cb00884fd6d7940c3b49fca.tar.xz
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 <bhe@redhat.com> Signed-off-by: Dennis Zhou <dennis@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/percpu.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/percpu.c b/mm/percpu.c
index ab4ba2ac91c7..a7665de8485f 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1890,13 +1890,15 @@ fail_unlock:
fail:
trace_percpu_alloc_percpu_fail(reserved, is_atomic, size, align);
- if (!is_atomic && do_warn && warn_limit) {
+ if (do_warn && warn_limit) {
pr_warn("allocation failed, size=%zu align=%zu atomic=%d, %s\n",
size, align, is_atomic, err);
- dump_stack();
+ if (!is_atomic)
+ dump_stack();
if (!--warn_limit)
pr_info("limit reached, disable warning\n");
}
+
if (is_atomic) {
/* see the flag handling in pcpu_balance_workfn() */
pcpu_atomic_alloc_failed = true;