Re: Kernel output interleaved on boot

看板FB_current作者時間12年前 (2013/04/27 14:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串7/8 (看更多)
On 04/07/2013 23:20, Andreas Nilsson wrote: > On Sun, Apr 7, 2013 at 9:36 PM, deeptech71 <deeptech71@gmail.com <mailto:deeptech71@gmail.com>> wrote: > options PRINTF_BUFR_SIZE=128 # Prevent printf output being interspersed. > > And here I thought that it was added to mitigate the "interspersed output" problem, and I remember that adding to the conf on previous version help address the problem. And you were right. AFAICT, the problem was that the threads were writing single characters ("putc()ing") at a time, and would get preempted by other such threads in between. Thus, such tasks would get interleaved at character granularity. Proposals were: (a) use a stack array in printf()'s body to do line buffering; some argued that kernel stack sizes are fairly limited, others argued that this should not be a limitation even on embedded platforms; (b) allow a printf() task to fully finish before allowing other printf() tasks to start. The (a) solution was chosen, with an amendment that the array would be specifiable by a kernel configuration option. GENERIC kernels have "options PRINTF_BUFR_SIZE=128". If the original poster had removed the PRINTF_BUFR_SIZE option from his kernel configuration, then I see his complaint as invalid. _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1HUscdiV (FB_current)
討論串 (同標題文章)
文章代碼(AID): #1HUscdiV (FB_current)