[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091012152327.GD14004@elte.hu>
Date: Mon, 12 Oct 2009 17:23:27 +0200
From: Ingo Molnar <mingo@...e.hu>
To: Simon Kagstrom <simon.kagstrom@...insight.net>
Cc: Artem Bityutskiy <dedekind1@...il.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
"Koskinen Aaro (Nokia-D/Helsinki)" <aaro.koskinen@...ia.com>,
linux-mtd <linux-mtd@...ts.infradead.org>,
Andrew Morton <akpm@...ux-foundation.org>,
David Woodhouse <dwmw2@...radead.org>,
Alan Cox <alan@...rguk.ukuu.org.uk>
Subject: Re: [PATCH] panic.c: export panic_on_oops
* Simon Kagstrom <simon.kagstrom@...insight.net> wrote:
> With my patch it instead works like this:
>
> - mtdoops_console_write continuously writes messages to the buffer, but
> never calls mtdoops_console_sync() itself.
>
> - mtdoops_console_sync (i.e., the ->unblank() callback) will schedule
> work if oops_in_progress is set.
>
> - if we have a panic, it will call mtdoops_write directly (if
> mtd->panic_write is set, otherwise we are out of luck). This is also
> the code path on oopses in interrupt context.
>
> So the workqueue only gets used on unblank() from oopses. I think the
> second implementation is simpler, but it also changes the behavior of
> mtdoops a bit to include messages before the oops/panic as well.
The main printk principle is simplicity:
- The simpler the printk codepath, the higher the chances that we still
are within the window of opportunity to get anything out to the user.
- Furthermore, the simpler the printk codepath, the larger the window of
opportunity is to begin with: we rely on less external state, so we
have a smaller surface of interaction that might break printk.
In that sense, i think your modified workqueue use is less wrong than
what is in current mainline, but i'm afraid it's still wrong.
Why use a workqueue on unblank()? Why use a workqueue _at all_? (If we
piggyback to any kernel thread we could as well piggyback to syslog
itself - and we all know how often syslog fails at capturing oopses.)
The mtdoops console driver only seems to act if there's an emergency -
and in emergencies we really _never_ want to do complex things like
using a workqueue thread.
( Sidenote: i proffer that we dont want to use a workqueue in the
'regular' printk case either - but that seems to be irrelevant here as
mtdoops does not seem to save / care about regular non-emergency
printks. )
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists