From owner-freebsd-current@freebsd.org Thu Aug 16 16:30:53 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41C9D106D2BC for ; Thu, 16 Aug 2018 16:30:53 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 03E0C8BB33 for ; Thu, 16 Aug 2018 16:30:53 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: by mailman.ysv.freebsd.org (Postfix) id BCDA5106D2B7; Thu, 16 Aug 2018 16:30:52 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABB11106D2B6 for ; Thu, 16 Aug 2018 16:30:52 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 243898BB17; Thu, 16 Aug 2018 16:30:48 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id w7GGUf06065998 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 16 Aug 2018 09:30:41 -0700 (PDT) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id w7GGUfrl065997; Thu, 16 Aug 2018 09:30:41 -0700 (PDT) (envelope-from jmg) Date: Thu, 16 Aug 2018 09:30:41 -0700 From: John-Mark Gurney To: current@FreeBSD.org Cc: bsdimp@FreeBSD.org Subject: buffer device_printf... Message-ID: <20180816163041.GW97145@funkthat.com> Mail-Followup-To: current@FreeBSD.org, bsdimp@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 11.0-RELEASE-p7 amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Thu, 16 Aug 2018 09:30:41 -0700 (PDT) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.27 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: Thu, 16 Aug 2018 16:30:53 -0000 On my arm64 board, various console messages get intermixed because of SMP. This makes messages harder to read than the could be. One issue is that device_printf uses two printf's, one for the device, and one for the provided message.. This prevents PRINTF_BUFR_SIZE from combining the two messages into a single write. The review https://reviews.freebsd.org/D16690 makes device_printf use an sbuf w/ a printf drain to effectively buffer these messages together. previously: Trying to mount root from ufs:/dev/ufs/rootfs [rw]... mmc0: Instruction Set Attributes 0 = ACMD42 failed, RESULT: 4 Instruction Set Attributes 1 = <> mmc0: Processor Features 0 = Card at relative address 43690 failed to set bus width w/ patch: mmc0: ACMD42 failed, RESULT: 4 Trying to mount root from ufs:/dev/ufs/rootfs [rw]... Instruction Set Attributes 0 = mmc0: Card at relative address 43690 failed to set bus width Instruction Set Attributes 1 = <> Processor Features 0 = Comments? -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."