freebsd-skq/sys/fs/cuse
hselasky 2873c08d55 Allow CUSE(3) to free all memory mapped memory by using regular SWAP objects
instead of malloc(). The SWAP objects are automagically freed when there are no
more consumers. This greatly simplifies the mmap logic inside CUSE(3) in the
kernel. This change fixes an issue where mmapped memory can accumulate and never
get freed, if many different mmap sizes are needed over time. Further this
change fixes memory leaks when the CUSE(3) kernel module is unloaded.

While at it make sure the CUSE_ALLOC_PAGES_MAX limit is treated as an exclusive
limit. CUSE(3) memory maps must be less than CUSE_ALLOC_PAGES_MAX number of pages.

Reviewed by:		kib @
Differential Revision:	https://reviews.freebsd.org/D11392
Sponsored by:		Mellanox Technologies
MFC after:		1 week
2017-11-03 14:10:57 +00:00
..
cuse_defs.h Add support for new cuse(3) error code, CUSE_ERR_NO_DEVICE. 2017-10-05 16:42:02 +00:00
cuse_ioctl.h Allow CUSE(3) to free all memory mapped memory by using regular SWAP objects 2017-11-03 14:10:57 +00:00
cuse.c Allow CUSE(3) to free all memory mapped memory by using regular SWAP objects 2017-11-03 14:10:57 +00:00