Up to [DragonFly] / src / sys / sys
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
Add xio_init_pages(), which builds an XIO based on an array of vm_page_t's.
Add a new flag, XIOF_VMLINEAR, which requires that the buffer being mapped be contiguous within a single VM object.
Get out-of-band DMA buffers working for user<->user syslinks. This allows the syslink protocol to operate in a manner very similar to the way sophisticated DMA hardware works, where you have a DMA buffer attached to a command. Augment the syslink protocol to implement read, write, and read-modify-write style commands. Obtain the MP lock in places where needed because fileops are called without it held now. Our VM ops are not MP safe yet. Use an XIO to map VM pages between userland processes. Add additional XIO functions to aid in copying data to and from a userland context. This removes an extra buffer copy from the path and allows us to manipulate pure vm_page_t's for just about everything.
I'm growing tired of having to add #include lines for header files that the include file(s) I really want depend on. Go through nearly all major system include files and add appropriately #ifndef'd #include lines to include all dependant header files. Kernel source files now only need to #include the header files they directly depend on. So, for example, if I wanted to add a SYSCTL to a kernel source file, I would only have to #include <sys/sysctl.h> to bring in the support for it, rather then four or five header files in addition to <sys/sysctl.h>.
Clean up the XIO API and structure. XIO no longer tries to 'track' partial copies into or out of an XIO. It no longer adjusts xio_offset or xio_bytes once they have been initialized. Instead, a relative offset is now passed to API calls to handle partial copies. This makes the API a lot less confusing and makes the XIO structure a lot more flexible, shareable, and more suitable for use by higher level entities (buffer cache, pipe code, upcoming MSFBUF work, etc).
Update all my personal copyrights to the Dragonfly Standard Copyright.
Add the prototype for the recently added XIO API call xio_init().
Close an interrupt race between vm_page_lookup() and (typically) a vm_page_sleep_busy() check by using the correct spl protection. An interrupt can occur inbetween the two operations and unbusy/free the page in question, causing the busy check to fail and for the code to fall through and then operate on a page that may have been freed and possibly even reused. Also note that vm_page_grab() had the same issue between the lookup, busy check, and vm_page_busy() call. Close an interrupt race when scanning a VM object's memq. Interrupts can free pages, removing them from memq, which interferes with memq scans and can cause a page unassociated with the object to be processed as if it were associated with the object. Calls to vm_page_hold() and vm_page_unhold() require spl protection. Rename the passed socket descriptor argument in sendfile() to make the code more readable. Fix several serious bugs in procfs_rwmem(). In particular, force it to block if a page is busy and then retry. Get rid of vm_pager_map_pag() and vm_pager_unmap_page(), make the functions that used to use these routines use SFBUF's instead. Get rid of the (userland?) 4MB page mapping feature in pmap_object_init_pt() for now. The code appears to not track the page directory properly and could result in a non-zero page being freed as PG_ZERO. This commit also includes updated code comments and some additional non-operational code cleanups.
This is _SYS_XIO_H, not _SYS_UIO_H. Noticed by: ibotty
Initial XIO implementation. XIOs represent data through a list of VM pages rather then mapped KVM, allowing them to be passed between threads without having to worry about KVM mapping overheads, TLB invalidation, and so forth. This initial implementation supports creating XIOs from user or kernel data and copying from an XIO to a user or kernel buffer or a uio. XIO are intended to be used with CAPS, PIPES, VFS, DEV, and other I/O paths. The XIO concept is an outgrowth of Alan Cox'es unique use of target-side SF_BUF mapping to improve pipe performance.