Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp10942ybh; Fri, 17 Jul 2020 16:50:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzV//TKI4TgJHZ5kxi3oBuvSK2fantf4Hv8DEvQcDFFAzuHw1tAAC3WqKVEFhrAi336yVBX X-Received: by 2002:a05:6402:104c:: with SMTP id e12mr703875edu.295.1595029845404; Fri, 17 Jul 2020 16:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595029845; cv=none; d=google.com; s=arc-20160816; b=RButoJsPOHBVmBz6IXEPF1n+xdOLTL1sJsP4rX/OXWhiYHj/C2SYQ93TOs0RgWeIaQ 82WMOyhAoLP0madsMZ0aczwpEIZYcdJd8ozf8dZ5vjpiT8Fp5UdSYayYF5KNzSh1QBlo 32Ss2pDqLLuqTxYFx1CJ5O8sCtd8doMpaugoXLK6v22NfTuattZzdfcWoavbPNO6tLeb Tw2qp0K8FUAyT46OAhFF14LInJrQTTUUkKW1IZHA8ToJg0n9EU8gJtwupEQ0HeJJW7OT AAuFjyQhuO21Q/L0Iczub7m5LZVvp8nRavirWxdDZi+DeY304Vdib5sfGuYqHPxNAFS8 aYxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:dkim-signature:dkim-signature:from; bh=hLhSscQ3zjADZ+KvQLXC+idNGz5GUHoq9ureYCScp5U=; b=hZFsZCwQ9+XkPuh9NL5DMJJ/aJRAUN3hpFKCpj083zaljbOz+jO+tdrpu+oHb38VGw L3qoJauVA3dGU08Vn9x8+cnn3xkP+KaQMpfxzg5qurYk2rC+tEFnMI0ICorQZ0X6TS28 3yCLoOsmVeoLQum1u6aamDytT8gEO5ykcGiW6E14HTJtGYQXiK3cS8Nvg8BqhdbAHeTV Vgoul9oK5V8kxxQrgV1qUei12h3RvGp79TUViYWtNmmdyN0P79luP1lU6Dwca5cpNW2i 0sKfqspPyICK4M01nYzdb2Qj9IlqBZdsIX/0odHAAzgHyfVa0hOJzH26329ClzSwZgtm V/6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=otR6BaPI; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e19si6357061edr.218.2020.07.17.16.50.23; Fri, 17 Jul 2020 16:50:45 -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=@linutronix.de header.s=2020 header.b=otR6BaPI; dkim=neutral (no key) header.i=@vger.kernel.org header.s=2020e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728121AbgGQXs4 (ORCPT + 99 others); Fri, 17 Jul 2020 19:48:56 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:44038 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726851AbgGQXs4 (ORCPT ); Fri, 17 Jul 2020 19:48:56 -0400 From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1595029734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=hLhSscQ3zjADZ+KvQLXC+idNGz5GUHoq9ureYCScp5U=; b=otR6BaPIX5ohSReVosDJMA7wVnx74Mt1JjlMB/d2YD3fO+9yblYQrARg0Dkk2auM4iL22o aCnjFY+hCu6smfszJQalEPfseSQ9tXZFw8ssK5E36SGeCCzMsE4WzaoKKH9MdqFcNY4PY8 LhUR7AsAfVnbYSt5poq5JOXT+hK9C2kUjFd5/NpdAcrA9QktEy9gTJHQbY+ufa4JwJvUwl GanUD6/J2LDk9RluUBaTw4PtUdFJUBUoB49qeoGBE0AcMDiLC9zyQIsKfA4yAG8+O8q+7B 119hePJXpFb22yZOQevEr2rUbfZ96MkSOiUo2ZdMmPaGwH8ALz/UUfuZkQIILw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1595029734; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=hLhSscQ3zjADZ+KvQLXC+idNGz5GUHoq9ureYCScp5U=; b=kfhrArN30d6YNoUwK1sDjzlfSELEzY7vWajQmDmdzPRtazzFBvNQf98PUPIWzA92B/Sa5l gOSSiOH+weNgcsCA== To: Petr Mladek Cc: Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Greg Kroah-Hartman , Peter Zijlstra , Thomas Gleixner , kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/4] printk: reimplement LOG_CONT handling Date: Sat, 18 Jul 2020 01:54:14 +0206 Message-Id: <20200717234818.8622-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Here is the second series to rework the printk subsystem. This series removes LOG_CONT handling from printk() callers, storing all LOG_CONT parts individually in the ringbuffer. With this series, LOG_CONT handling is moved to the ringbuffer readers that provide the record contents to users (console printing, syslog, /dev/kmsg). This change is necessary in order to support the upcoming move to a fully lockless printk() implementation. This series is in line with the agreements [0] made at the meeting during LPC2019 in Lisbon, with 1 exception: For the /dev/kmsg interface, empty line placeholder records are reported for the LOG_CONT parts. 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. The effect can be easily observed with the sysrq help: $ echo h | sudo tee /proc/sysrq-trigger $ sudo dmesg | tail -n 30 $ sudo journalctl -k -n 30 Providing the placeholder entries allows a userspace tool to identify if records were actually lost. IMHO this an important feature. Its side effect can be addressed by userspace tools if they change to silently consume empty records. For dump tools that process the ringbuffer directly (such as crash, makedumpfile, kexec-tools), they will need to implement LOG_CONT handling if they want to present clean continuous line messages. Finally, by moving LOG_CONT handling from writers to readers, some incorrect pr_cont() usage is revealed. Patch 4 of this series addresses one such example. This series is based on the printk git tree [1] printk-rework branch. [0] https://lkml.kernel.org/r/87k1acz5rx.fsf@linutronix.de [1] https://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git (printk-rework branch) John Ogness (4): printk: ringbuffer: support dataless records printk: store instead of processing cont parts printk: process cont records during reading ipconfig: cleanup printk usage kernel/printk/printk.c | 569 ++++++++++++++++++++---------- kernel/printk/printk_ringbuffer.c | 58 ++- kernel/printk/printk_ringbuffer.h | 15 +- net/ipv4/ipconfig.c | 25 +- 4 files changed, 434 insertions(+), 233 deletions(-) -- 2.20.1