posting the linux kernel cope about DMA bufs again because it's so fucking pathetic https://www.kernel.org/doc/html/latest/core-api/pin_user_pages.html#folio-maybe-dma-pinned-the-whole-point-of-pinning
The whole point of marking folios as “DMA-pinned” or “gup-pinned” is to be able to query, “is this folio DMA-pinned?” That allows code such as
folio_mkclean()(and file system writeback code in general) to make informed decisions about what to do when a folio cannot be unmapped due to such pins.What to do in those cases is the subject of a years-long series of discussions and debates (see the References at the end of this document). It’s a TODO item here: fill in the details once that’s worked out.
literally just the OS refusing to adjudicate between shared resources which is the entire fucking point of an "operating system"
in particular, refusing to adjudicate between precedence for transitions between control of a page by drivers vs userspace code. so this gets to the very heart of why linux and monolithic kernels in general fucking suck ass and will not survive the revolution