Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp994129lqs; Fri, 14 Jun 2024 11:21:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW3tgWh68Ilxbil4nOlOPNkwcdJT/UK5ZAOHlBCq6a4U+2l5xyDui78D73yLokHPO7ap/sXmkeuVWKXYIpZ3Q1bFTS+dyXj3FCnsfaedA== X-Google-Smtp-Source: AGHT+IHUQIMrzx9A0r5RaCQOMEEoTBP8tVGnIGzCqQj9zsDTA8gHnbdvImfNbLtisB4da+4uO77J X-Received: by 2002:a05:620a:2a08:b0:795:758d:fbbf with SMTP id af79cd13be357-798d24387d3mr372138685a.41.1718389312340; Fri, 14 Jun 2024 11:21:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718389312; cv=pass; d=google.com; s=arc-20160816; b=VcpPAsh0WEMakJ5vROp11o6PC4BTm0/bEnUZuqmqjMHxdeNQsn1ztz6hd0KTJuOre3 Rr25gli49qwaTWIAz3yLlokTixX7JPmKYoWm8BX3pJQjR27rGhg54jFw4SelBv0LsgpN vH/OZmTxp61s1HO/otDSjKRp02eJTAdAIVD9Gl4BtN9CBNm5JxmFC+ox/58ktZUQa3/y wjJwlaReqA3+nuBa3UJKx3VQzKL5w89/G3EfEOH6PKya14KJfEiIi8tYDR2oaxAWuHJD JeujgvURnfEnSpAKZwXIQG1jgyOM5neSA7487m6oOM4SnednxHyvD0n74MoKq2aXReCK WDvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=6BTpFuDXihOFgMQWv9fTixjbtbp/wjM2ts8BDIR2HPE=; fh=M5VlQGM7OJWaT4CppUpvDLZCCklhjXUZFh5ltQ4ht9Y=; b=t0ot/M8dd5T/CDNkb97eaGpZOTjtEXVXoRqiOyv6LK/ZBnzYv60+weXSmM00JHuUxG odfhDEWTmw6P8/mWh1kqJYfvg68M9NITKSkt0dm0NhjJniiWOWLT7LBZ2cuUZ6AlIqQC jACVQSRCwA1Rj+ojnyEGOe1/drMUBkFBjw2M0qy1XRGQfIo0KLVp8YptGfnfxaYXZkgC PObpGDsZcsu7dBHSg2/jrL72K8jpQpbU95EhfS71LyYbWITyEMXyNUpLaVefIVOgCmUO /kw0RyzKV7tneJZthTWgDsinTLyKZEAv+pjxu4FUe10M25z3lCd2oNLQCXkmcH0+ExgL 22lw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=mXa1p9Ol; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-nfs+bounces-3843-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3843-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-441f30f67c6si45011881cf.654.2024.06.14.11.21.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 11:21:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3843-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=mXa1p9Ol; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-nfs+bounces-3843-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3843-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E79D51C22777 for ; Fri, 14 Jun 2024 18:21:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 164F31990BE; Fri, 14 Jun 2024 18:21:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="mXa1p9Ol" X-Original-To: linux-nfs@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCFB04414; Fri, 14 Jun 2024 18:21:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718389310; cv=none; b=BCGdunGpvNvmjhVNOM3tYeGpzrklqVRpyg/HiSXhWduaSILSQM6sBxz0A9dzClPbphd0v+JtyrxRobIHZLV9/toPhfHHHvTMykyZt8ecN8C1qvUxNzSEDZKYlBsa4psbauakEurIpgj9N75d+QCuRxDiyosNT2tmjlkv6v0ooL0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718389310; c=relaxed/simple; bh=t10/DKZawOM942+Rfsr5XZjFk4CUdJJZ76zYdBDj74o=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=DgNt5xuBY4nfJJ4XwERNGY4fyhWbVSHUWH7aTolgDICJHhz503ryCFXUj7J+7SmAWIGKJvqW3nF8L7/pv67l6EHSaHM7bL8IQ/wPSmRkEO3smedxf+ekmyp57Lvft6p0m02KP1cxd/FlvceqtJV+VI/+nrOcD9fPyVC8ECTkxrY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=mXa1p9Ol; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CBB81C2BD10; Fri, 14 Jun 2024 18:21:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1718389309; bh=t10/DKZawOM942+Rfsr5XZjFk4CUdJJZ76zYdBDj74o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mXa1p9OljcPPnHJe+S0GH8f6obYCNzxKYDdRO1my5cwauiSQ3W6HwFATHU6hTo3hF 21LYGc1ijTFwH0lWjVP6YdcPtcsA6JGnHW8g9LjMAkIEJmpDLWk3TKDD1TpL+mTZ7q tJ7MtxzA0aJpeJ6qgSQhZodFd66LDBIisBke4hwY= Date: Fri, 14 Jun 2024 11:21:48 -0700 From: Andrew Morton To: Christoph Hellwig Cc: Trond Myklebust , Anna Schumaker , Steve French , linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, linux-mm@kvack.org, Barry Song , Ryan Roberts Subject: Re: [PATCH] nfs: fix nfs_swap_rw for large-folio swap Message-Id: <20240614112148.cd1961e84b736060c54bdf26@linux-foundation.org> In-Reply-To: <20240614100329.1203579-2-hch@lst.de> References: <20240614100329.1203579-1-hch@lst.de> <20240614100329.1203579-2-hch@lst.de> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 14 Jun 2024 12:03:25 +0200 Christoph Hellwig wrote: > As of Linux 6.10-rc the MM can swap out larger than page size chunks. > NFS has all code ready to handle this, but has a VM_BUG_ON that > triggers when this happens. Simply remove the VM_BUG_ON to fix this > use case. > > ... > > --- a/fs/nfs/direct.c > +++ b/fs/nfs/direct.c > @@ -141,8 +141,6 @@ int nfs_swap_rw(struct kiocb *iocb, struct iov_iter *iter) > { > ssize_t ret; > > - VM_BUG_ON(iov_iter_count(iter) != PAGE_SIZE); > - > if (iov_iter_rw(iter) == READ) > ret = nfs_file_direct_read(iocb, iter, true); > else I'm thinking this should precede "mm: swap: entirely map large folios found in swapcache", or be a part of it. Barry/Chuanhua, any opinions?