[REVIEW/TEST] polling(4) changes

Gleb Smirnoff glebius at FreeBSD.org
Thu Oct 6 11:34:17 PDT 2005


On Thu, Oct 06, 2005 at 08:17:17PM +0400, dima wrote:
d> Seems to be a first considerable step regarding the ideas discussed in March :)
d> But, my idea about the separate locking of each interface dissappeared from this implementation. mtx_poll is good to protect the pollrec array and other sensitive variables. But we could get advantage of SMP machines writing polling loops like this:
d> 
d> for( i = 0; i < poll_handlers; ++i ) {
d>   mtx_lock( &iface_lock[i] );
d>   pr[i].handler(pr[i].ifp, POLL_ONLY, count);
d>   mtx_unlock( &iface_lock[i] );
d> }

What is the benefit here? The driver must have its own lock.

-- 
Totus tuus, Glebius.
GLEBIUS-RIPN GLEB-RIPE


More information about the freebsd-arch mailing list