From owner-freebsd-current@FreeBSD.ORG Mon Apr 8 08:39:11 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A6384F82 for ; Mon, 8 Apr 2013 08:39:11 +0000 (UTC) (envelope-from deeptech71@gmail.com) Received: from mail-bk0-x234.google.com (mail-bk0-x234.google.com [IPv6:2a00:1450:4008:c01::234]) by mx1.freebsd.org (Postfix) with ESMTP id 3C5DFAC7 for ; Mon, 8 Apr 2013 08:39:11 +0000 (UTC) Received: by mail-bk0-f52.google.com with SMTP id it16so2936646bkc.11 for ; Mon, 08 Apr 2013 01:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=LxCOeDp7RO9b70XSGucdvkVaIw8ilS0RSeUAcXANY0M=; b=sJDaXBMqxhHmkKOg2r9v94RPqcpegigu3r5sPObhKX4ZaphiCY/aJZSy9p2aq/Tvx5 G8P2+o0IdwIt+Vjj6B5Q4y4eYwKEN//PVNOWd9vGgoLctypZCZDcCXirm4GxF9Uq8AeO oK6qS+Sn8yQn1CjvydzWW5G5GyfMubaya/pGnkdaEQ57PxUIw6v5tH04XUtUoIzz5V56 XybSZRxO8srrdnBs2vzymBwpJ8Va1e0C/W5PrG13uGUyqhbghVUGKsVZB5OD3t2P7Ac2 1vMUx9LiuYp5U/EkCmO8r6jxyodfAB/Uu/zMD0v6ZlSylzMDxys625kljBtB5t8FbVCj dLHw== X-Received: by 10.205.107.2 with SMTP id dw2mr2505090bkc.112.1365410350226; Mon, 08 Apr 2013 01:39:10 -0700 (PDT) Received: from [192.168.1.80] (4E5CCB53.dsl.pool.telekom.hu. [78.92.203.83]) by mx.google.com with ESMTPS id x18sm12074135bkw.4.2013.04.08.01.39.08 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 08 Apr 2013 01:39:09 -0700 (PDT) Message-ID: <51628FFC.2070501@gmail.com> Date: Mon, 08 Apr 2013 11:38:04 +0200 From: deeptech71 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:18.0) Gecko/20100101 SeaMonkey/2.15 MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: Re: Kernel output interleaved on boot References: <559270951.20130407172227@serebryakov.spb.ru> <5161CAAF.30106@gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Apr 2013 08:39:11 -0000 On 04/07/2013 23:20, Andreas Nilsson wrote: > On Sun, Apr 7, 2013 at 9:36 PM, deeptech71 > 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.