Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp108127ybh; Mon, 20 Jul 2020 11:31:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPRtl9pMm5MTJMRSwZ69cO9tb5kYKD1SZgeWy6mo8JncxGCSKYVmgMwlOIEkyIdoC54VPr X-Received: by 2002:a17:906:c78f:: with SMTP id cw15mr21321785ejb.58.1595269914488; Mon, 20 Jul 2020 11:31:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595269914; cv=none; d=google.com; s=arc-20160816; b=UT3up3+rlYasuLG+qPQT2CJetVZWIY/TroZYLaBI5ua/E0pjmLhVo+8DzwFtCHvXfv HYEtIJ9O4/Kt+zyII1US6iByjmig3mkNGsnAMgd6qQhTDi4MMyY0GUEzXj1b2zQWIKmH IOihIPgw5UXHehvaNqNb8/A7A1Ge6d7ZocqcHmo/7ZJLhgTGwUvWcg2X3riP1wjZGKVR 7PR/Uxwob8HsW0vxpIZwfDcDZbX7QKoqI1BmnNF4WiVu4qUEtbqT71NTbtKjC7pdQurc abIiD6t7lIv4TyXh/22UQb5vLqyAeVa2B2SwrvDqKR+TTdfaxrUIp7/lpMRDMMpy7FAu YeYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=eLm1g6wX0u+kbO+T7uZR40kC/xNw/fbY+lFjsSbRCrQ=; b=vQuMicXzxoe0WToWvzMhhYrMBhvL8duuUXGCRPA8engzfToLg2enBaZgapa0za8ZSy mKNjLKfprjPLUm7wv5wsRVKitcg9+fp7Tl4DosslXBIy74i0BFsAldP8nxCEifNABD+b xLmZSmb3uAFf15GrE49L5QKgI3ALgR/t8wNXPfc6TkfvMQj4qYs+P9MkGeL3C5QPEw6m 9cgYuzFuzqU3NzaiUMqtnj+FQ3dDVPdsasm1IkXupfGzyN7W0HV/O7TtpJvxax13QNIq +Y5zeJhlsW6IRlBqC3VTlYfZOQiaxlCOSKsexGSrgMdGY/qeJP1kAmmi5vcXJlzpAoXy SNyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=enk9UNDq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h14si10727008edv.119.2020.07.20.11.31.31; Mon, 20 Jul 2020 11:31:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=enk9UNDq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729925AbgGTSa6 (ORCPT + 99 others); Mon, 20 Jul 2020 14:30:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726506AbgGTSa6 (ORCPT ); Mon, 20 Jul 2020 14:30:58 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F9F6C061794 for ; Mon, 20 Jul 2020 11:30:57 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id e8so21349166ljb.0 for ; Mon, 20 Jul 2020 11:30:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=eLm1g6wX0u+kbO+T7uZR40kC/xNw/fbY+lFjsSbRCrQ=; b=enk9UNDqqpkyBymHXAemQoho8R9poOstpys1T9uwejv/TFZtzA3OTJugXLxVqhD4hf Fj4xwWCee33f4enVhWDp+U4q7tOBzpVQbTMWcNuNmIPWtgEm7vt3yMvKi/REWrB5NffW duOV7APLqbXXCHTYmoSFjgK0N1Q5TvBcRImmA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eLm1g6wX0u+kbO+T7uZR40kC/xNw/fbY+lFjsSbRCrQ=; b=OJljmEdIFd1/Cbt1mS1CK/oHvRxMIf8spNn+tR2+GK3zukI9+GRpnvHuMokQ/hn0c/ g/SK46Cpn3WjfcAiK9MeJhWhm2WZjonfxCpO96mUSeczmX8OfYH1Ha1c14cfoWhWy5GM 5JE4rns0+ltlFv0WgZZzAhHll2UlTpCKypgGzHNjz2hEQAyjy1WfC5AtGeh101cH7zZE tNv0b9sIVfCnUNR2PZR+02DiUiUsUHOCTIG+1Mi9A+eXrU/i4lmyYObGGMU6zPGFMn99 IvbM9M8ENH/Ui2dHkjpqDAW/7IL+0IUvGohOKRDmyckH9s5Q9QpkK9wbuWJ90boaNLkH c73w== X-Gm-Message-State: AOAM532VcQ2eTWZ8jxZhHZi/LHW7TSvCCy6QqrF6bRl8DEJysPk0gbVc UrCOTcjftqS3pIjMdTDc4ngdDF0dSUs= X-Received: by 2002:a2e:5d8:: with SMTP id 207mr10594937ljf.257.1595269855796; Mon, 20 Jul 2020 11:30:55 -0700 (PDT) Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com. [209.85.208.176]) by smtp.gmail.com with ESMTPSA id 193sm4630980lfa.90.2020.07.20.11.30.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jul 2020 11:30:53 -0700 (PDT) Received: by mail-lj1-f176.google.com with SMTP id r19so21237199ljn.12 for ; Mon, 20 Jul 2020 11:30:53 -0700 (PDT) X-Received: by 2002:a05:651c:1b6:: with SMTP id c22mr9625723ljn.421.1595269852673; Mon, 20 Jul 2020 11:30:52 -0700 (PDT) MIME-Version: 1.0 References: <20200717234818.8622-1-john.ogness@linutronix.de> <20200717234818.8622-3-john.ogness@linutronix.de> <20200719143527.GA566@jagdpanzerIV.localdomain> <20200720015057.GA463@jagdpanzerIV.localdomain> In-Reply-To: <20200720015057.GA463@jagdpanzerIV.localdomain> From: Linus Torvalds Date: Mon, 20 Jul 2020 11:30:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/4] printk: store instead of processing cont parts To: Sergey Senozhatsky Cc: John Ogness , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Greg Kroah-Hartman , Peter Zijlstra , Thomas Gleixner , kexec@lists.infradead.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 19, 2020 at 6:51 PM Sergey Senozhatsky wrote: > > Do I get it right, what you are saying is - when we process a PR_CONT > message the cont buffer should already contain previous non-LOG_NEWLINE > and non-PR_CONT message, otherwise it's a bug? No. I'm saying that the code that does PR_CONT should have done *some* printing before, otherwise it's at the very least questionable. IOW, you can't just randomly start printing with PR_CONT, without having established _some_ context for it. But that context could be a previous newline you created (the PR_CONT will be a no-op). That's certainly useful for printing a header and then after that printing possible other complex data that may or may not have line breaks in it. So your example looks fine. The context starts out with pr_warn("which would create a new lock dependency:\n"); and after that you can use KERN_CONT / pr_cont() as much as you want, since you've established a context for what you're printing. And then it ends with 'pr_cont("\n")'. So anything that was interrupted by this, and uses KERN_CONT / pr_cont() will have no ambiguous issues. The code you pointed at both started and ended a line. That said, we have traditionally used not just "current process", but also "last irq-level" as the context information, so I do think it would be good to continue to do that. At that point, "an interrupt printed something in the middle" isn't even an issue any more, because it's clear that the context has changed. Linus