From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756806AbdESWXe (ORCPT ); Fri, 19 May 2017 18:23:34 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:33186 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756707AbdESWXb (ORCPT ); Fri, 19 May 2017 18:23:31 -0400 Date: Fri, 19 May 2017 15:23:27 -0700 From: Dmitry Torokhov To: "Luis R. Rodriguez" Cc: shuah@kernel.org, jeyu@redhat.com, rusty@rustcorp.com.au, ebiederm@xmission.com, acme@redhat.com, corbet@lwn.net, martin.wilck@suse.com, mmarek@suse.com, pmladek@suse.com, hare@suse.com, rwright@hpe.com, jeffm@suse.com, DSterba@suse.com, fdmanana@suse.com, neilb@suse.com, linux@roeck-us.net, rgoldwyn@suse.com, subashab@codeaurora.org, xypron.glpk@gmx.de, keescook@chromium.org, atomlin@redhat.com, mbenes@suse.cz, paulmck@linux.vnet.ibm.com, dan.j.williams@intel.com, jpoimboe@redhat.com, davem@davemloft.net, mingo@redhat.com, akpm@linux-foundation.org, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/6] kmod: use simplified rate limit printk Message-ID: <20170519222327.GH19281@dtor-ws> References: <20170519032444.18416-1-mcgrof@kernel.org> <20170519032444.18416-7-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170519032444.18416-7-mcgrof@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 18, 2017 at 08:24:44PM -0700, Luis R. Rodriguez wrote: > Just use the simplified rate limit printk when the max modprobe > limit is reached, while at it throw out a bone should the error > be triggered. > > Reviewed-by: Petr Mladek > Signed-off-by: Luis R. Rodriguez > --- > kernel/kmod.c | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/kernel/kmod.c b/kernel/kmod.c > index 7ea11dbc7564..56cd2a16e7ac 100644 > --- a/kernel/kmod.c > +++ b/kernel/kmod.c > @@ -166,7 +166,6 @@ int __request_module(bool wait, const char *fmt, ...) > va_list args; > char module_name[MODULE_NAME_LEN]; > int ret; > - static int kmod_loop_msg; > > /* > * We don't allow synchronous module loading from async. Module > @@ -191,13 +190,8 @@ int __request_module(bool wait, const char *fmt, ...) > > ret = kmod_umh_threads_get(); > if (ret) { > - /* We may be blaming an innocent here, but unlikely */ > - if (kmod_loop_msg < 5) { > - printk(KERN_ERR > - "request_module: runaway loop modprobe %s\n", > - module_name); > - kmod_loop_msg++; > - } > + pr_err_ratelimited("%s: module \"%s\" reached limit (%u) of concurrent modprobe calls\n", > + __func__, module_name, max_modprobes); This is completely different behavior, isn't it? Instead of reporting first 5 occurrences we now reporting every once in a while. Why is this new behavior better? -- Dmitry