Agreed. system_state is too general.
If we specifically want to know whether it is safe to call schedule() then
let's create a global boolean it_is_safe_to_call_schedule and test that,
rather than testing something which indirectly and unreliably implies "it
is safe to call schedule". If that boolean already exists then no-brainer.
All that being said, I wonder if the netconsole code should be using
msleep(1) instead. Spinning on cond_resched() is a bit rude. But one
would have to verify that it is safe to call schedule() at this time, and
for the netconsole caller, this is dubious.
--