On 04/21/2014 03:29 PM, Linus Torvalds wrote: > Actually moving the dirty bit information into the batching is > somewhat painful, because free_pages_and_swap_cache() really wants an > array of 'struct page *', rather than some array of "page and dirty > info". And that in turn is mainly because it then passes it down to > release_pages(), rather than anything else. But it looks doable. I came up with something pretty similar to what you've got. I used some local variables for the dirty state rather than using the pte, but otherwise looks pretty similar. It actually boots, runs, and superficially looks to be doing the right thing. I fixed free_pages_and_swap_cache() but just making a first pass through the array and clearing the bits. We probably need to make sure none of the other architectures have funky uses calling tlb_remove_page() where they would need something other than dirty=0.