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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,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 ECAD8C4338F for ; Thu, 19 Aug 2021 18:57:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8F995610A3 for ; Thu, 19 Aug 2021 18:57:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8F995610A3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id DF03B6B006C; Thu, 19 Aug 2021 14:57:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DA0E36B0071; Thu, 19 Aug 2021 14:57:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB5FF6B0072; Thu, 19 Aug 2021 14:57:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0047.hostedemail.com [216.40.44.47]) by kanga.kvack.org (Postfix) with ESMTP id B01DD6B006C for ; Thu, 19 Aug 2021 14:57:48 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5790922AD2 for ; Thu, 19 Aug 2021 18:57:48 +0000 (UTC) X-FDA: 78492739416.11.1E0A6AC Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf06.hostedemail.com (Postfix) with ESMTP id D886D801A8B2 for ; Thu, 19 Aug 2021 18:57:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5eC8zn0nvpnMn9/nAEV/c108WS/2ZWs8TKMFCYynaRY=; b=H8XCrnz86KwsvRN6bgl+cdcl3s EFeLyzfjvMeDUaOZ/N/24FpuMiBg7gWZ1hsJTqN0gmDFRy8R2Tm9U+0W40nEQMqZogRWfN4HUXLaF P5qVH2GU4FgwcXxmiacEhz/gmoQxRr4o7X8K/nn4ZX2S9z27N/c2b2Oc5wVZHtR9NXkW/nee4FiW+ SPMjwOlZj4ueHzqqiqbTz1skZy4RoOmenMAHEuYnLWVzivkfHuNP8OCa8pCQqY7gnqu1LVr2r++n3 S37tMnBanxQ8eGa+1B4oeBY6ReHuSMsdY0VfDiCqVhdPn+7yWnm4Ggujr4VLXBSYrstssQVkxYbRJ hAXI+p0Q==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mGnDX-005Scq-6c; Thu, 19 Aug 2021 18:56:51 +0000 Date: Thu, 19 Aug 2021 19:56:43 +0100 From: Matthew Wilcox To: "Darrick J. Wong" 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: References: <20210819182646.GD12612@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210819182646.GD12612@magnolia> Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=H8XCrnz8; dmarc=none; spf=none (imf06.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Stat-Signature: j8555ykfxptwpntdii8u6o7eb64sx4sb X-Rspamd-Queue-Id: D886D801A8B2 X-Rspamd-Server: rspam05 X-HE-Tag: 1629399467-662285 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 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?