Page MenuHomeFreeBSD

Add kqueue support for ZFS.
AbandonedPublic

Authored by pfg on Sep 13 2019, 5:22 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 4:27 AM
Unknown Object (File)
Dec 30 2022, 11:03 PM
Unknown Object (File)
Dec 25 2022, 10:32 PM
Unknown Object (File)
Dec 13 2022, 8:29 AM
Subscribers

Details

Reviewers
mav
kib
jmg
asomers
Group Reviewers
ZFS
Summary

UFS and ext2fs both support kqueue(2) events for vnodes, NetBSD recently added
support for kqueue[1], which seems that is missing from FreeBSD.

Looking at UFS, it seems like the attached patch should do the trick, but I
am no expert on this.

[1]
https://github.com/NetBSD/src/commit/aabc405a6a5bfdd07c072fb9a58985ad177229f1

Test Plan

Good question.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 26466
Build 24890: arc lint + arc unit

Event Timeline

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
5319

I am not familiar with this KPI, but this looks like a typo ('p' instead of 'q').

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
5319

Yes it is ... now I wonder how trhis compiled!

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
5319

More interesting question is what is the case that did not worked before your patch but works after.

I highly suspect that these filters in UFS are just dead code. I suggest you to take a look at fifospecops.vop_kqfilter. If actually reachable, this is a panic.

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
5319

fifofs is rather particular in that most fifo_specops operations are invalid:

struct vop_vector fifo_specops = {
	.vop_default =		&default_vnodeops,

	.vop_advlock =		fifo_advlock,
	.vop_close =		fifo_close,
	.vop_create =		VOP_PANIC,
	.vop_getattr =		VOP_EBADF,
	.vop_ioctl =		VOP_PANIC,
	.vop_kqfilter =		VOP_PANIC,
	.vop_link =		VOP_PANIC,
	.vop_mkdir =		VOP_PANIC,
	.vop_mknod =		VOP_PANIC,
	.vop_open =		fifo_open,
	.vop_pathconf =		VOP_PANIC,
	.vop_print =		fifo_print,
	.vop_read =		VOP_PANIC,
	.vop_readdir =		VOP_PANIC,
	.vop_readlink =		VOP_PANIC,
	.vop_reallocblks =	VOP_PANIC,
	.vop_reclaim =		VOP_NULL,
	.vop_remove =		VOP_PANIC,
	.vop_rename =		VOP_PANIC,
	.vop_rmdir =		VOP_PANIC,
	.vop_setattr =		VOP_EBADF,
	.vop_symlink =		VOP_PANIC,
	.vop_write =		VOP_PANIC,
};

I am starting to concur that this call may be obsoleted.
Let me add the kqueue maintainer and the fuse maintainer (Alan added kqueue support to fuse) as they may shed some more light on this

My experience is not directly applicable. All I did was add kqueue support for /dev/fuse, not for files stored on fusefs, and I was only concerned with EVFILT_(READ|WRITE), not EVFILT_VNODE. I would suggest that before you continue working on this patch, you write a test case.

Can we close this review now?

Can we close this review now?

Yeah .. sorry for keeping this open for so long.