Re: Kernel output interleaved on boot

From: Lev Serebryakov <lev_at_FreeBSD.org>
Date: Mon, 8 Apr 2013 12:07:06 +0400
Hello, Jeremy.
You wrote 8 апреля 2013 г., 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!

-- 
// Black Lion AKA Lev Serebryakov <lev_at_FreeBSD.org>
Received on Mon Apr 08 2013 - 06:07:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:36 UTC