From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 245F8C4338F for ; Thu, 19 Aug 2021 19:19:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B4252610CE for ; Thu, 19 Aug 2021 19:19:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B4252610CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id E9B63900002; Thu, 19 Aug 2021 15:19:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E4C3C6B0071; Thu, 19 Aug 2021 15:19:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D3AF1900002; Thu, 19 Aug 2021 15:19:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B8FE06B006C for ; Thu, 19 Aug 2021 15:19:01 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 6C8C5181CC1B2 for ; Thu, 19 Aug 2021 19:19:01 +0000 (UTC) X-FDA: 78492792882.09.47C3976 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf22.hostedemail.com (Postfix) with ESMTP id 18A7B1905 for ; Thu, 19 Aug 2021 19:19:00 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 29A2960C3E; Thu, 19 Aug 2021 19:19:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629400740; bh=G4Xi5HqBpDKXc3j8L3BAi3I6X+w5fRA9RfqQJZDwZ6U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DKYaiP2jBBnH1RR4rjXN3jRVSy+5vnbbXYywiyLOVOSuO/3MALXCdglgMHTTW9C9M Zowih9jRJ3Rdazk+4MwPK5ZalhjHgGEq3ZPEBcA/HqNp7F24aiXaB3RkHLHhLSqHkB pUZKYDzUliRwhFDFuquYq/G6nKqqlyN84l1aYSzZhHwJgCQ5fkhUGrt4S9gGIUy9Js LGzTCT1Qgogk+r46ksP0B5WBNDw09Up0gw04WoH8Z7+1tUAEKhhWvjO47gTELGwkc/ ZiosKehlu/dlXBeFVd/kZZC0n2VjE8e/4IxH10S5dr5eU56GAyCLXT77tLZkYcJ1GJ 1oWNQF3cDsdCw== Date: Thu, 19 Aug 2021 12:18:59 -0700 From: "Darrick J. Wong" To: Matthew Wilcox Cc: fstests , Xu Yu , linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, riteshh@linux.ibm.com, tytso@mit.edu, gavin.dg@linux.alibaba.com, Christoph Hellwig , linux-btrfs Subject: Re: [PATCH] generic: test swapping process pages in and out of a swapfile Message-ID: <20210819191859.GH12664@magnolia> References: <20210819182646.GD12612@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=DKYaiP2j; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf22.hostedemail.com: domain of djwong@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=djwong@kernel.org X-Stat-Signature: 4ok3499gnznenwjwekx7rit1kpdkybxq X-Rspamd-Queue-Id: 18A7B1905 X-Rspamd-Server: rspam01 X-HE-Tag: 1629400740-883394 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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