fstests.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: fstests <fstests@vger.kernel.org>, Xu Yu <xuyu@linux.alibaba.com>,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	riteshh@linux.ibm.com, tytso@mit.edu, gavin.dg@linux.alibaba.com,
	Christoph Hellwig <hch@infradead.org>,
	linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] generic: test swapping process pages in and out of a swapfile
Date: Thu, 19 Aug 2021 19:56:43 +0100	[thread overview]
Message-ID: <YR6paxMLClZ8WaaT@casper.infradead.org> (raw)
In-Reply-To: <20210819182646.GD12612@magnolia>

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?

  reply	other threads:[~2021-08-19 18:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 18:26 [PATCH] generic: test swapping process pages in and out of a swapfile Darrick J. Wong
2021-08-19 18:56 ` Matthew Wilcox [this message]
2021-08-19 19:18   ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YR6paxMLClZ8WaaT@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=gavin.dg@linux.alibaba.com \
    --cc=hch@infradead.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=riteshh@linux.ibm.com \
    --cc=tytso@mit.edu \
    --cc=xuyu@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).