From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753814AbdLDNsl (ORCPT ); Mon, 4 Dec 2017 08:48:41 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:46151 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752060AbdLDNsj (ORCPT ); Mon, 4 Dec 2017 08:48:39 -0500 X-Google-Smtp-Source: AGs4zMY6s3IZc2KBQEi6RXhbNb8jLhnPSc1sneb+sq5pnqpJCz85vAmb0Ax+gOMT+vHMMohzim3vUg== From: Sergey Senozhatsky To: Steven Rostedt , Petr Mladek Cc: Jan Kara , Andrew Morton , Peter Zijlstra , Rafael Wysocki , Pavel Machek , Tetsuo Handa , Tejun Heo , linux-kernel@vger.kernel.org, Sergey Senozhatsky , Sergey Senozhatsky Subject: [RFC][PATCHv6 00/12] printk: introduce printing kernel thread Date: Mon, 4 Dec 2017 22:48:13 +0900 Message-Id: <20171204134825.7822-1-sergey.senozhatsky@gmail.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, RFC A new version, yet another rework. Lots of changes, e.g. hand off control based on Steven's patch. Another change is that this time around we finally have a kernel module to test printk offloading (YAYY!). The module tests a bunch use cases; we also have trace printk events to... trace offloading. I'll post the testing script and test module in reply to this mail. So... let's have some progress ;) The code is not completely awesome, but not tremendously difficult at the same time. We can verify the approach/design (we have tests and traces now) first and then start improving the code. 8<---- ---- ---- This patch set adds a printk() kernel thread which let us to print kernel messages to the console from a non-atomic/schedule-able context, avoiding different sort of lockups, stalls, etc. v5->v6: -- add hand off control (Steven) -- dropped some of the previous patches (auto emergency mode, etc.) -- remove `atomic_print_limit' knob -- tons of other changes. v4->v5 -- split some of the patches -- make offloading time-based (not number of lines printed) -- move offloading control to per-CPU -- remove a pessimistic offloading spin from console_unlock() -- adjust printk_kthread CPU affinity mask -- disable preemption in console_unlock() -- always offload printing from user space processes -- add sync version of emergency_begin API -- offload from printk_kthread as well, to periodically up() console_sem -- limit `atomic_print_limit' to `watchdog_thresh' -- and some other changes... v3->v4 (Petr, Jan) -- add syscore notifiers -- fix 0001 compilation warnings -- use proper CPU notifiers return values v2->v3 (Petr, Pavel, Andreas): -- rework offloading -- use PM notifiers -- dropped some patches, etc. etc. v1->v2: -- introduce printk_emergency mode and API to switch it on/off -- move printk_pending out of per-CPU memory -- add printk emergency_mode sysfs node -- switch sysrq handlers (some of them) to printk_emergency -- cleanus/etc. Sergey Senozhatsky (12): printk: move printk_pending out of per-cpu printk: introduce printing kernel thread printk: consider watchdogs thresholds for offloading printk: add sync printk_emergency API printk: enable printk offloading PM: switch between printk emergency modes printk: register syscore notifier printk: force printk_kthread to offload printing printk: do not cond_resched() when we can offload printk: move offloading logic to per-cpu printk: add offloading watchdog API printk: improve printk offloading mechanism Documentation/admin-guide/kernel-parameters.txt | 7 + drivers/base/power/main.c | 5 + include/linux/console.h | 7 + kernel/printk/printk.c | 552 ++++++++++++++++++++++-- kernel/watchdog.c | 6 +- 5 files changed, 551 insertions(+), 26 deletions(-) -- 2.15.1