From patchwork Mon Jan 9 10:07:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Ogness X-Patchwork-Id: 3734 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2071234wrt; Mon, 9 Jan 2023 02:11:41 -0800 (PST) X-Google-Smtp-Source: AMrXdXtTNMfPEGkZIaQ/5pTEPqz5Wgmg0iKeXJs5yfjFNCMtBtkXhgaq1UW9O51jhti+yApT84HM X-Received: by 2002:a05:6402:2484:b0:46c:6ed1:83ac with SMTP id q4-20020a056402248400b0046c6ed183acmr60301165eda.9.1673259101625; Mon, 09 Jan 2023 02:11:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673259101; cv=none; d=google.com; s=arc-20160816; b=HFsNbDcjG53357Cwt9QyZgaua8BiQZdZe1jkh/6uHs4t0C06i3BeUFYMGd/oJyj9BZ 26jOLQyKU/pcResx6NuJwc0i37UxGfMs/QdV3LA2ejT8JCYlNNb9Jg44BDsqJIWn3MAB UUKWKnnk8oiXAPolsoIgKHmMj3SABtcxLYgnYk1OqgNVArq0xtqzjfV7dKkavVtcxzdZ 1+WLXtW41XlHbNzkp6q0O6jn/n1k3oFQ0WBH49CbXyIIJsT9KQlZKNSttslbod4EcndS HBhuv6T1X2hWHhLBp2+20q8OGuxtLiXnwBlH6R1H/mR2aRYMkDAl4VgCOv2HQRiwe5ju TpGg== 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=72AG3JRI1xk+MbrVQlkAivsLz4+7Y+wE7DkvkbW3NJ0=; b=fdb8Q5wkE+exN/DGjjzpigjB8M7Tvyr7SDW//BQsY3/26UvyyJ0EVCQchaWY7w/Anx 9GwlJ5Vivz7U4cOR3hqN2oNGhh4c+94/AmDVvN0DAj6WbraPzk/oarLDHrIRtRflr730 u+QrmLbMV8RcdwSEuKvNSlFGFmdHk7FEyHSKrIVslUc89l48WRu4vjdeE03+Rny37B9q /oOh47VJhHdHUa+/uJSChE9S4eWnMTy1S9A+K2yMCtzLz6d07Obkt2Jmm5kowKVemvLe n3yZzL8k7Up38so3E+MNwAEtAqUYyPJxK0RBmDG2B/uLfS76RVLjqVoeaK+KO47bO7jU FhRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=WBCGKDbZ; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h19-20020aa7c613000000b0046b05ca8929si7702850edq.592.2023.01.09.02.11.17; Mon, 09 Jan 2023 02:11:41 -0800 (PST) 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=@linutronix.de header.s=2020 header.b=WBCGKDbZ; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233686AbjAIKJK (ORCPT + 99 others); Mon, 9 Jan 2023 05:09:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236859AbjAIKIr (ORCPT ); Mon, 9 Jan 2023 05:08:47 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 662261054F for ; Mon, 9 Jan 2023 02:08:46 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673258924; 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=72AG3JRI1xk+MbrVQlkAivsLz4+7Y+wE7DkvkbW3NJ0=; b=WBCGKDbZ4yoy50cnZXwyXsgLTAdMCARw5Ho+zt8bJKSWWdNJrbSM+vjnq3E+9CNeSLymhO 6PIE7fe5XFBNv7QO7LRWGpwPFY9IW+jBBeToMHwUMjDS6byCwHsQgv1pUyYJgYP0u9HefK SbqkgOeqIY7QvUBWJKoHoveufAOGGU4WekVJTVgaqiJPAMbM7dgQ7Gx0Bw9ql792aG4ejh MUD0+sSelXJf/buifxzQlniwGHRtLtsIhoJnbfOpQYazd0ilElLsBq2YURZ9tG6lN4dIRj xcOZwCk4YGa8uFAkT/JJ9uyTTmG8wD/959aQW7ppArcwlxNMOMX2qnGeoZZrfQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673258924; 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=72AG3JRI1xk+MbrVQlkAivsLz4+7Y+wE7DkvkbW3NJ0=; b=bHSiILY/ryGpaX4ilQZkUvRbgnBnqyAaTFQ7CDp10BjhQazWgJZAz82Ut89++6djbzvEyE 92lZyHf5QyWslYCg== To: Petr Mladek Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: [PATCH printk v5 0/8] printk: cleanup buffer handling Date: Mon, 9 Jan 2023 11:13:52 +0106 Message-Id: <20230109100800.1085541-1-john.ogness@linutronix.de> MIME-Version: 1.0 X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754539335709442911?= X-GMAIL-MSGID: =?utf-8?q?1754539335709442911?= Hi, This is v5 of a series to cleanup console buffer handling and prepare for code sharing with the upcoming threaded/atomic consoles. v4 is here [0]. The main purpose of the series is to introduce two new lockless functions to handle reading and formatting of printk messages. These functions can then be used from any context, which is important for the upcoming threaded/atomic consoles. The series also helps to cleanup some of the internal printk interfaces and cleanly separate formatting code from outputting code. Changes since v4: - Make console_prepend_dropped() a NOP for !CONFIG_PRINTK to workaround compiler warnings. - In devkmsg_read() use printk_get_next_message() for the wait condition instead of looping to retry the actual read. - Add an argument @may_suppress to printk_get_next_message() so devkmsg_read() can specify that records should not be skipped based on loglevel. John Ogness [0] https://lore.kernel.org/lkml/20230105103735.880956-1-john.ogness@linutronix.de John Ogness (6): printk: move size limit macros into internal.h printk: introduce struct printk_buffers printk: introduce printk_get_next_message() and printk_message printk: introduce console_prepend_dropped() for dropped messages printk: use printk_buffers for devkmsg printk: adjust string limit macros Thomas Gleixner (2): console: Use BIT() macros for @flags values console: Document struct console include/linux/console.h | 100 +++++++++---- include/linux/printk.h | 2 - kernel/printk/internal.h | 45 ++++++ kernel/printk/printk.c | 308 +++++++++++++++++++++++---------------- 4 files changed, 297 insertions(+), 158 deletions(-) base-commit: 6b2b0d839acaa84f05a77184370f793752e786e9