Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp323576ybh; Sat, 18 Jul 2020 05:14:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbiHBXXPUfHh4jNT8aIg9CpGF+26ND8rKujspA7yRyx+G/hj1OSqZtETFHAa3ikaw2rP4/ X-Received: by 2002:aa7:d5da:: with SMTP id d26mr2126854eds.248.1595074443951; Sat, 18 Jul 2020 05:14:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595074443; cv=none; d=google.com; s=arc-20160816; b=lrvSfLmfLz6ZdHTIoTKOTIKfg8WoQr1uIZPfFlonAbVykg6mkFcUoJeDNpuX23pSXk UnZPtbsTdLYBwpkXPfZY9oEKYkamxxgp5Y72Ueul0FZMdcD+22pv1V7KZkopzzk+B0T+ f3kTPWurlauWlz6rvI9ebUL+3+q6XsHuJ+FnU3/lwz+KBXadqhoGjREiJWloktq6mUPC LL76OY8UMJK7+lIXqcP7QLk9Pf8xw4iPBbS/BEmfi5q6DF+N2kUZjANZllzTXntII9yF 59KX9hf5JK6Qg1OJ+/4xNHzTLCyol1GuH38kQf+W2PiUPXrF3hqLyj47qLT1hSTPvD5m JkbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yd988VmnLN/Evex/lk7gxM8L3Wlcp7x47UNg48SVZhM=; b=ZtP5U32C06XF5m8bZJv8X5QMMYCiIN4CtDxQKZkhS5Onlkn6pnBtHiK6GKWyW0o8D8 XzGzCGP25Yjv2yk3QnRVoTAE9J/E1yhl95RCslHvP8y3DHgT2Wk8EVK2E15AHqNSDhpc wEM70vmU3hcRRE2beH2s18wbmoxUkdLnYvRDK1+/DQ4bTsLXlWzB0kUaAfncofjGH+mm UYh09BSen/gaaqpZONAzcocm2bLOIiVwoxyZS/AxP99DB4Qx+9qIFnqgsUzhAFpsMmoV MfRy9tQ2DJsHrHR11YvhxElVU8opBRYqunJMLEjIeUmd4xdvoqi/Ct8rt/z5fKB+5eFH a7rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="b/eh4WHm"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u9si6556993ejx.100.2020.07.18.05.13.39; Sat, 18 Jul 2020 05:14:03 -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=@google.com header.s=20161025 header.b="b/eh4WHm"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726574AbgGRMLC (ORCPT + 99 others); Sat, 18 Jul 2020 08:11:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726481AbgGRMLB (ORCPT ); Sat, 18 Jul 2020 08:11:01 -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 21E78C0619D2 for ; Sat, 18 Jul 2020 05:11:01 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id a6so13683124wrm.4 for ; Sat, 18 Jul 2020 05:11:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yd988VmnLN/Evex/lk7gxM8L3Wlcp7x47UNg48SVZhM=; b=b/eh4WHmjFhZP0lwcUYhjcYOR8wTV6RAZwQKbcCPlico2mH9f4EbZh42If1ty39AEh py+pffvII5FYXMWYnxdnLiDX8d8pxCqRwDDKXqOSuBXxr12eUcogk0D4zDcXH/qB6pNB 8diikFnmQnqRAMus0TynztvS1hvlLcQ5SeLm27TUesbXVqHxUJrirp+Ifqj7URnxyugn QtZ0QNTlW3CW7slDK84XxSymljY77Fz8ee8IJnN9sUW0WzoWx6VXfDXC0UBC3OMkzHxv BlGIJXrNFnmMya7/R2ddpeE8RDRtKbjZglC4KHbtC9zk5rG26lPkYpApgwIL47lbIcpW 0J9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=yd988VmnLN/Evex/lk7gxM8L3Wlcp7x47UNg48SVZhM=; b=qRZPR0gE/PamieNstH9gKSgqKPUnKQq0AQMVKdw/w548EKUf/mq+gkzFGkBXHlcj7v Y8YB1/bjx/ByvYb/wo84n5l6hWsAFzNzMs5betGfaZuMK00MoLwNjCdhTeXgQ4AyQIIl MioOC/rYODHBlgvbEjXJsdNnQg/7DzQnSbb3F7YaZ0m5IT/pFa0sT0sh1au9Po5duM+/ QkvDz/oip1HdZGGZoVIVj+b/V0cmcdEWHtA0ZfhNF3w1qULUZKJ81TeDF+E7HsxzhY+n pxiWpNzhn1ShBgMWuod0cVAEvK0kwYqA4m5UWbOGgEkVLaAOwxT2ZRd66zY5EBIBuFAY oglA== X-Gm-Message-State: AOAM533DeL7IjOsWj6sRAXvnFXmtYH9AuUYOwnvAAljU/5wlvx+ixiYY VZ9hdGRTUZgBfGaHMZ2CI68/Qw== X-Received: by 2002:a5d:62d1:: with SMTP id o17mr13994838wrv.162.1595074259455; Sat, 18 Jul 2020 05:10:59 -0700 (PDT) Received: from elver.google.com ([100.105.32.75]) by smtp.gmail.com with ESMTPSA id h199sm20123027wme.42.2020.07.18.05.10.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jul 2020 05:10:58 -0700 (PDT) Date: Sat, 18 Jul 2020 14:10:53 +0200 From: Marco Elver To: John Ogness Cc: Petr Mladek , Peter Zijlstra , Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Greg Kroah-Hartman , Andrea Parri , Thomas Gleixner , Paul McKenney , kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 4/4] printk: use the lockless ringbuffer Message-ID: <20200718121053.GA691245@elver.google.com> References: <20200709132344.760-1-john.ogness@linutronix.de> <20200709132344.760-5-john.ogness@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200709132344.760-5-john.ogness@linutronix.de> User-Agent: Mutt/1.14.4 (2020-06-18) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 09, 2020 at 03:29PM +0206, John Ogness wrote: > Replace the existing ringbuffer usage and implementation with > lockless ringbuffer usage. Even though the new ringbuffer does not > require locking, all existing locking is left in place. Therefore, > this change is purely replacing the underlining ringbuffer. > > Changes that exist due to the ringbuffer replacement: > > - The VMCOREINFO has been updated for the new structures. > > - Dictionary data is now stored in a separate data buffer from the > human-readable messages. The dictionary data buffer is set to the > same size as the message buffer. Therefore, the total required > memory for both dictionary and message data is > 2 * (2 ^ CONFIG_LOG_BUF_SHIFT) for the initial static buffers and > 2 * log_buf_len (the kernel parameter) for the dynamic buffers. > > - Record meta-data is now stored in a separate array of descriptors. > This is an additional 72 * (2 ^ (CONFIG_LOG_BUF_SHIFT - 5)) bytes > for the static array and 72 * (log_buf_len >> 5) bytes for the > dynamic array. > > Signed-off-by: John Ogness > Reviewed-by: Petr Mladek It seems this causes a regression observed at least with newline-only printks. I noticed this during -next testing because various debugging tools (K*SAN, lockdep, etc.) use e.g. pr_{err,warn,info}("\n") to format reports. Without wanting to wait for a report from one of these debugging tools, a simple reproducer is below. Without this patch, the expected newline is printed. Thanks, -- Marco ------ >8 ------ --- a/init/main.c +++ b/init/main.c @@ -1039,6 +1039,10 @@ asmlinkage __visible void __init start_kernel(void) sfi_init_late(); kcsan_init(); + pr_info("EXPECT BLANK LINE --vv\n"); + pr_info("\n"); + pr_info("EXPECT BLANK LINE --^^\n"); + /* Do the rest non-__init'ed, we're now alive */ arch_call_rest_init();