Re: Modules loading modules?

2010-08-03 Thread haad
On Tue, Aug 3, 2010 at 3:03 PM, Paul Goyette p...@whooppee.com wrote:
 On Mon, 2 Aug 2010, Paul Goyette wrote:

 On Tue, 3 Aug 2010, matthew green wrote:

 i think this looks good enough.  wait for some others eyes, though.

 No hurry.  I'm going to try to add a new atf test case for the recursive
 load case, and it will take some time for me to come up to speed on the atf
 stuff. :)

 Well, still no hurry, but it would be nice if some additional eyes were
 pointed this way.  I've got the recursive-module-load test case added to the
 existing tests/modules/ stuff (and it works)!

 BTW, since this is changing the kernel ABI, I guess it will need a version
 bump.  Do we have any other bumps coming soon that we can share?

I talked with Andrew today and he said that basicaly we can use
mutex_owned for this particular case. That should make your code much
simpler :) sorry for any additional work :)



-- 


Regards.

Adam


Re: Modules loading modules?

2010-08-03 Thread Paul Goyette

On Tue, 3 Aug 2010, haad wrote:

Well, still no hurry, but it would be nice if some additional eyes were 
pointed this way.  I've got the recursive-module-load test case added

to the existing tests/modules/ stuff (and it works)!

BTW, since this is changing the kernel ABI, I guess it will need a 
version bump.  Do we have any other bumps coming soon that we can 
share?


I talked with Andrew today and he said that basicaly we can use
mutex_owned for this particular case. That should make your code much
simpler :) sorry for any additional work :)


Well, we've come full circle!  :)

It seems to me that, even if it is OK to use mutex_owned() for this 
particular case, perhaps we should not.  Most everyone seemed to agree 
that your condvar solution was technically correct, and if we did use 
the mutex_owned() solution it would only serve as a temptation for 
someone else in the future!


We now have two solutions, both of which actually work (tested on my 
home machine).  One solution (mutex_owned) might be slightly simpler and 
slightly more efficient than the other (condvar), but this section of 
code is certainly not performance-critical.  Therefore, is there any 
reason for preferring the mutex_owned solution?


I'm happy to go either way based on concensus here, but I'm leaning 
towards the condvar solution.  It doesn't require any exemptions or 
long explanations of why it is OK to use mutex_owned in ways that 
would appear to violate our own documentation.  And it also addresses 
eeh's (and mrg's) concerns of keeping the lock across potentially 
long-duration  operations.



-
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com|
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |  | pgoyette at netbsd.org  |
-