linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Matthew Wilcox <willy@infradead.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 12:18:59 -0700	[thread overview]
Message-ID: <20210819191859.GH12664@magnolia> (raw)
In-Reply-To: <YR6paxMLClZ8WaaT@casper.infradead.org>

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

      reply	other threads:[~2021-08-19 19:19 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
2021-08-19 19:18   ` Darrick J. Wong [this message]

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=20210819191859.GH12664@magnolia \
    --to=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=willy@infradead.org \
    --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).