Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4115570pxu; Wed, 9 Dec 2020 08:43:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqNX4KzK+ARw6IOOmOA7KNFcl2wTR+WGDg9wA+hrp7VXIxXAkM/hoac2Vcp4z0V3kyssFB X-Received: by 2002:a17:906:fa12:: with SMTP id lo18mr2883957ejb.354.1607532226920; Wed, 09 Dec 2020 08:43:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607532226; cv=none; d=google.com; s=arc-20160816; b=eFaoaZ9mPrmtBM4r8yokqikn1PqhhLj8inkHgqyxPg+9uVQw3eZF/OYkQh8txv2p2R qIRRKN3uxFpFXG0ThXmpROvJAZINpzT9gqX4mDTMyZC+1IRN/zcHsqVemZqy3zxhV+FN TOAEwcaHE6HqN9KqMSFytSAlw2ym6blC4zDBUFpNDSXuI1/6Q6TyoiftnDeVNghJQJ6D rF0yg4tror8SF7+XFi0MneviTh3h4yL1yVWXSo1BJriWR6/RUYEvFiKCJS3YpJwBpXS+ x4QZHPo8sDBrlUJKKvbVzZoCWbGg06eQ1LhCbJl+YWyadXQvBNU/JbpuklPazQBT+T3f ShXg== 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:from:date:dkim-signature; bh=ZVwPeZe+K1uTe80npboLjwJwLum31MbCHyq8Bs1n6Us=; b=G3HRDKOxuEg0Dh3QY4GLy45ZTieqx0snDtt188A1+ViEoMwQVHD2aEhDgLmZv7OmwH ipQStBl6cCGJPOjWPTKQyAM+zMD3KSO/mwl/hiqDbzMWs3ZxYLSxr80f6z5GvWdWLzvY L9TU+kArmNNWnHjAOBYVfG9Rw0PZwReUtjMHn1SbzfkvkAe2nVo2VKg236NyDTuTN0pL gv+4Iq6n6YCiqTVmAMx1OWfG24+4TyLRSprlp8hL9mt/OJVv/Jr9MbmpqeS8ApdI46aP Vfk6dvrUxb6LXYTKrl8Es+5UHcFTezy0zWAcjVUGeMkFnBhdCbv5B9EyXWNRqqr0ZPzk IAjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=jfB75bKY; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z14si1029730ejp.692.2020.12.09.08.43.23; Wed, 09 Dec 2020 08:43:46 -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=@suse.com header.s=susede1 header.b=jfB75bKY; 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=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730529AbgLIQhz (ORCPT + 99 others); Wed, 9 Dec 2020 11:37:55 -0500 Received: from mx2.suse.de ([195.135.220.15]:56192 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729012AbgLIQhz (ORCPT ); Wed, 9 Dec 2020 11:37:55 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1607531828; h=from:from:reply-to: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=ZVwPeZe+K1uTe80npboLjwJwLum31MbCHyq8Bs1n6Us=; b=jfB75bKYTmF3ZlJNb7d+m0GZ+aC6yuqOStmEeVBxJECpJnAmliYMMiJgN7Oq9aISHb/s5P GrZwMbJK9kns2omwSJni7LhySsNeY+gY6Rm/LZ8OKrNUo1FEdTZJ4bK5rz/qlsOhsrV9Rp nOGKS9ORwey6AM1agzd8F1bpBlsA1Sg= Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 20CD4AC9A; Wed, 9 Dec 2020 16:37:08 +0000 (UTC) Date: Wed, 9 Dec 2020 17:37:07 +0100 From: Petr Mladek To: Paul Gortmaker Cc: linux-kernel@vger.kernel.org, Andi Kleen , Sergey Senozhatsky , Steven Rostedt , John Ogness Subject: Re: [PATCH 0/3] clear_warn_once: add timed interval resetting Message-ID: References: <20201126063029.2030-1-paul.gortmaker@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201126063029.2030-1-paul.gortmaker@windriver.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2020-11-26 01:30:26, Paul Gortmaker wrote: > The existing clear_warn_once functionality is currently a manually > issued state reset via the file /sys/kernel/debug/clear_warn_once when > debugfs is mounted. The idea being that a developer would be running > some tests, like LTP or similar, and want to check reproducibility > without having to reboot. > > But you currently can't make use of clear_warn_once unless you've got > debugfs enabled and mounted - which may not be desired by some people > in some deployment situations. > > The functionality added here allows for periodic resets in addition to > the one-shot reset it already had. Then we allow for a boot-time setting > of the periodic resets so it can be used even when debugfs isn't mounted. > > By having a periodic reset, we also open the door for having the various > "once" functions act as long period ratelimited messages, where a sysadmin > can pick an hour or a day reset if they are facing an issue and are > wondering "did this just happen once, or am I only being informed once?" OK, I though more about it and I NACK this patchset. My reason: 1. The primary purpose was to provide a way to reset warn_once() without debugfs. From this POV, the solution is rather complicated: timers and another kernel parameter. 2. I am not aware of any convincing argument why debugfs could not be mounted on the debugged system. 3. Debugfs provides many more debugging facilities. It is designed for this purpose. It does not look like a good strategy to provide alternative interfaces just to avoid it. 4. There were mentioned several other use cases for this feature, like RT systems. But it was not clear that it was really needed or that people would really use it. 5. Some code might even rely on that it is called only once, see commit dfbf2897d00499f94cd ("bug: set warn variable before calling WARN()") or the recent https://lore.kernel.org/r/20201029142406.3c46855a@gandalf.local.home It should better stay as debugging feature that should be used with care. 6. It creates system wide ratelimited printk(). We have printk_ratelimited() for this. And it is quite problematic. It is supposed to prevent flood of printk() messages. But it does not work well because the limits depend on more factors, like: system size, conditions, console speed. Yes, the proposed feature is supposed to solve another problem (lack of messages). But it is a global action that would re-enable >1000 messages that were limited to be printed only once because they could be too frequent. As a result: + it might cause flood of printk() messages + it is hard to define a good system wide time limit; it was even unclear what should be the lower limit. + it will restart the messages at some "random" point, so that the relation of the reported events would be unclear. From the API point of view: + printk_ratelimited() is used when we want to see that a problem is still there. It is per-message setting. + printk_once() is used when even printk_ratelimited() would be too much. It is per-message setting. + The new printk_repeated_once() is a strange mix of this two with the global setting. It does not fit much. Best Regards, Petr PS: I did not answer your last mail because it looked like an endless fight over words or point of views. I decided to make a summary of my view instead. These are reason why I nacked it. I know that there might be different views but so far no arguments changed mine. And I do not know how to explain it better.