Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp854866pxu; Wed, 14 Oct 2020 16:05:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxb5mTvBVr/d/BTrDJko/AbpegA9XF4HjqsjxXhFmGLy0bP633dTgAWzPoRTjoHvvCfiThr X-Received: by 2002:a50:d5de:: with SMTP id g30mr1386130edj.245.1602716708260; Wed, 14 Oct 2020 16:05:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602716708; cv=none; d=google.com; s=arc-20160816; b=NvsCmqyXZ8xjw6RzUDIfO4lbRSQ/QKQhq9fAalm0g4KrstR9aytwnFasebLqOHjlm0 AxWqGdNfHP5eiOYvR67PhfaLsKJB95tkf/Kic8nugcXzGpRScwnK6wbp8DmChtpaQgxO +ttniO7ryBAJjWOsKTGANuhMJB5mBrPaoEsxXt1SZT3QkSs8w+LyIVkcGWpBQ2EA78aV qHJe8C6j6bV+QSX1+zf/nBnFZ01Eh2nKGq+RTlVFdROIVJwB+Eq6HusnNkjuOSJJvAEK bwwkfD4bsFmAo6NRwYwUVca1PVZKjsFq066j3pLps5IkUZEDEiOjxAV5emCE0Ze1lHix yBxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=2FYcnBU8H0J4i4s6bItghVeyyamolxWxwc9jW/lSt9o=; b=BQArpLFWpesEYCzrFIgclqAXWhRTgPzT9l4X2r2fdPRNeGQD8229osuNFqARUUgDsp 198W3iYF2f/aO3a/iaaepKw150IvE+XB9D+gohSucTwekUXW3ZGa0YQ8gBpuJfee9rof cq2SCxG6ofkiQiFxs69ABRMT5OTjb2wMDlenvyTpREfC2OD2Z+Q1uxpJ7XiOAZ7kL53i 6SdqI6E4NkDYUBcs6UDPVfaemP+4rkOw8T7OVQI1HObplKLBlviC+2TuFC/2dyK6GJY3 8H651i84d4kgOzL7w9/ZoqKMTGwu/erckV91tebz1QCmCE+Cb+mYHWZ8KF6egAHOELcz KkpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=WNh39a4g; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h27si927992ejd.668.2020.10.14.16.04.45; Wed, 14 Oct 2020 16:05:08 -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=@rasmusvillemoes.dk header.s=google header.b=WNh39a4g; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727923AbgJNO6d (ORCPT + 99 others); Wed, 14 Oct 2020 10:58:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726780AbgJNO6c (ORCPT ); Wed, 14 Oct 2020 10:58:32 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CA58C061755 for ; Wed, 14 Oct 2020 07:58:31 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id f29so3548626ljo.3 for ; Wed, 14 Oct 2020 07:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2FYcnBU8H0J4i4s6bItghVeyyamolxWxwc9jW/lSt9o=; b=WNh39a4gl/EH3fm2dIpI4wEg2id2C8Jqzi4XG+VU1c9uCUP0ZmnRUh8SVK3yOmWd0r ZoVB+TOLaXukBMirWqTvAHmKnfBqXmYQfFK+YEpzxmsMAkSLCaf6dXsyrNAiG6VV4yzQ tI1Tv8x+t8ZyR5nfMsHnVC4bIxN7ovLlGV5xY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2FYcnBU8H0J4i4s6bItghVeyyamolxWxwc9jW/lSt9o=; b=V1/LB4NGknjHMliQg9lZji2TYlamBL/oSZ3wpCXR65eZ5zOtD3Qgrk1DTMTXZBJO5b v8VYCcoBazAsZOB4vGw5y0U00Q57WMqvd/l08eAt2LVxtswmVeT/H+wEX6+Z4KLXLA6p pxj4ERH2sm84d/bYHXhi2OYmePbNRRfg5y1e6zaWyUKmpd2Uf7mmMhwRVKiggN0rBbY1 kb210RkGnQgj8p6ZI0vo8ZHAdIKtayRJyoumLesOg8+swdPDG1ti7fYpMuh2fl+2Xqa4 cnnBL5cOoYBRnH6XwuLZ0da1P6cwjeV+XXEclNqLJRQu9KQ9Rx2IrCqT+MCKqBSJqoxN axkw== X-Gm-Message-State: AOAM5303xeUEKA0zlR6syIFFYFqT0rHTqxUdHgIhZo6UUaUMJMTfbVgf t2p1ERDM8a9p59O3EWVLevyvhEpnANJYYOwDpTE= X-Received: by 2002:a2e:45d6:: with SMTP id s205mr2086373lja.333.1602687509609; Wed, 14 Oct 2020 07:58:29 -0700 (PDT) Received: from [172.16.11.132] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id e10sm1309624ljl.41.2020.10.14.07.58.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Oct 2020 07:58:28 -0700 (PDT) Subject: Re: [GIT PULL] printk for 5.10 (includes lockless ringbuffer) To: Geert Uytterhoeven , Petr Mladek Cc: Linus Torvalds , Sergey Senozhatsky , Steven Rostedt , John Ogness , Andy Shevchenko , Peter Zijlstra , Linux Kernel Mailing List , Daniel Thompson References: <20201012144916.GB10602@alley> From: Rasmus Villemoes Message-ID: <49292e1a-7e46-b078-d15d-fb2f406317db@rasmusvillemoes.dk> Date: Wed, 14 Oct 2020 16:58:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/10/2020 16.16, Geert Uytterhoeven wrote: > Hi Petr, > > On Mon, Oct 12, 2020 at 4:50 PM Petr Mladek 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 > [...] > > Seriously?!? Or am I being misled by the tools? > > linux-m68k-atari_defconfig$ size vmlinux.old vmlinux.lockless_ringbuffer > text data bss dec hex filename > 3559108 941716 177772 4678596 4763c4 vmlinux.old > 3563922 1152496 175276 4891694 4aa42e vmlinux.lockless_ringbuffer > > Apparently not... Hm, that's quite a lot. And the only reason the buffers don't live entirely in .bss is because a few of their entries have non-zero initializers. Perhaps one could add a .init.text.initialize_static_data section of function pointers, with the _DEFINE_PRINTKRB macro growing something like static void __init __initialize_printkrb_##name(void) { \ _##name##_descs[_DESCS_COUNT(descbits) - 1] = ...; \ _##name##_infos[0] = ...; \ _##name##_infos[_DESCS_COUNT(descbits) - 1] = ...; \ } \ static_data_initializer(__initialize_printkrb_##name); with static_data_initalizer being the obvious yoga for putting a function pointer in the .init.text.initialize_static_data section. Then very early in start_kernel(), probably first thing, iterate that section and call all the functions. But maybe that's not even early enough? Rasmus