On Thu, Aug 19, 2021 at 07:56:43PM +0100, Matthew Wilcox wrote: > On Thu, Aug 19, 2021 at 11:26:46AM -0700, Darrick J. Wong wrote: > > + printf("Dirtying memory.\n"); > > + fflush(stdout); > > + > > + /* Dirty the memory to force this program to be swapped out. */ > > + for (p = pstart; p < pend; p += pagesize) > > + *p = 'X'; > > What I liked about dhowells' program was that it checked whether the > pages brought back in from swap were the same ones that had been written > to swap. As a block filesystem person, you only know the misery of having > swap go behind your back to the block device. As a network filesystem > person, David is acutely aware of the misery of having to remember to > use page_file_index() instead of page->index in order to avoid reading > a page from the wrong offset in the swap partition. > > Yes, our swap code is nasty in many different ways, why do you ask? Wheeee, I'll go change it to store per-page data in each page and check it on the way back. --D