On Wed, Nov 23, 2022 at 11:06:55AM +0100, Daniel Vetter wrote:
Maybe a GFP flag to set the page reference count to zero or something like this?
Hm yeah that might work. I'm not sure what it will all break though? And we'd need to make sure that underflowing the page refcount dies in a backtrace.
Mucking with the refcount like this to protect against crazy out of tree drives seems horrible..
The WARN_ON(pag_count(p) != 1) seems like a reasonable thing to do though, though you must combine this with the special PTE flag..
Jason