Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3042238pxb; Mon, 25 Jan 2021 05:38:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuhtfp5ZMGvFQMeEIha5KL7s3pgc8z8InIRjTbFemhWOWKKh+UR9MNbPDTMPkrSjxOzYkp X-Received: by 2002:a05:6402:270d:: with SMTP id y13mr477773edd.149.1611581886621; Mon, 25 Jan 2021 05:38:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611581886; cv=none; d=google.com; s=arc-20160816; b=V0OGH0Rc1oS2Pf9Js41lNgnwekQwTZSIJP0rfD4II0tW7NGszCi8KaSRIWdIb+8JFJ I0+SvTYzcqhXdQ/HaOO5lrwzLwU9ieE0iiadh65VYrFWcDtxuwNk+PjNs9OebS/BvLs9 gdBo21vtPV6rHYYtj0YMdPwrBseR/uorrZtNRa/Uj4jOFjUNy1N8V/inKDaFYFvJ7oRZ gQlqFByTTW1tZ37wWEgUG/P80yxEpz8Zlx+RrjhO3cfefOkTqJ1J+87I6CR+hohc1edq ulK0RNRRKdj0F+TCq0/4juW4fVdIySf0PX7tNsO5dS3QCB/8/tLNcHXLT1WTWl8gegrS ZDOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=PkfJYyLpqGTZ6t5e8ms5ekE3jqDy84Phvo4KKUJXLHc=; b=HxSXv37GRXM1ZXR3WMLtYazLnNC51xw82J+G9vl7rQL5GOU08PV2Ts0XKrbUzWt4r3 gSjK6W4z33vULrs+jREhloucqcXgwJ9M87mJj83uHtjsy5LebQOULqeLr35nXo677oIS fnZE10oVOGMhdsslK9pCJk5kGizGc7WTyWPxjAOenCBECaFF84o+iUJrwpEPSfyNkZZ2 21eC7iRRaY1DsX4J8r7/CFMOTtxvggBppL959FVh2bYgKrn+I2VWGZ1I6Oufeg6L8ri7 d7u52NoK5rY4zgtrsWtFqFh1ADDl28nPBU16+Mft4Rxc2NFODsIrJYpeqJlrZcufxOYm Z/xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=gLzZteCM; dkim=neutral (no key) header.i=@linutronix.de; 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=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d11si5945384ejr.349.2021.01.25.05.37.39; Mon, 25 Jan 2021 05:38:06 -0800 (PST) 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=@linutronix.de header.s=2020 header.b=gLzZteCM; dkim=neutral (no key) header.i=@linutronix.de; 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=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728836AbhAYNfZ (ORCPT + 99 others); Mon, 25 Jan 2021 08:35:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728936AbhAYNeC (ORCPT ); Mon, 25 Jan 2021 08:34:02 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43C40C06178A for ; Mon, 25 Jan 2021 05:32:54 -0800 (PST) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1611581542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PkfJYyLpqGTZ6t5e8ms5ekE3jqDy84Phvo4KKUJXLHc=; b=gLzZteCMJe6cD4lkE7i17bpR+laVMcwbKwLKBXz4LtRNR640W8oGzJ9Vm6weby0xTCAL+D F/TP5Zxn+TWHJ/vTYoAFy8iEM7GFC3yWFxxfiE4S9zV/gEpohckcpRLDfs0k8VsOftgQPW sqv5N/NV1AljIcPylhpMdcZXq+ejTODbjYiojG5PdTSs5e54F5eRwYh10xyIv2LY7ONmCK fsxiuTxsx2E6wFDNyBwR16lySGg7NFW1wxVi48p6FYxnpGt/NFE6yKUfVX5j2cGPUKMtkN mji/uMu2FxX17Q3oQ7sYxzRXX8OYJlF1I4xcml/pN5dQtwvsW9nqZLPycQmW/A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1611581542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PkfJYyLpqGTZ6t5e8ms5ekE3jqDy84Phvo4KKUJXLHc=; b=yWieyC4dPs5a8PmcLNhJdAXEj9EbAywVkoxmlZdFPr6k7pPOMWkbr52EUj0S+xUtMVZevC 8msPmQPGYS+RZqAA== To: "J. Avila" Cc: Peter Zijlstra , Petr Mladek , Sergey Senozhatsky , Sergey Senozhatsky , Steven Rostedt , Linus Torvalds , Greg Kroah-Hartman , Andrea Parri , Thomas Gleixner , Paul McKenney , Saravana Kannan , kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: Issue in dmesg time with lockless ring buffer In-Reply-To: <20210122235238.655049-1-elavila@google.com> References: <20210122235238.655049-1-elavila@google.com> Date: Mon, 25 Jan 2021 14:38:20 +0106 Message-ID: <87im7l2lcr.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-01-22, "J. Avila" wrote: > When doing some internal testing on a 5.10.4 kernel, we found that the > time taken for dmesg seemed to increase from the order of milliseconds > to the order of seconds when the dmesg size approached the ~1.2MB > limit. After doing some digging, we found that by reverting all of the > patches in printk/ up to and including > 896fbe20b4e2333fb55cc9b9b783ebcc49eee7c7 ("use the lockless > ringbuffer"), we were able to once more see normal dmesg times. > > This kernel had no meaningful diffs in the printk/ dir when compared > to Linus' tree. This behavior was consistently reproducible using the > following steps: > > 1) In one shell, run "time dmesg > /dev/null" > 2) In another, constantly write to /dev/kmsg > > Within ~5 minutes, we saw that dmesg times increased to 1 second, only > increasing further from there. Is this a known issue? The last couple days I have tried to reproduce this issue with no success. Is your dmesg using /dev/kmsg or syslog() to read the buffer? Are there any syslog daemons or systemd running? Perhaps you can run your test within an initrd to see if this effect is still visible? John Ogness