[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8bd0f97a0707231510j52c209e2vf09b023be6e47b1c@mail.gmail.com>
Date: Mon, 23 Jul 2007 18:10:46 -0400
From: "Mike Frysinger" <vapier.adi@...il.com>
To: "Andrew Morton" <akpm@...ux-foundation.org>
Cc: "Robin Getz" <rgetz@...ckfin.uclinux.org>,
linux-kernel@...r.kernel.org, "Greg Ungerer" <gerg@...pgear.com>,
"Russell King" <rmk@....linux.org.uk>,
"Paul Mundt" <lethal@...ux-sh.org>,
"Tim Bird" <tim.bird@...sony.com>, bryan.wu@...log.com
Subject: Re: early_printk accessing __log_buf
On 7/23/07, Andrew Morton <akpm@...ux-foundation.org> wrote:
> On Mon, 23 Jul 2007 16:54:36 -0400
> "Mike Frysinger" <vapier.adi@...il.com> wrote:
>
> > On 7/23/07, Andrew Morton <akpm@...ux-foundation.org> wrote:
> > > On Mon, 23 Jul 2007 14:19:12 -0400
> > > Robin Getz <rgetz@...ckfin.uclinux.org> wrote:
> > >
> > > > On Sun 22 Jul 2007 19:50, Mike Frysinger pondered:
> > > > >
> > > > > i think the attached two functions account for what Robin and Andrew
> > > > > were thinking ...
> > > >
> > > > A note about why/when grab_lock would be set to zero (pre-kernel init, or
> > > > OOPs) might be nice.
> > >
> > > Definitely.
> > >
> > > The pre-kernel init shouldn't be an issue: logbuf_lock is initialised at
> > > compile time.
> > >
> > > At oops time we could possibly use oops_in_progress to work out whether to
> > > avoid taking the lock. That's not terribly nice, but nor is it nice for
> > > callers to know about printk internals.
> >
> > maybe, but for early debug users (the reason we wanted this
> > originally), it wouldnt be an oops in progress ... but i guess we can
> > just as easily set oops_in_progress to 1 in our code before calling
> > this function to keep from having to worry over locks from being
> > doubly grabbed.
>
> I don't immediately see how logbuf_lock could be doubly grabbed. Only if
> you're calling this from hard irq context?
i guess i'm just assuming the worse here and making sure that
something i couldnt conjure up doesnt have the opportunity to bite me
in the ass. doubly grabbed, memory corruption, whatever ... i dont
really have a real scenario as i dont have a very active imagination
;)
-mike
-
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