19c4ec08ad
When using poll(), select() or kevent() on netmap file descriptors, netmap executes the equivalent of NIOCTXSYNC and NIOCRXSYNC commands, before collecting the events that are ready. In other words, the poll/kevent callback has side effects. This is done to avoid the overhead of two system call per iteration (e.g., poll() + ioctl(NIOC*XSYNC)). When the kqueue subsystem invokes the kqueue(9) f_event callback (netmap_knrw), it holds the lock of the struct knlist object associated to the netmap port (the lock is provided at initialization, by calling knlist_init_mtx). However, netmap_knrw() may need to wake up another netmap port (or even the same one), which means that it may need to call knote(). Since knote() needs the lock of the struct knlist object associated to the to-be-wake-up netmap port, it is possible to have a lock order reversal problem (AB/BA deadlock). This change prevents the deadlock by executing the knote() call in a per-selinfo taskqueue, where it is possible to hold a mutex. Reviewed by: aleksandr.fedorov_itglobal.com MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18956 |
||
---|---|---|
.. | ||
if_ptnet.c | ||
if_re_netmap.h | ||
if_vtnet_netmap.h | ||
netmap_bdg.c | ||
netmap_bdg.h | ||
netmap_freebsd.c | ||
netmap_generic.c | ||
netmap_kern.h | ||
netmap_kloop.c | ||
netmap_legacy.c | ||
netmap_mbq.c | ||
netmap_mbq.h | ||
netmap_mem2.c | ||
netmap_mem2.h | ||
netmap_monitor.c | ||
netmap_null.c | ||
netmap_offloadings.c | ||
netmap_pipe.c | ||
netmap_pt.c | ||
netmap_vale.c | ||
netmap.c |