Johannes Schmid wrote:
For my application, I would like to clear all the page table dirty flags at some point, and later on check which pages have been marked dirty by the CPU. Even before this, I could make sure that all the corresponding PG_dirty flags are set, to prevent loss of data. But if the kernel would possibly clear some PG_dirty flags later on, because the pages are not pte_dirty (anymore), that would be harmful.
The kernel will only clear the PG_dirty flag if the data in the page was written to disk, or if the process truncated the file or munmapped the anonymous memory (which also frees the pages in question). Having the pte_dirty bit cleared is no reason for clearing PG_dirty. Quite the contrary, there are a few functions in the kernel that set PG_dirty because the pte_dirty bits are being cleared. One example of such code is in mm/rmap.c -- Politics is the struggle between those who want to make their country the best in the world, and those who believe it already is. Each group calls the other unpatriotic. -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ