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 90928C433F5 for ; Fri, 29 Apr 2022 01:21:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D541F6B0071; Thu, 28 Apr 2022 21:21:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D01F66B0073; Thu, 28 Apr 2022 21:21:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BCB416B0074; Thu, 28 Apr 2022 21:21:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id AAF186B0071 for ; Thu, 28 Apr 2022 21:21:36 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 802BB80814 for ; Fri, 29 Apr 2022 01:21:36 +0000 (UTC) X-FDA: 79408164192.24.CB3B90A Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf29.hostedemail.com (Postfix) with ESMTP id 658AC12006F for ; Fri, 29 Apr 2022 01:21:32 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AD8CF621F5; Fri, 29 Apr 2022 01:21:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6AEBC385AA; Fri, 29 Apr 2022 01:21:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1651195294; bh=LVmESRAb1gVwgkXczgSW1uhSdkcv4gprtILUykh3+mI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KeDZQgtbOHfR1luP+KoPEwbEiQyg/IVcr6+bK0+rwQykOGkuHCb+FMYlJYPfuXRhG aTGzp5+5m2u0TABgbsvUTjUIck6kVJCezjgK/EY5AfkJfjfZK5jEqZC/UdRv+w8hV/ aTag5Eezz7HJ7YqYKJNjKoYiXJo+wxacZbU6eEv0= Date: Thu, 28 Apr 2022 18:21:32 -0700 From: Andrew Morton To: NeilBrown Cc: Geert Uytterhoeven , Christoph Hellwig , Miaohe Lin , linux-nfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] MM: handle THP in swap_*page_fs() Message-Id: <20220428182132.883a082ad8918fd5f8073130@linux-foundation.org> In-Reply-To: <165119301488.15698.9457662928942765453.stgit@noble.brown> References: <165119280115.15698.2629172320052218921.stgit@noble.brown> <165119301488.15698.9457662928942765453.stgit@noble.brown> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=KeDZQgtb; dmarc=none; spf=pass (imf29.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 658AC12006F X-Rspam-User: X-Stat-Signature: pygdappjtqwy7shegcp1ca8abfxhsgfq X-HE-Tag: 1651195292-987582 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 Fri, 29 Apr 2022 10:43:34 +1000 NeilBrown wrote: > Pages passed to swap_readpage()/swap_writepage() are not necessarily all > the same size - there may be transparent-huge-pages involves. > > The BIO paths of swap_*page() handle this correctly, but the SWP_FS_OPS > path does not. > > So we need to use thp_size() to find the size, not just assume > PAGE_SIZE, and we need to track the total length of the request, not > just assume it is "page * PAGE_SIZE". Cool. I added this in the series after mm-submit-multipage-write-for-swp_fs_ops-swap-space.patch. I could later squash it into that patch if you think that's more logical.