Re: kmod: provide wrappers for kmod_concurrent inc/dec

From: Luis R. Rodriguez
Date: Tue Jan 10 2017 - 15:32:00 EST


On Wed, Dec 21, 2016 at 09:07:21PM -0800, Jessica Yu wrote:
> +++ Luis R. Rodriguez [08/12/16 11:48 -0800]:
> > diff --git a/kernel/kmod.c b/kernel/kmod.c
> > index cb6f7ca7b8a5..049d7eabda38 100644
> > --- a/kernel/kmod.c
> > +++ b/kernel/kmod.c
> > @@ -108,6 +111,20 @@ static int call_modprobe(char *module_name, int wait)
> > return -ENOMEM;
> > }
> >
> > +static int kmod_umh_threads_get(void)
> > +{
> > + atomic_inc(&kmod_concurrent);
> > + if (atomic_read(&kmod_concurrent) < max_modprobes)
>
> Should this not be <=? I think this only allows up to max_modprobes-1 concurrent threads.

True, fixed!

Luis