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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E493C27C77 for ; Mon, 17 Jun 2024 08:03:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2B8C96B0153; Mon, 17 Jun 2024 04:03:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 26B4A6B0155; Mon, 17 Jun 2024 04:03:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 132F66B0156; Mon, 17 Jun 2024 04:03:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id EB45B6B0153 for ; Mon, 17 Jun 2024 04:03:24 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 6389741438 for ; Mon, 17 Jun 2024 08:03:24 +0000 (UTC) X-FDA: 82239640728.23.7087DB2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf30.hostedemail.com (Postfix) with ESMTP id 67D8280012 for ; Mon, 17 Jun 2024 08:03:22 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718611399; a=rsa-sha256; cv=none; b=U61dRGPGJzvn7wrUOIFONwW5BmtPmVrXJPHVYztyNRJYb+7E2+b35uMTB02J4P6zEe9+tP pqBKccaxd3jUMP9AXW8ANHZk6ggqw7fWWpyFBto9MYNL6L1D+PR4qR9eGBBpD7MaTFwK5X p6P7In1x4VTv+suBwbqGriyvTa6wMd8= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; spf=pass (imf30.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718611399; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YU3HhbQ3C+sh88M0HbHNX6ehaiMtmHW7x1IJ6G6dSxI=; b=fl5WV/CHTjU18LVt2gzP+SZw1Br54bsTVFX3QO9XbFAjFw+Q2GiaCKfIoCK2KfDpOW0kZ8 dug/8FkpKPq93LPluGovRLCU3ZFYVbw3guh2Y7fi9ow6J/OV/rr7gHhQxrn5Y8AO+bQzQG S5xYXz6ftCLVngg60A8Df8vUijzUt5I= Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2110CDA7; Mon, 17 Jun 2024 01:03:46 -0700 (PDT) Received: from [10.57.73.35] (unknown [10.57.73.35]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CC2D23F64C; Mon, 17 Jun 2024 01:03:19 -0700 (PDT) Message-ID: <9ef638fc-5606-45da-a237-2e09ee05bbeb@arm.com> Date: Mon, 17 Jun 2024 09:03:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] nfs: fix nfs_swap_rw for large-folio swap Content-Language: en-GB To: Barry Song <21cnbao@gmail.com>, Christoph Hellwig Cc: Andrew Morton , Trond Myklebust , Anna Schumaker , Steve French , linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, linux-mm@kvack.org, Barry Song References: <20240614100329.1203579-1-hch@lst.de> <20240614100329.1203579-2-hch@lst.de> <20240614112148.cd1961e84b736060c54bdf26@linux-foundation.org> <20240616085436.GA28058@lst.de> From: Ryan Roberts In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Stat-Signature: 4hzqo5zga5jzimaea59fnzjj8gmmhca9 X-Rspamd-Queue-Id: 67D8280012 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1718611402-112212 X-HE-Meta: U2FsdGVkX1/ig2+vkImf4vruDOp5n76Gmts2q48ICgClp4OwxSJ1b8z+wfMopOE3UrC3AhSW8zRR0A2QsNjWcH/PlfpNHzURxSsDNbMqieIt3GD/ij8UIcCTuBOUQ+xYIleSdW261z3bU+72UGt+fN+LW9xwQrPmjL8zZZofFLNU3IGvYFo68Qsf49+/WJVCikNG3MkrweEow4NaAJi1O5UKyrPYrwWY1KfiT/J2EbVl0TAOXXY0IpirWizj6H8ifGKnYc20bUUwwdTNTUmdJjC4eL1imG92jhgU5R6UtDVynlVo4dppvlzXy8APL8CjK3R3Fq4ORjvsBl/rjFL49pcfzE3oarJCmZDiepUzUkqPf7OR481rXqrn5CvkXKA8uK++NdUfOK0RSpMzJXi1zG98tkYtmk9M/mFlJm0KjD1DP/L28UgffX1WG2/FB/OBXdPl4fISJbo3FbsXoRto3r9GyUBLGb/yVBSKNwvNix9a60M+YOELMGsF5DZbwL8fLOt3XUB1UZw43Ui1TmabAvmKZqIa9Xycq3L5xvvfwZvTmlO+tFQLFTGtdF2vt0okju0pukda+Q8hXFz3MI2stLxpRVclRY6ofsN6qUw2jAQycw15HDvoY1cQ4nMfhaR8AzFwFunP03yZU/BuEtMp3RMm7M4EsrnnDCf3moYqPHMrJNYZEW1mYC3v7SJNqt1sFGjwKpdcbF3OtIWC3yrGKedA/pYHubm4/XyvlmGD+d+VDNEvu0UbUBitNnF913yLJEibBGXFypLpkReUDyN+ZYxhi0c0KL4OC2pG3ASybDshbwOehHTag2DQqNlIx3DlrWvojjz30J/yM2CCYKCcPnFVufinwB0ALrREa77ZpzxyC8NZXmtnUa5Ps3gRK5NZB+ywTxJO/BsQBlzcXIon47jkDAt6bNflnEZ6UwzoCM1N8taDp0mwBx46eWnhvrpVzEFvf5xslaigyJjrJ/v 21Of/vwB foLst6pkR0btz+fzd8XX1fYi0ss67UKcUvPrpsZCtkBQneop1ymWbSrOfxpIyScRNPDj8xGhPaJcm6cFapm/vaJB2JYj6YU5G2iPkedd1qtkuEAcLNpcdgtlbTQra6+3VDX6Zq8r4p+uCUGgAiB754dwgkwYFE8OctBYbn5Nt3otFD9XY0FU1Eb/ULdfzOGOJu3VtNZRohVba8v0oi00q0Fq6gw== 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: List-Subscribe: List-Unsubscribe: On 16/06/2024 11:23, Barry Song wrote: > On Sun, Jun 16, 2024 at 4:54 PM Christoph Hellwig wrote: >> >> On Sun, Jun 16, 2024 at 12:16:10PM +1200, Barry Song wrote: >>> As I understand it, this isn't happening because we don't support >>> mTHP swapping out to a swapfile, whether it's on NFS or any >>> other filesystem. >> >> It does happen. The reason why I sent this patch is becaue I observed >> the BUG_ON trigger on a trivial swap generation workload (usemem.c from >> xfstests). > > This is quite unusual. Could you share your setup and backtrace? I'd > like to reproduce the issue, as the mm code only supports mTHP > swapout on block devices. What is your swap device or swap file? > Additionally, on what kind of filesystem is the executable file built > from usemem.c located? Yes, I'm also confused by this, since as Barry says, the swap-out changes to support mTHP are only intended to be activated when the swap device is a non-rotating block device - swap files on file systems are explicitly not supported and all swapping should be done page-by-page in that case. This constraint is exactly the same as for the pre-existing PMD-size THP swap-out support. So if you are seeing large folios being written after the mTHP swap-out change, you should also be seeing large folios before this change. Hopefully the stack trace will tell us what's going on here. (Sorry for my slow responses/lack of engagement over the last month; its been a combination of paternity leave/lack of sleep/working on other things. I'm hoping to get properly back into this stuff within the next couple of weeks). Thanks, Ryan