Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Apr 2013 12:07:06 +0400
From:      Lev Serebryakov <lev@FreeBSD.org>
To:        Jeremy Chadwick <jdc@koitsu.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Kernel output interleaved on boot
Message-ID:  <1791586092.20130408120706@serebryakov.spb.ru>
In-Reply-To: <20130408045237.GA70548@icarus.home.lan>
References:  <20130408045237.GA70548@icarus.home.lan>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello, Jeremy.
You wrote 8 =D0=B0=D0=BF=D1=80=D0=B5=D0=BB=D1=8F 2013 =D0=B3., 8:52:37:

JC> And yes, I am aware of how GSoC works, but this really should have
JC> become a GSoC project by now, otherwise the Foundation should have
JC> funded someone to fix this.  It makes kernel debugging basically
JC> worthless.
 Ok, here is several noob questions about low-level kernel
 implementation:

 (1) Do we have some very low-level thread-local variables, which
 could be used here?

 (2) Do cpu-local variables helps here? Is here guarantee, that
 printf() could not be preempted (I afraid, answer is no)?

 (3) What is lowest level, which could call printf()? i.e., could
 printf() allocate, say, one page of mapped kernel memory (I hope,
 answer is yes)? Init UMA zone and allocate block in UMA zone (I
 think, answer is no)?

   What I want to say, that lock-less (and block-less) multiple-writers
 ring buffer is "possible" data structure, as far as I know (we use
 lock-less and block-less data structures a lot at work for
 massive-parallel programming, but not at such low level, of course),
 but I need to understand, what printf() could and what couldn't do. I
 understand, that it could not use any lock, as it is called from
 anywhere, but should be it limited to stack and/or static data
 structures?

   And, by the way, is here generic mechanism in kernel (loader?),
  which automatically (on load) allocate per-CPU static structures?

   And why output is garbaged, if printf() uses _stack_ based buffer,
 at first place?! Stack is thread-local by definition!

--=20
// Black Lion AKA Lev Serebryakov <lev@FreeBSD.org>




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1791586092.20130408120706>