CVSROOT: /cvs Module name: src Changes by: bl...@cvs.openbsd.org 2024/01/06 03:58:45
Modified files: sys/net : if.c sys/netinet : in.c Log message: Take net lock before kernel lock. Doing KERNEL_LOCK() just before NET_LOCK() does not make sense. Net lock is a rwlock that releases kernel lock during sleep. To avoid an unnecessary release and take kernel lock cycle, move KERNEL_LOCK() after NET_LOCK(). There is no lock order reversal deadlock issue. Both locks are used in any order thoughout the kernel. As NET_LOCK() releases the kernel lock when it cannot take the lock immediately and has to sleep, we always end in the order kernel lock before net lock after sleeping. OK sashan@