Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp455766pxb; Wed, 27 Jan 2021 11:53:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJyssgAN2K+eo9t45flpj1ETstrQSGlRNYXY1Afb9URgvEIT8gX2fPEEWXA5bR1Gkz2U0xb6 X-Received: by 2002:aa7:c884:: with SMTP id p4mr10719169eds.212.1611777190490; Wed, 27 Jan 2021 11:53:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611777190; cv=none; d=google.com; s=arc-20160816; b=mNlYxXXBkMpbgETJm0spzq7kFHUUcL0uM8qJofsJZNzwpXV3J3LE5m3LgtZs4d0vnd 0xLMrO/nE120MecsMgvxKXqETMGaBsJmTGc+/nEgg5M0ZEiPYSJDmlSeUj6qzGimJSb0 sYcPKpb0AGUnZSg6BWzzOuQhxpFzC5B0xzRuRPmduMlUqYxDGvcB0XKotEvUjHjwPVXn bnxx4F9Hdud+gFgKdCIIw9pZK/JKFKmr+afR+qpDepal+Zu1HEOJ1Qt8kJytISM8mccA 1hZEESllgptJ0WKMDfWayCBRGWiAXWEmeZPaCFWMGokiJ8k1j7nsiaA/RPTRK/UKcKNq zTCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:dkim-signature:dkim-signature:from; bh=QouCh4sBxe4Uney6Y/oO3QyDWthD3YsxY73q7hXjmik=; b=aXk5Jsqn2FGeKkEDVPE05MuyodVPNRoh38QRPSqOJwY8h4ZV3oBWQ91x9RQiPuxynw h/x5jQ/4xvcmiFnYWiZZ8z4TNJBFcb/yPGVwILatq6Hi+ftr6I/XYY+0L6uGVTI5IfEs ttNx+hYCglmNSu0p//X1bVqvzqyalDKcBIqfTXchWZBETWYgzIzZwIIV30HQP/ncMW6e EHth5J4jDiqPS0ww2HnRlGRkMBeMAk0iWVG51O2nUpBCQbRqbw1y7l+pdlcmGdjwgeOg +QIKNSwZldYPuduPpyg2vd66IlVBh5uqt7IEM1cNVCXNeQBkEXIjUbTHc6jQxpDQIAj2 iLDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=H76M2jfO; dkim=neutral (no key) header.i=@linutronix.de header.b="I/Hy/PKA"; 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 a13si1515805edn.209.2021.01.27.11.52.45; Wed, 27 Jan 2021 11:53:10 -0800 (PST) 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=H76M2jfO; dkim=neutral (no key) header.i=@linutronix.de header.b="I/Hy/PKA"; 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 S232829AbhA0D13 (ORCPT + 99 others); Tue, 26 Jan 2021 22:27:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726434AbhAZVQe (ORCPT ); Tue, 26 Jan 2021 16:16:34 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 499C8C061574 for ; Tue, 26 Jan 2021 13:15:54 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1611695752; 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=QouCh4sBxe4Uney6Y/oO3QyDWthD3YsxY73q7hXjmik=; b=H76M2jfOg6Ik3nf/7/XZovdtuvJthM7K3jywAwtQjrHSoeWJwFS5p9LS5gNoZCQ5d3ITQU ynp4vPNcm7Vuo4qQVX8pp6vZthudAH4dlvL9pFWzPWS+uUarHZcwlEcMdrFbpy+dw8sH8z rVSEIqTFNK9mSUkw/5XuExji5V47/rxhzClHcNzYnYfadADf1Wri8iFZ1vHtnlFBTJYGjb DKL65Xl31PXdEDxVfQQg2UEqEf93954d8NwygESHfy6bLQXD305ifZGCazIlIWYjo/mTQ9 zR2hTI8Awonkr6AW5LMGaSJu3lD0a29uNPeoeIRF9VlXqNEXFcT3NFE5QCgUCQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1611695752; 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=QouCh4sBxe4Uney6Y/oO3QyDWthD3YsxY73q7hXjmik=; b=I/Hy/PKA3EO91VBMdno7DgnvGGONWVwHOBPP6dDNJ4aGYda2c2fT4tWQLXRozX670GMFab LN6MgM1KukoUMDDA== To: Petr Mladek Cc: Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org Subject: [PATCH printk-rework 00/12] printk: remove logbuf_lock Date: Tue, 26 Jan 2021 22:21:39 +0106 Message-Id: <20210126211551.26536-1-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, This series removes @logbuf_lock, exposing the ringbuffer locklessly to both readers and writers. And since @logbuf_lock was protecting much more than just the ringbuffer, this series clarifies and cleans up the various protections using comments, lockless accessors, atomic types, and a new finer-grained @syslog_log. This series takes into account the feedback from [0], which was a series that was partially merged in 5.11. The first few patches (1-5) are general cleanups to help simplify later patches. They probably are important enough to stand alone. John Ogness [0] https://lkml.kernel.org/r/20201201205341.3871-1-john.ogness@linutronix.de John Ogness (12): printk: kmsg_dump: remove unused fields printk: refactor kmsg_dump_get_buffer() printk: consolidate kmsg_dump_get_buffer/syslog_print_all code printk: define CONSOLE_LOG_MAX in printk.h printk: use seqcount_latch for clear_seq printk: use atomic64_t for devkmsg_user.seq printk: add syslog_lock printk: introduce a kmsg_dump iterator um: synchronize kmsg_dumper hv: synchronize kmsg_dumper printk: remove logbuf_lock printk: kmsg_dump: remove _nolock() variants arch/powerpc/kernel/nvram_64.c | 12 +- arch/powerpc/platforms/powernv/opal-kmsg.c | 3 +- arch/powerpc/xmon/xmon.c | 6 +- arch/um/kernel/kmsg_dump.c | 13 +- drivers/hv/vmbus_drv.c | 17 +- drivers/mtd/mtdoops.c | 5 +- fs/pstore/platform.c | 5 +- include/linux/kmsg_dump.h | 52 +-- include/linux/printk.h | 1 + kernel/debug/kdb/kdb_main.c | 10 +- kernel/printk/internal.h | 4 +- kernel/printk/printk.c | 427 ++++++++++----------- kernel/printk/printk_safe.c | 29 +- 13 files changed, 281 insertions(+), 303 deletions(-) -- 2.20.1