Re[2]: [REVIEW/TEST] polling(4) changes
From: dima (_pppp_at_mail.ru)
Date: 10/07/05
- Previous message: Gleb Smirnoff: "Re: [REVIEW/TEST] polling(4) changes"
- In reply to: Gleb Smirnoff: "Re: [REVIEW/TEST] polling(4) changes"
- Next in thread: Luigi Rizzo: "Re: [REVIEW/TEST] polling(4) changes"
- Reply: Luigi Rizzo: "Re: [REVIEW/TEST] polling(4) changes"
- Reply: Gleb Smirnoff: "Re: [REVIEW/TEST] polling(4) changes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: Gleb Smirnoff <glebius@FreeBSD.org> Date: Fri, 07 Oct 2005 13:28:58 +0400
> 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.
Well, consider the absense of the mtx_poll lock:
- mtx_lock( &mtx_poll );
for( i = 0; i < poll_handlers; ++i ) {
+ mtx_lock( &iface_lock[i] );
pr[i].handler( pr[i].ifp, POLL_ONLY, count );
+ mtx_unlock( &iface_lock[i] );
}
- mtx_unlock( &mtx_poll );
So, several kernel threads in an SMP machine can poll different interfaces simultaneously. And mtx_lock should only be used in ether_poll_[de]register().
_______________________________________________
freebsd-arch@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
- Previous message: Gleb Smirnoff: "Re: [REVIEW/TEST] polling(4) changes"
- In reply to: Gleb Smirnoff: "Re: [REVIEW/TEST] polling(4) changes"
- Next in thread: Luigi Rizzo: "Re: [REVIEW/TEST] polling(4) changes"
- Reply: Luigi Rizzo: "Re: [REVIEW/TEST] polling(4) changes"
- Reply: Gleb Smirnoff: "Re: [REVIEW/TEST] polling(4) changes"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|