Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6234853ybc; Wed, 27 Nov 2019 17:54:32 -0800 (PST) X-Google-Smtp-Source: APXvYqyUgy5W3kfvvXXRnIiNEY4cMrD3zpxVyaHslArjKA5vqOnqr8k923eOrd4iDTomyy6+9swQ X-Received: by 2002:a50:9fc1:: with SMTP id c59mr36006142edf.305.1574906071913; Wed, 27 Nov 2019 17:54:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574906071; cv=none; d=google.com; s=arc-20160816; b=P78WO0tQmJuTqYWnLgQihigElK6kPc8yVu5e1Eh7LVmp2VSR9ru4Baleg659tW+3Rp uPPEwYO/64nCJ+5e7yc11A63SsBcmoVpajWBxBoWRnspHX+7lF0EUglL7chGs6pk/T06 pepJZ3Xx2Le83zb8ZN/u861Jmehqn5ykX9/kmDZO+bQY1h7joYH+4gTuuaQbF+uoNYyV NiuWD7DrVRzqDkd2EDmbdkm+ObaJ8QTDKUSQ3SKyabLHq0plP8WcyQcWVWg3h55u9WYK Er7epVaclZbcfxaumg5gXKOCCoHLsN0eBRqHpwOtL7cjsRNOrnYzmbx+J8zJG11zKYJq Jfeg== 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:from; bh=w8qZ5bMb1W3Ef1g8+lBpH7sQEZz2MYi28DENgN9BumA=; b=dhCIXAhQFEA//viqu85m8OrJ2x9b7ADaxYMVYvK27d+mmosquEnhyaQfo9Hw7OvTAE 3F7qXrQc+7fVS9qtl9DOjGvVgQVszEsJhL9menIf0dGm4MJfLUrcWamiGSBFs+HsJnon Ea0VQosOfmgYZeFq9+bmASFguBVaAMkMWxSousdPJK2BL3acmYSuPy0u5o1WsmzmdEBj 7lzgKpQhayGH+SzFwG4FbEV0RyjhtnjTCblvLza6gmLvNudvrRJbQZxrWKgGyang6Biy Yz/dMNtJ3qjLQYoyar8N8yusL6oBkFjw0e57HfFziLiQ2sPXZ8jvdT1Wpf80yx6BRrJ5 0YHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si10695509ejf.205.2019.11.27.17.54.08; Wed, 27 Nov 2019 17:54:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727954AbfK1BxM (ORCPT + 99 others); Wed, 27 Nov 2019 20:53:12 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:45767 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727795AbfK1BxK (ORCPT ); Wed, 27 Nov 2019 20:53:10 -0500 Received: from [5.158.153.53] (helo=g2noscherz.lab.linutronix.de.) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1ia8zI-00083b-6R; Thu, 28 Nov 2019 02:52:57 +0100 From: John Ogness To: linux-kernel@vger.kernel.org Cc: Peter Zijlstra , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Greg Kroah-Hartman , Andrea Parri , Thomas Gleixner , Sergey Senozhatsky , Brendan Higgins , kexec@lists.infradead.org Subject: [RFC PATCH v5 0/3] printk: new ringbuffer implementation Date: Thu, 28 Nov 2019 02:58:32 +0106 Message-Id: <20191128015235.12940-1-john.ogness@linutronix.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, This is a follow-up RFC on the work to re-implement much of the core of printk. The threads for the previous RFC versions are here[0][1][2][3]. This RFC includes only the ringbuffer and a test module. This is a rewrite of the proposed ringbuffer, now based on the proof of concept[4] from Petr Mladek as agreed at the meeting[5] during LPC2019 in Lisbon. The internal structure has been reworked such that the printk strings are in their own array, each separated by a 32-bit integer. A 2nd array contains the dictionary strings (also with each separated by a 32-bit integer). A 3rd array is made up of descriptors that contain all the meta-data for each printk record (sequence number, timestamp, loglevel, caller, etc.) as well as pointers into the other data arrays for the text and dictionary data. The writer interface is somewhat similar to v4, but the reader interface has changed significantly. Rather than using an iterator object, readers just specify the sequence number they want to read. In effect, the sequence number acts as the iterator. I have been communicating with Petr the last couple months to make sure this implementation fits his expectations. This RFC is mainly to get some feedback from anyone else that may see something that Petr and I have missed. This series also includes my test module. On a 16-core ARM64 test machine, the module runs without any errors. I am seeing the 15 writing cores each writing about 34500 records per second, while the 1 reading core misses only about 15% of the total records. John Ogness [0] https://lkml.kernel.org/r/20190212143003.48446-1-john.ogness@linutronix.de [1] https://lkml.kernel.org/r/20190607162349.18199-1-john.ogness@linutronix.de [2] https://lkml.kernel.org/r/20190727013333.11260-1-john.ogness@linutronix.de [3] https://lkml.kernel.org/r/20190807222634.1723-1-john.ogness@linutronix.de [4] https://lkml.kernel.org/r/20190704103321.10022-1-pmladek@suse.com [5] https://lkml.kernel.org/r/87k1acz5rx.fsf@linutronix.de John Ogness (3): printk-rb: new printk ringbuffer implementation (writer) printk-rb: new printk ringbuffer implementation (reader) printk-rb: add test module kernel/printk/Makefile | 3 + kernel/printk/printk_ringbuffer.c | 910 ++++++++++++++++++++++++++++++ kernel/printk/printk_ringbuffer.h | 249 ++++++++ kernel/printk/test_prb.c | 347 ++++++++++++ 4 files changed, 1509 insertions(+) create mode 100644 kernel/printk/printk_ringbuffer.c create mode 100644 kernel/printk/printk_ringbuffer.h create mode 100644 kernel/printk/test_prb.c -- 2.20.1