> Ingo Molnar wrote:> >* Yinghai Lu <yinghai@kernel.org> wrote:> >> >>+ pr_info("log_buf_len: %d\n", log_buf_len);> >>+ pr_info("early log buf free: %d(%d%%)\n",> >>+ free, (free * 100) / __LOG_BUF_LEN);> >> > Such debug printks should be removed from the final version of the patch ...>> Because I haven't been able to test on a fully configured> system, this might be crucial info to figure out how to> fix this when it happens on a customer system. Are you> saying this small line is any less important than the> other thousands and thousands of seemingly meaningless> lines?

I think you are thinking about this the wrong way.

The real fix is to never even have to think about 'how much early buffer space do we have left'. I.e. via the memblock allocation the buffer can be enlargened before the big printks happen.

btw., a sidenote, it would make sense to record cases when we 'lose' printk output, in the printk buffer itself. (it can be done by reserving a bit and updating the 'lost this many bytes' portion of the buffer, or so.)