Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp521829iog; Fri, 17 Jun 2022 08:03:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1suEaiL5N073eK3jk8QBLk+zc8lQ6gdedfXreCpEHsGdZ5Z+yB0m8jfgjH9DDV013wDfkXH X-Received: by 2002:a17:907:8d0a:b0:70e:aa82:8745 with SMTP id tc10-20020a1709078d0a00b0070eaa828745mr9850559ejc.550.1655478202878; Fri, 17 Jun 2022 08:03:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655478202; cv=none; d=google.com; s=arc-20160816; b=WWbmBspq6AIx9gywTZNwY17vbczF93e7YYTUj1BxZpFNq3u68g+lsypXDgS+xqXh7G 6vFUxCgHBk4lRw/pAuJmQBU7Bu5IQnWVDWp65xShQAG/XFZ8Kd1xRUi+MRwvMtk9oq7Z MpmG0k+ommF+6sffo9Q6olh2LzbCITBC43r5LozAf/ADw2kQNR3GzdufDoUjINGZ84KE fc90BPzil27+QQ1d+TmvmQDH7fVphJxulxeJscH3bdo+BdpI+heXhM/u2Avo3J4r0uHP slFJRqQK9kRVUJPU/kNfmrUM3NuTvIzQKqBduSR6v9cgDbefi+XcajGacxQx1gK/e3ZR cYlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=d8vYn2o7BallV+Qa266BjqpvAHp10+eqXCKCBj7r/eo=; b=lOIe4nr0CCgIV2P0xJnGfYT69WQhPhUopjyMlQp7xOZHMCNTwxdckdRnsJHcNJ3C3l N+K1GmbasLiOmnFdb8Iw1azyp4FeGjX5IuXPE1rK3WEEF6eB2C4IpzAVXJr6VRKY97BF ERSKeb1Sv6kyaZnZHS55nfbxeZE5mjc7H1vid2bGEhmb3sqcXSVG9kESUy1gT2dAQGWv xXZLO95MY7yGT8gSQJ3WUVdkk5zqRKp5stP05TmOmFoVY8Q35lHLhFnnxxy9Nv9trih0 24A3aTBG7yNqw5cJz/7fNlOQt3E9hIz3bvQeV4zkpmON1IT12g7gyOAlEAGXSGk1Fi3z tflQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=QzkYhGe9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hb32-20020a170907162000b007053440b935si5600891ejc.670.2022.06.17.08.02.55; Fri, 17 Jun 2022 08:03:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=QzkYhGe9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382832AbiFQOlR (ORCPT + 99 others); Fri, 17 Jun 2022 10:41:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382808AbiFQOlP (ORCPT ); Fri, 17 Jun 2022 10:41:15 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31253517C2 for ; Fri, 17 Jun 2022 07:41:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DC122B82ACA for ; Fri, 17 Jun 2022 14:41:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1494FC3411F; Fri, 17 Jun 2022 14:41:10 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="QzkYhGe9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1655476869; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=d8vYn2o7BallV+Qa266BjqpvAHp10+eqXCKCBj7r/eo=; b=QzkYhGe99W1kq2eyE2vfuWMPLRmckrTq5O2txU8I/ySiZrfGA19pjm7Jh2zbGz7f2km2eE ZTj7z3HPmLA0BscMpOvDmsj7XopUMTzWYXu/SrLGdRlGixRfXiiJTElcz5V2HhZq6mIRpn BRDJJSv9+aQ3HCrEw47R0oEbBSSbZsg= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 87fa2686 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Fri, 17 Jun 2022 14:41:09 +0000 (UTC) Date: Fri, 17 Jun 2022 16:41:05 +0200 From: "Jason A. Donenfeld" To: Petr Mladek Cc: John Ogness , Marco Elver , linux-kernel@vger.kernel.org Subject: Re: 5.19 printk breaks message ordering Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 17, 2022 at 04:21:15PM +0200, Petr Mladek wrote: > In fact, in your case you might get even better synchronization > if you do it the other way and write userspace messages into > the kernel log via /dev/kmsg: > > echo "Hello world" > /dev/kmsg The idea is to interleave stderr/stdout properly, as CI has done for ages, which threaded printk breaks, and which my patch (now posted) fixes behind a default-off option. You can't dup2 /dev/kmsg to 1 and 2, as the write() semantics are different, with respect to buffering and with respect to new lines. The interfaces aren't comparable, so this isn't quite a solution. (Besides, not breaking things as they currently exist has a certain benefit.) Jason