/me switches to a decent keyboard to test with.
No, the killer is that console_loglevel is restored from
orig_log_level after having been modified in the loglevel
handler.
> > There was a time when I thought that was a good idea.
> >
> > Go ahead, laugh.
Nah, I don't want to laugh at it. More like cry at it.
It's set me back from other work by too many hours already.
> > Anyway, that sort of unresolved state is bad, and is the source of all
> > of this song and dance. I think the right answer is to force handlers to
> > open their own calls to printk, and to keep whats going on with the
> > console_loglevel and printk buffer nice and clean.
> >
> > The cost is that messages like this:
> >
> > SysRq : Loglevel switched to X
> >
> > will have to become more like this:
> >
> > SysRq : Loglevel
> > Loglevel switched to X
Yes, that's ugly and shouldn't be done.
I made an OK state machine (previous and next states) of it.
Your patch moves restoring console_loglevel to a place
that makes sense.
Bottom line: I don't care which code goes into the sysrq.c,
but I hope that you (and others) learn to do some basic testing
before unleashing it. I don't expect all Linux kernel code
to be thoroughly tested before it is added to a kernel,
especially for areas like VM and file systems.
But some basic level of testing should have been done on it,
and I can't tell that it was done.
There is still room for some more/small improvements here. Nothing
earth-shattering. For example, go_sync() and do_emergency_sync()
don't need to save console_loglevel or set it to 7 (they have both
already been done in __handle_sysrq_nolock()).
My patch eliminated this cruft.
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/