On Tue 30-08-22 09:30:26, Dan Carpenter wrote: > 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 What is this warning saying? > 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. This function shouldn't ever be allocating any memory. The flag is solely to infer which memory zones should be displayed. It acts as a filter. Is it possible that the checker misinterprets the parameter's meaning? -- Michal Hocko SUSE Labs