On Thu, May 28, 2020 at 12:11:20PM +0200, Martin Pieuchot wrote:
> When it comes to kqueue filters NFS is special.  A custom thread is
> created when the first event is registered.  Its purpose is to poll
> for changes every 2.5sec.  This logic has been inherited from NetBSD
> and is not present in FreeBSD.
> 
> Since filt_nfsread() only check `n_size' of a given nfsnode having a
> different context to emulate stat(2) behavior in kernel is questionable.
> So the diff below gets rid of this logic.  The rationals are KISS,
> coherency with nfs_poll() and match what other FS kqueue filters do.
> 
> While here add a missing write filter.
> 
> Matching the nfs_poll() logic and the write filter are necessary to keep
> the current behavior of poll(2) & select(2) once they start querying
> kqfilter handlers.

I think it is not good to remove nfs_kqpoll(). The function does more
than just supports the read filter. It generates various vnode events.
If the poller is removed, it becomes impossible for example to monitor
an NFS directory with kevent(2).

It is true that the code is not perfect, but having even basic and
best-effort functionality with kevent(2) and NFS is better than nothing
in my opinion. The kqueue subsystem should not dumb down for emulating
poll(2) and select(2).

Reply via email to