Re: [PATCH] generic: test swapping process pages in and out of a swapfile

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



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?



[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux