tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Making global variables of if.c MPSAFE



Hi,

This is another work toward MPSAFE networking.
sys/net/if.c contains several global variables
(e.g., ifnet_list) that should be protected
from parallel accesses somehow once we get rid
of the big kernel lock.

Currently there is a mutex for serializing
accesses to index_gen, however, that's not
enough; we have to protect the other variables
too.

The global variables are read-mostly, so I
replace the mutex with a rwlock and use it
for all. Unfortunately, ifnet_list may be
accessed from interrupt context (only read
though) so that I add a spin mutex for it;
we hold the mutex when we modify ifnet_list
as well as the rwlock.

http://www.netbsd.org/~ozaki-r/ifnet-mutex.diff
https://github.com/ozaki-r/netbsd-src/tree/ifnet-mutex

Here is the patch. It doesn't remove any existing
locks and splnets yet.

Any comments and suggestions are welcome.

Thanks,
  ozaki-r


Home | Main Index | Thread Index | Old Index