DMA and get_user_pages()
DMA and get_user_pages()
Posted Dec 20, 2018 3:00 UTC (Thu) by nybble41 (subscriber, #55106)In reply to: DMA and get_user_pages() by jan.kara
Parent article: DMA and get_user_pages()
Understood, but filesystems *already* have to support keeping blocks allocated since open files can be unlinked. The same goes for the admin's view of free space. Why not use the same mechanism for blocks which are currently being DMA'd? The tooling issue could be addressed by providing a way for filesystems to report the number of pinned blocks waiting to be freed.
I'm pretty sure that the on-disk format change, at least, isn't necessary. The filesystem can just mark the blocks as free on disk while keeping a separate record in RAM of nominally "free" blocks which shouldn't be reused quite yet. That also takes care of ensuring that the blocks don't leak without requiring any recovery code to run when the filesystem is mounted.
