Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Baoquan He and committed by
Dennis Zhou
f7d77dfc 7ee1e758

+4 -2
+4 -2
mm/percpu.c
··· 1890 1890 fail: 1891 1891 trace_percpu_alloc_percpu_fail(reserved, is_atomic, size, align); 1892 1892 1893 - if (!is_atomic && do_warn && warn_limit) { 1893 + if (do_warn && warn_limit) { 1894 1894 pr_warn("allocation failed, size=%zu align=%zu atomic=%d, %s\n", 1895 1895 size, align, is_atomic, err); 1896 - dump_stack(); 1896 + if (!is_atomic) 1897 + dump_stack(); 1897 1898 if (!--warn_limit) 1898 1899 pr_info("limit reached, disable warning\n"); 1899 1900 } 1901 + 1900 1902 if (is_atomic) { 1901 1903 /* see the flag handling in pcpu_balance_workfn() */ 1902 1904 pcpu_atomic_alloc_failed = true;