From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756756AbcJWUdq (ORCPT ); Sun, 23 Oct 2016 16:33:46 -0400 Received: from smtprelay0225.hostedemail.com ([216.40.44.225]:53122 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756705AbcJWUdp (ORCPT ); Sun, 23 Oct 2016 16:33:45 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:2693:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4321:4470:5007:6119:6691:7875:7903:8792:9040:9108:10004:10400:10848:11232:11658:11914:12663:12740:12760:13069:13161:13229:13311:13357:13439:14096:14097:14181:14659:14721:14777:21080:21433:30054:30060:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: house62_77aba89362a18 X-Filterd-Recvd-Size: 2996 Message-ID: <1477254821.3561.8.camel@perches.com> Subject: Re: linux.git: printk() problem From: Joe Perches To: Linus Torvalds Cc: Geert Uytterhoeven , Tetsuo Handa , Linux Kernel Mailing List , Sergey Senozhatsky , Petr Mladek Date: Sun, 23 Oct 2016 13:33:41 -0700 In-Reply-To: References: <201610122230.DID43237.FSOHFFQOJOtVML@I-love.SAKURA.ne.jp> <1477249607.3561.2.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.0-2ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 2016-10-23 at 12:32 -0700, Linus Torvalds wrote: > On Sun, Oct 23, 2016 at 12:06 PM, Joe Perches wrote: > > On Sun, 2016-10-23 at 11:11 -0700, Linus Torvalds wrote: > > > > > > And those two per se sound fairly easy to handle ("KERN_CONT means > > > append to the line buffer, otherwise flush the line buffer and move to > > > the record buffer"). > > > > > > But what complicates things more is then the "console output", which > > > has two issues: > > > > > > - it is done outside the locking regime for the line buffer and the > > > record buffer. > > > > > > - it is done on _partial_ line buffers. > > > > > > EOL KERN_ and thread interleaving still exists. > > > Note that the thread interleaving is still trivial: it's easily done > at the point where we decide "can we append to the line buffer or > not". That's pretty simple. Just flush the record when the thread > changes. > > So the interleaving will never go away, it's very fundamental - unless > we make the line buffer just be a per-thread thing. And yes, that > would be the cleanest solution, but it's also an extra buffer for each > thread, so realistically it's just not going to happen. I doubt there are cases where more than a few of these interleaving threads are simultaneous. Perhaps it could be a pool of active thread continuation buffers. > End result: I'm not worried about the interleaving. It will cause ugly > output, but we've always had that, and the solution to it is "if you > absolutely don't want interleaving, then don't try to print partial > lines!". > The classic "don't do that then" response, in other world. Yup, best solution.