From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751618AbdF1WLY (ORCPT ); Wed, 28 Jun 2017 18:11:24 -0400 Received: from mx2.suse.de ([195.135.220.15]:50210 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751518AbdF1WLR (ORCPT ); Wed, 28 Jun 2017 18:11:17 -0400 Date: Thu, 29 Jun 2017 00:11:13 +0200 From: "Luis R. Rodriguez" To: Petr Mladek Cc: "Luis R. Rodriguez" , akpm@linux-foundation.org, jeyu@redhat.com, shuah@kernel.org, rusty@rustcorp.com.au, ebiederm@xmission.com, dmitry.torokhov@gmail.com, acme@redhat.com, corbet@lwn.net, josh@joshtriplett.org, 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, alan@linux.intel.com, tytso@mit.edu, gregkh@linuxfoundation.org, torvalds@linux-foundation.org, linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 4/4] kmod: throttle kmod thread limit Message-ID: <20170628221113.GJ21846@wotan.suse.de> References: <20170526211228.27764-5-mcgrof@kernel.org> <20170623192011.2412-1-mcgrof@kernel.org> <20170626113831.GJ1538@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170626113831.GJ1538@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 On Mon, Jun 26, 2017 at 01:38:31PM +0200, Petr Mladek wrote: > On Fri 2017-06-23 12:20:11, Luis R. Rodriguez wrote: > > If we reach the limit of modprobe_limit threads running the next > > request_module() call will fail. The original reason for adding > > a kill was to do away with possible issues with in old circumstances > > which would create a recursive series of request_module() calls. > > > > We can do better than just be super aggressive and reject calls > > once we've reached the limit by simply making pending callers wait > > until the threshold has been reduced, and then throttling them in, > > one by one. > > > > This throttling enables requests over the kmod concurrent limit to > > be processed once a pending request completes. Only the first item > > queued up to wait is woken up. The assumption here is once a task > > is woken it will have no other option to also kick the queue to check > > if there are more pending tasks -- regardless of whether or not it > > was successful. > > > > By throttling and processing only max kmod concurrent tasks we ensure > > we avoid unexpected fatal request_module() calls, and we keep memory > > consumption on module loading to a minimum. > > > > With x86_64 qemu, with 4 cores, 4 GiB of RAM it takes the following run > > time to run both tests: > > > > time ./kmod.sh -t 0008 > > real 0m16.523s > > user 0m0.879s > > sys 0m8.977s > > > > time ./kmod.sh -t 0009 > > real 0m56.080s > > user 0m0.717s > > sys 0m10.324s > > > > Signed-off-by: Luis R. Rodriguez > > All the changes look fine to me. They make perfect sense. Thanks, I'll peg a Reviewed-by: Petr Mladek Luis