Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp292634pxu; Thu, 15 Oct 2020 04:15:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+8ZzCdHUhtbSQ6s8EdEuU4P4y8zckjFsFQSkXWZccDLXdksJDPxdVA7h+3hp6uLFItm1t X-Received: by 2002:aa7:d0d8:: with SMTP id u24mr3800998edo.349.1602760522991; Thu, 15 Oct 2020 04:15:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602760522; cv=none; d=google.com; s=arc-20160816; b=MQvBfj3lAlm6RC2xWmhs/Ic9iVA/Z6/T7dNO/kXfHU2sWQOmueEXiOCkc+tjcc0rzu OwYq8m0hheZCv+se+RhgS0a+0tbguyjqSL7NZgtjkufuw8L/QNNse/m1HlD0F8jCCjhU FxCyhYFv/1p2VvcGg79J8m62xYjC5WOQo1hhD13cb0eA4pLjdPcD/NzVpPGN2ZsAAEyr /4V45rX8uD4OEWy/2KVwhdrl4TsHYJFA7Mimceh9K9bDY8ZfRhoI77KILbeFxkwOEJOC xD+s2U23bpxpMU+w43wa4q3USwugkWjwUeugmrKW5etcnDdBLrTT/EVe6gr0bjSlk5MD SBBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=pIIqF3rG0mMLMMV2BGG4gKCsXK1ncAM12/M5rg9O9DI=; b=oUZjIPto28qdVnWaN0AkMpwXuMTEmxOtL4W/7v6wY5KRFKUAzLczOtDOxciUa3WQcj eTwvJJcOsBVV6mxIapBPUVSgNG6kHwdpmVYJfELUnTJNyJf5045aQMiSJy0RggrPBcKi R94m5YyTE8WGQ3uwAnFd22jRVokSO91zYhC9mtuFaUJ321BWDWBwBRgGcTlXqyAUm21m xCu0wQ9W3T1wp/xWD4X7vASSnXv1ApLqCCgpLiKsxcfeyR3idnODs39k9DfVD/IvA2qb Dvo1uSNO7sOiwHYrZVJjkxy3r71ddR3Uk6uWzTvmblIi3QQzjPi1JTzuOjdcD+LckGMT UYjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HkHdg2eC; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga21si1877930ejb.100.2020.10.15.04.15.00; Thu, 15 Oct 2020 04:15:22 -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=@gmail.com header.s=20161025 header.b=HkHdg2eC; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729256AbgJOHwH (ORCPT + 99 others); Thu, 15 Oct 2020 03:52:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727413AbgJOHwG (ORCPT ); Thu, 15 Oct 2020 03:52:06 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85E94C061755 for ; Thu, 15 Oct 2020 00:52:06 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id x7so2208963wrl.3 for ; Thu, 15 Oct 2020 00:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=pIIqF3rG0mMLMMV2BGG4gKCsXK1ncAM12/M5rg9O9DI=; b=HkHdg2eC0VICkGOjetUr1dVqtt6y2SKX8SJjno7O/41mlGnCGVFYUM/JVjN6/L628e eC03syETsQY7SjyUR6Ob3Mu3k10p72XO1H/Y0MYAd8S8YA3483jpeXSkbiU36H/yjvtM MnAL37OIF83Y9dxjZ+zz4w43kVbclC0kRwz1RWo8TKb2D3sZ/BiQdAm7xi5EB7zN50JB b88cTQSFpuAyntbnnFhZ/Uziir/aban1FEGcDah/qzafJUmZ8G0sb2upocWY9VljvPL8 A6yrycVVX3M5spSQ2c0P5T1eofpEckJhxtlESfmtNDU5f8d88ZUZh+pPYOkTSE4wIY5G 3BiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=pIIqF3rG0mMLMMV2BGG4gKCsXK1ncAM12/M5rg9O9DI=; b=RTeyzaNZDBCnCBI2mrhfxAIu7dmf7Eq7G3eiVNpo9i9SilQx1BxZubi0k2MeFfVJpf iodHD4HuQcdFVKt4X8vg2vv1cGKz5rbcWtxxoiQs2uRInusidm3Ysp1lrieOTBk/Zzvl JmYnsP/a/VIPDNt9wsW8wNqt04OwXDd5IdsTi83i3s5D8luDba8zKQOFX6YfOWulpnYE t3guiyO2Q6eqcdIQYDsVWH70NeRF7ERjrgLMw5ZfzUp4If3lcOJOXIPYXd7OgD1Ej+GA nlsy4e7CtT30p8hyoDmsL1MKbj+EVQZHyNIwa0nDZ5pRRRtRtr8qVRStMOrNlaD90oRB Ao5g== X-Gm-Message-State: AOAM532GdyIvmY7O6Zy6setpdNkgO4twmgtYSZGLdivtUdMZlHh+Wpgn FUcaZ9WDg9AriTctIS0me2KVptgvJVXf2snp X-Received: by 2002:adf:912e:: with SMTP id j43mr2708221wrj.325.1602748325233; Thu, 15 Oct 2020 00:52:05 -0700 (PDT) Received: from alley (176-114-240-43.rychlydrat.cz. [176.114.240.43]) by smtp.gmail.com with ESMTPSA id f6sm2992558wru.50.2020.10.15.00.52.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2020 00:52:04 -0700 (PDT) From: Petr Mladek X-Google-Original-From: Petr Mladek Date: Thu, 15 Oct 2020 09:52:02 +0200 To: John Ogness Cc: Geert Uytterhoeven , Linus Torvalds , Sergey Senozhatsky , Steven Rostedt , Andy Shevchenko , Rasmus Villemoes , Peter Zijlstra , Linux Kernel Mailing List , Daniel Thompson Subject: Re: [GIT PULL] printk for 5.10 (includes lockless ringbuffer) Message-ID: <20201015075202.GD13775@alley> References: <20201012144916.GB10602@alley> <87lfg85xz1.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87lfg85xz1.fsf@jogness.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 2020-10-14 23:01:30, John Ogness wrote: > On 2020-10-14, Geert Uytterhoeven wrote: > >> - Fully lockless ringbuffer implementation, including the support for > >> continuous lines. It will allow to store and read messages in any > >> situation wihtout the risk of deadlocks and without the need > >> of temporary per-CPU buffers. > > > > linux-m68k-atari_defconfig$ bloat-o-meter vmlinux.old vmlinux.lockless_ringbuffer > > add/remove: 39/16 grow/shrink: 9/15 up/down: 214075/-4362 (209713) > > Function old new delta > > _printk_rb_static_infos - 180224 +180224 > > _printk_rb_static_descs - 24576 +24576 > > 131072 of _printk_rb_static_infos is reserved for dictionary usage. The > rest (49152) is for the record meta data. Previously any dictionary > usage and record meta data was embedded in the message buffer (log_buf, > 65536). > > Since the meta data is now separate, setting CONFIG_LOG_BUF_SHIFT=15 > would provide roughly the same amount of record storage as > CONFIG_LOG_BUF_SHIFT=16 did with vmlinux.old. Then there would be: > > 32768: message buffer > 24576: meta data > 65536: dictionary data > 12288: descriptor data > > Excluding the dictionary data, the total is 65536. > > (With vmlinux.old there is 65536 total with CONFIG_LOG_BUF_SHIFT=16.) > > It is the reserved dictionary data that is hurting us here. > > Should we provide a config option to kill the dictionary data? This might be the best solution. AFAIK, they are currently used only by journalctl. IMHO, most people are not aware of it and it is not a widely used feature. > Should CONFIG_LOG_BUF_SHIFT do an implicit -1 so that the sizes (without > dictionary data) are about the same as before? Beware that this might result in slightly reduced amount of stored messages. The storage of the dictionary meta data is less effective because they are not longer stored together with the messages and we need to guarantee a space for them. I would prefer to keep the current global default. In average, the size of the systems is growing. They produce more messages and have more memory available. Yeah, the space hurts on small systems. We might modify the default for them. Or we could allow to disable the dictionary. Note that this is not the full picture of the printk memory usage. I believe that we will be able to get rid of printk_safe and printk_nmi. It would safe 16kB per-CPU at runtime. If we make the dictionary optional and remove the per-CPU buffers then we might end-up with less memory needs than before. Best Regards, Petr