Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756106AbcLNQlp (ORCPT ); Wed, 14 Dec 2016 11:41:45 -0500 Received: from smtprelay0203.hostedemail.com ([216.40.44.203]:34163 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756078AbcLNQln (ORCPT ); Wed, 14 Dec 2016 11:41:43 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: X-HE-Tag: skirt55_64c0c30b4584d X-Filterd-Recvd-Size: 2807 Message-ID: <1481733690.29291.56.camel@perches.com> Subject: Re: [RFC 07/10] kmod: use simplified rate limit printk From: Joe Perches To: Petr Mladek , "Luis R. Rodriguez" Cc: 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 Date: Wed, 14 Dec 2016 08:41:30 -0800 In-Reply-To: <20161214162350.GJ16064@pathway.suse.cz> References: <20161208184801.1689-1-mcgrof@kernel.org> <20161208194901.2672-1-mcgrof@kernel.org> <20161214162350.GJ16064@pathway.suse.cz> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.1-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1256 Lines: 36 On Wed, 2016-12-14 at 17:23 +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. [] > > diff --git a/kernel/kmod.c b/kernel/kmod.c [] > > @@ -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); > > Either way, feel free to add: > > Reviewed-by: Petr Mladek Seems sensible. I suggest using "%s: ", __func__ instead of embedding the function name.