lkml.org 
[lkml]   [2007]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: early_printk accessing __log_buf
On 7/23/07, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Mon, 23 Jul 2007 16:54:36 -0400
> "Mike Frysinger" <vapier.adi@gmail.com> wrote:
>
> > On 7/23/07, Andrew Morton <akpm@linux-foundation.org> wrote:
> > > On Mon, 23 Jul 2007 14:19:12 -0400
> > > Robin Getz <rgetz@blackfin.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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-24 00:13    [W:0.373 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site