Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp16941ybh; Fri, 17 Jul 2020 17:03:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQNd5u/ExrDgpuCzetFl0yQC0tN9bQl0newuAzdzHBQH89U+FROTSsL0vv9ClbR1zi2Qv/ X-Received: by 2002:a17:906:6897:: with SMTP id n23mr10571554ejr.473.1595030624507; Fri, 17 Jul 2020 17:03:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595030624; cv=none; d=google.com; s=arc-20160816; b=bueikztRWdRsc0OJipy2dqP8MvaLyRyFm2K3WR3/96jBUeMzMu4wd45VFbDeRsAmK/ 8zRweNanQF01QWh6Wu9dxIL+2rM9KDvAmUSxcj8Y058Sl7dYSyMp8GKbt+rDRbO8iMjf RFwlSnSZ34y2OmW5iIyKnc3fv+MtUi3bwLaQ2YjrFA8iBDnkMwJaGWmMOvUZg1yP+Gmr ansYcWfis/xEQNDk5PaNdQzIB5c56S1Q+WM26BLlt/j5izIa5ba+IGpjXEpVPAktCRjt SJ7O88L/FETPO5YAwIUB1P/zyn+dNT+9bjZjR3yvFxiVJVzoYt5jNipzRYKsUZIiL9Qj aFKg== 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=LfDE4ruJhyC46Wi3RsJ/GllVHPpuqL5yVRuFbthLOuI=; b=V1zGU+bLq7evRPoTgTKJI/uYg+KdKofOLzX54se7mpgjvDs5obQjjm2sP+mYxYNha8 09y3ai2c+Ban8+C0EDucHI9e9bjN9V2p4B8seoNihT3923lt4oZDmF6KvIO7OZdZFvWC nLA3ESaPdVA2fE9PP9+NjnYeBaFZveqaGUdZx1dCIhIgg4knDtJYYMZ5uzZFNOkiq8rw q49BlGd8ul3NbWfU3PcIESaRlO4sJrmZH73AlQ49kbXffs8xWZnFvJSCceMEEX/ibW+4 F6ea6qVuThvQ4PBo+XNyWhXCeLhysTEiXaj7cEgA6hb72vkfJRUDUMuk0D+YFLp6q7c/ qpew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Asvu6yiF; 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 d19si6175245edv.53.2020.07.17.17.03.22; Fri, 17 Jul 2020 17:03:44 -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=Asvu6yiF; 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 S1728068AbgGRAAW (ORCPT + 99 others); Fri, 17 Jul 2020 20:00:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726851AbgGRAAV (ORCPT ); Fri, 17 Jul 2020 20:00:21 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D7D8C0619D2 for ; Fri, 17 Jul 2020 17:00:21 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id h22so14611672lji.9 for ; Fri, 17 Jul 2020 17:00:20 -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=LfDE4ruJhyC46Wi3RsJ/GllVHPpuqL5yVRuFbthLOuI=; b=Asvu6yiFTH7mDWS3ok1hQi/vxghIf/ULfa8/lMbwgMAQlGqUqQ2Cwhu6VCvk/zsA+V uN8GN3YZiywISGAvc0HpupYOQ101xF+mVckD8yWK+Y5Hty/bx0tsC7rFU6n6O0Vhiqbj 6SWfBdimEhqyIFp6vGDlFyYi6mUu6JLgQHR+o= 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=LfDE4ruJhyC46Wi3RsJ/GllVHPpuqL5yVRuFbthLOuI=; b=LazXLYfJikNRmp89VFQGMq8woB7X6PJoxzb8V3QgCUBvkfiU+oKDvhwIKio6Arv1XB AzrpT+ZrEDrXoPJoOOe6sPT30kP7EfxzOFHykITMHyhFvYS2WrVFgB9rQSwNddcDfZoR 3r5z5lA8/rkVlkPT+DN6dAnN75lvNpGcxzkPYbND1RwMUG12jOygbDoh3hygtbR6eJUF EWeUJxDmJ+/dMI6RexdDDr6q4VwJSrP2kXqAgGwj0LwWE1s8b/LgG1S1IQHGMBWUjGNC Ecv4aHBrhc5nMDtbFenJytvXltFUJay/0fA/Fwqj2YWlBdmRT0GnYyDMpuBhevGPLTMp acPg== X-Gm-Message-State: AOAM532odylGUgmsMZBehU6qcyagVLxPRHmNHGVrrp7RkHnkqiWe5XOH KOuAj1ZJZhMg94jIoeGj3sIgu50yoZ0= X-Received: by 2002:a05:651c:10f:: with SMTP id a15mr5139491ljb.192.1595030419018; Fri, 17 Jul 2020 17:00:19 -0700 (PDT) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com. [209.85.167.43]) by smtp.gmail.com with ESMTPSA id u7sm2547546lfi.45.2020.07.17.17.00.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Jul 2020 17:00:17 -0700 (PDT) Received: by mail-lf1-f43.google.com with SMTP id k15so7004943lfc.4 for ; Fri, 17 Jul 2020 17:00:17 -0700 (PDT) X-Received: by 2002:ac2:5093:: with SMTP id f19mr5794252lfm.10.1595030417179; Fri, 17 Jul 2020 17:00:17 -0700 (PDT) MIME-Version: 1.0 References: <20200717234818.8622-1-john.ogness@linutronix.de> In-Reply-To: <20200717234818.8622-1-john.ogness@linutronix.de> From: Linus Torvalds Date: Fri, 17 Jul 2020 17:00:00 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/4] printk: reimplement LOG_CONT handling To: John Ogness Cc: Petr Mladek , Sergey Senozhatsky , 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 Fri, Jul 17, 2020 at 4:48 PM John Ogness wrote: > > Using placeholders avoids tools such as systemd-journald from > erroneously reporting missed messages. However, it also means that > empty placeholder records are visible in systemd-journald logs and > displayed in tools such as dmesg. As long as the readers still reliably do the joining, this is fine. HOWEVER. Make sure you test the case of "fast concurrent readers". The last time we did things like this, it was a disaster, because a concurrent reader would see and return the _incomplete_ line, and the next entry was still being generated on another CPU. The reader would then decide to return that incomplete line, because it had something. And while in theory this could then be handled properly in user space, in practice it wasn't. So you'd see a lot of logging tools that would then report all those continuations as separate log events. Which is the whole point of LOG_CONT - for that *not* to happen. So this is just a heads-up that I will not pull something that breaks LOG_CONT because it thinks "user space can handle it". No. User space does not handle it, and we need to handle it for the user. So as long as the kernel makes sure the joining does happen it at some point, it's all fine. It obviously doesn't have to happen at printk() time, just as long as incomplete records aren't exposed even to concurrent readers. A test-case with a short delay in between writes might be a good idea, although the last time this broke it was very clear in peoples syslogs and dmesg because it turns out there are lots of concurrent readers at boot time and _somebody_ will hit the race. Linus