Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759597AbcLPIpM (ORCPT ); Fri, 16 Dec 2016 03:45:12 -0500 Received: from mx2.suse.de ([195.135.220.15]:59972 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756882AbcLPIpA (ORCPT ); Fri, 16 Dec 2016 03:45:00 -0500 Date: Fri, 16 Dec 2016 09:44:55 +0100 From: "Luis R. Rodriguez" To: Petr Mladek Cc: "Luis R. Rodriguez" , shuah@kernel.org, jeyu@redhat.com, rusty@rustcorp.com.au, ebiederm@xmission.com, dmitry.torokhov@gmail.com, acme@redhat.com, corbet@lwn.net, martin.wilck@suse.com, mmarek@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, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC 07/10] kmod: use simplified rate limit printk Message-ID: <20161216084455.GH13946@wotan.suse.de> References: <20161208184801.1689-1-mcgrof@kernel.org> <20161208194901.2672-1-mcgrof@kernel.org> <20161214162350.GJ16064@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161214162350.GJ16064@pathway.suse.cz> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1724 Lines: 52 On Wed, Dec 14, 2016 at 05:23:50PM +0100, Petr Mladek wrote: > On Thu 2016-12-08 11:49:01, 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. > > > > 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 09cf35a2075a..ef65f4c3578a 100644 > > --- a/kernel/kmod.c > > +++ b/kernel/kmod.c > > @@ -158,7 +158,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 > > @@ -183,13 +182,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("request_module: modprobe limit (%u) reached with module %s\n", > > + max_modprobes, module_name); > > I like this change. I would only be even more descriptive in which > limit is reached. Something like > > pr_err_ratelimited("request_module: module \"%s\" reached limit (%u) of concurrent modprobe calls\n", > module_name, max_modprobes); Sure, changed. > Either way, feel free to add: > > Reviewed-by: Petr Mladek Thanks! Luis