Re: [PATCH] generic: test swapping process pages in and out of a swapfile
From: Matthew Wilcox <willy@infradead.org>
Date: 2021-08-19 18:57:40
Also in:
linux-btrfs, linux-fsdevel, linux-mm
From: Matthew Wilcox <willy@infradead.org>
Date: 2021-08-19 18:57:40
Also in:
linux-btrfs, linux-fsdevel, linux-mm
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?