[Top] [All Lists]

Re: modular net drivers, take 2

To: Andrew Morton <andrewm@xxxxxxxxxx>
Subject: Re: modular net drivers, take 2
From: Keith Owens <kaos@xxxxxxxxxx>
Date: Wed, 21 Jun 2000 13:44:00 +1000
Cc: "netdev@xxxxxxxxxxx" <netdev@xxxxxxxxxxx>
In-reply-to: Your message of "Wed, 21 Jun 2000 02:37:58 GMT." <>
Sender: owner-netdev@xxxxxxxxxxx
On Wed, 21 Jun 2000 02:37:58 +0000, 
Andrew Morton <andrewm@xxxxxxxxxx> wrote:
>Module unload is a very rare occurence, so let's penalise that and that
>We grab the ENTIRE machine within sys_delete_module. 
>Like, grab the big kernel lock, then wait until ALL other CPUs are
>spinning on the kernel lock, and then allow sys_delete_module to

       CPU 0                              CPU 1
use_count == 0, OK to remove
Grab big kernel lock.
Wait for other cpus to spin.
                                  Enter open().
sys_delete_module runs.
module_exit() sleeps, drops lock.
                                  open() continues, enters module.
                                  sleep in module open code, drop lock.
module_exit() wakes and continues.
Code is removed.
                                  module open code wakes and continues.

Anything sleeping loses the lock.  Any sleep in module open code primes
the race, if the module_exit code also sleeps the race is triggered.

<Prev in Thread] Current Thread [Next in Thread>