But really, this is all fantasy given that I know nothing about the virtual memory internal data structures.
But really, this is all fantasy given that I know nothing about the virtual memory internal data structures.
Edit: fixed typo
[1] https://docs.kernel.org/core-api/xarray.html
[2] https://elixir.bootlin.com/linux/latest/source/include/linux...
[3] https://elixir.bootlin.com/linux/latest/source/mm/page-write...
[4] https://elixir.bootlin.com/linux/latest/source/mm/page-write...
There is just one caveat with regards to the previous solution: pages that are already pending writeout still need to be locked. In the previous design, a write to a page already pending writeout could be duplicated into the new dirty queue. But since it seems that a page can exist only once in the page cache, it cannot be written to without possibly violating write barriers. So the write must block until the writeout process has un-dirtied the page.
Armchair programming is fun, isn't it? :)