[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201006011051.25636.rusty@rustcorp.com.au>
Date: Tue, 1 Jun 2010 10:51:24 +0930
From: Rusty Russell <rusty@...tcorp.com.au>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Brandon Philips <brandon@...p.org>,
"Rafael J. Wysocki" <rjw@...k.pl>,
LKML <linux-kernel@...r.kernel.org>,
Jon Masters <jonathan@...masters.org>,
Tejun Heo <htejun@...il.com>,
Masami Hiramatsu <mhiramat@...hat.com>,
Kay Sievers <kay.sievers@...y.org>
Subject: Re: [PATCH 2/2] module: fix bne2 "gave up waiting for init of module libcrc32c"
On Tue, 1 Jun 2010 03:49:14 am Linus Torvalds wrote:
> because the module locking is pure and utter crap. It uses one hug lock
> that it tries to hold for a long time, rather than protecting just the
> parts it needs.
Originally it was a big lock around module loading. That was simple, and
simple is good.
Sure, that simplicity has been eroded, but "crap" is harsh.
> Rusty's fix is to just drop the lock around use_module(), and it seems to
> work. It's may be right for 'use_module()', but totally wrong from a
> conceptual locking standpoint, though - dropping the lock in the middle of
> module loading may well "work", but who the hell knows what it really
> results in?
I do. If I didn't think so, I wouldn't have pushed the patch.
> IOW, it's one of those "this works, but it's very wrong" things. It makes
> the whole module_mutex pretty much a random thing with even less semantics
> than it has now. Right now it has some clear area that it protects - the
> area may be too _big_, but at least it makes some amount of sense.
See, this I agree with, but you could have said this in far fewer words and
much more politely.
As posted, I had a patch to clean up the locking. Seems you ignored it.
> It's entirely possible that an interim fix (if we can't just fix the
> locking) is to _not_ use "strong_try_module_get()" at all, but instead
> just use "try_module_get()", and then after we've dropped the
> module_mutex, but _before_ we call the "init" function for the module, we
> wait for all the modules that this module depends on.
No, those modules could still fail init.
> Doesn't that sound like the logical thing to do? And it wouldn't change
> any locking.
No, it sounds wrong, complex and fundamentally broken.
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists