From: Dan Carpenter <dan.carpenter@oracle.com>
To: mhocko@suse.com
Cc: linux-mm@kvack.org
Subject: [bug report] mm: reduce noise in show_mem for lowmem allocations
Date: Tue, 30 Aug 2022 09:30:26 +0300 [thread overview]
Message-ID: <Yw2ugrlZ8bwE5/hh@kili> (raw)
Hello Michal Hocko,
The patch e8fedfea3dea: "mm: reduce noise in show_mem for lowmem
allocations" from Aug 23, 2022, leads to the following Smatch static
checker warning:
kernel/panic.c:190 panic_print_sys_info()
warn: sleeping in atomic context
kernel/panic.c
175 static void panic_print_sys_info(bool console_flush)
176 {
177 if (console_flush) {
178 if (panic_print & PANIC_PRINT_ALL_PRINTK_MSG)
179 console_flush_on_panic(CONSOLE_REPLAY_ALL);
180 return;
181 }
182
183 if (panic_print & PANIC_PRINT_ALL_CPU_BT)
184 trigger_all_cpu_backtrace();
185
186 if (panic_print & PANIC_PRINT_TASK_INFO)
187 show_state();
188
189 if (panic_print & PANIC_PRINT_MEM_INFO)
--> 190 show_mem(0, NULL, GFP_HIGHUSER_MOVABLE);
^^^^^^^^^^^^^^^^^^^^
This obviously seems very deliberate and a lot of weird stuff happens
during panic(). But the panic() function disables preemption so
shouldn't this be GFP_ATOMIC? GFP_HIGHUSER_MOVABLE has __GFP_RECLAIM
and triggering swap during a panic seems bad.
191
192 if (panic_print & PANIC_PRINT_TIMER_INFO)
193 sysrq_timer_list_show();
194
195 if (panic_print & PANIC_PRINT_LOCK_INFO)
196 debug_show_all_locks();
197
198 if (panic_print & PANIC_PRINT_FTRACE_INFO)
199 ftrace_dump(DUMP_ALL);
200 }
regards,
dan carpenter
next reply other threads:[~2022-08-30 6:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 6:30 Dan Carpenter [this message]
2022-08-30 6:46 ` Michal Hocko
2022-08-30 7:02 ` Dan Carpenter
2022-08-30 7:11 ` Michal Hocko
2022-08-30 7:59 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yw2ugrlZ8bwE5/hh@kili \
--to=dan.carpenter@oracle.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox