lkml.org 
[lkml]   [2010]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 2/2] module: fix bne2 "gave up waiting for init of module libcrc32c"
Date
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.


\
 
 \ /
  Last update: 2010-06-01 03:23    [from the cache]
©2003-2011 Jasper Spaans