Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1538884
| From | "Luis R. Rodriguez" <mcgrof@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC 03/10] kmod: add dynamic max concurrent thread count |
| Date | 2016-12-08 22:10 +0100 |
| Message-ID | <sMe70-2Kc-21@gated-at.bofh.it> (permalink) |
| References | <sMbVv-188-1@gated-at.bofh.it> <sMcRA-1I2-19@gated-at.bofh.it> <sMdui-2eY-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thu, Dec 08, 2016 at 12:28:07PM -0800, Kees Cook wrote: > On Thu, Dec 8, 2016 at 11:48 AM, Luis R. Rodriguez <mcgrof@kernel.org> wrote: > > diff --git a/kernel/kmod.c b/kernel/kmod.c > > index 0277d1216f80..cb6f7ca7b8a5 100644 > > --- a/kernel/kmod.c > > +++ b/kernel/kmod.c > > @@ -44,6 +44,9 @@ > > @@ -186,6 +174,31 @@ int __request_module(bool wait, const char *fmt, ...) > > return ret; > > } > > EXPORT_SYMBOL(__request_module); > > + > > +/* > > + * If modprobe needs a service that is in a module, we get a recursive > > + * loop. Limit the number of running kmod threads to max_threads/2 or > > + * CONFIG_MAX_KMOD_CONCURRENT, whichever is the smaller. A cleaner method > > + * would be to run the parents of this process, counting how many times > > + * kmod was invoked. That would mean accessing the internals of the > > + * process tables to get the command line, proc_pid_cmdline is static > > + * and it is not worth changing the proc code just to handle this case. > > + * > > + * "trace the ppid" is simple, but will fail if someone's > > + * parent exits. I think this is as good as it gets. > > + * > > + * You can override with with a kernel parameter, for instance to allow > > + * 4096 concurrent modprobe instances: > > + * > > + * kmod.max_modprobes=4096 > > + */ > > +void __init init_kmod_umh(void) > > What does umh mean? umh is user mode helper. kmod.c actually implements the kernel's umh code. A subsequent series I will want to move all that to umh.c and keep module loading separate in kmod.c But that's for later as a cleanup. BTW any chance I can have you trim replies to file name and hunk for changes you reply to ? As an example I did that here :) Luis
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC 00/10] kmod: stress test driver, few fixes and enhancements "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-08 19:50 +0100
[RFC 02/10] module: fix memory leak on early load_module() failures "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-08 20:50 +0100
Re: [RFC 02/10] module: fix memory leak on early load_module() failures Kees Cook <keescook@chromium.org> - 2016-12-08 21:40 +0100
Re: [RFC 02/10] module: fix memory leak on early load_module() failures "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-08 22:20 +0100
Re: [RFC 02/10] module: fix memory leak on early load_module() failures Kees Cook <keescook@chromium.org> - 2016-12-08 22:20 +0100
Re: [RFC 02/10] module: fix memory leak on early load_module() failures Miroslav Benes <mbenes@suse.cz> - 2016-12-09 18:10 +0100
[RFC 08/10] sysctl: add support for unsigned int properly "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-08 20:50 +0100
[RFC 05/10] kmod: return -EBUSY if modprobe limit is reached "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-08 20:50 +0100
[RFC 07/10] kmod: use simplified rate limit printk "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-08 20:50 +0100
[RFC 04/10] kmod: provide wrappers for kmod_concurrent inc/dec "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-08 20:50 +0100
Re: [RFC 04/10] kmod: provide wrappers for kmod_concurrent inc/dec Kees Cook <keescook@chromium.org> - 2016-12-08 21:40 +0100
Re: [RFC 04/10] kmod: provide wrappers for kmod_concurrent inc/dec "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-08 22:10 +0100
[RFC 06/10] kmod: provide sanity check on kmod_concurrent access "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-08 20:50 +0100
[RFC 10/10] kmod: add a sanity check on module loading "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-08 20:50 +0100
Re: [RFC 10/10] kmod: add a sanity check on module loading Martin Wilck <mwilck@suse.com> - 2016-12-09 21:10 +0100
Re: [RFC 10/10] kmod: add a sanity check on module loading Linus Torvalds <torvalds@linux-foundation.org> - 2016-12-09 22:00 +0100
[RFC 03/10] kmod: add dynamic max concurrent thread count "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-08 20:50 +0100
Re: [RFC 03/10] kmod: add dynamic max concurrent thread count Kees Cook <keescook@chromium.org> - 2016-12-08 21:30 +0100
Re: [RFC 03/10] kmod: add dynamic max concurrent thread count "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-08 22:10 +0100
[RFC 09/10] kmod: add helpers for getting kmod count and limit "Luis R. Rodriguez" <mcgrof@kernel.org> - 2016-12-08 20:50 +0100
csiph-web