So, I was wondering: how can I implement copying of memory pages ( struct page) inside the kernel and instead use the copy-on-write mechanism to immediately transfer data.
I am currently copying pages, converting user addresses to pages, highlighting the required number of pages with help allocate_pagesfrom the kernel, copying them with copy_pages, and then finally matching them to the desired area using install_special_mapping. This works, but I feel it can be optimized using a copy-to-write mechanism.
source
share