From patchwork Tue Mar 29 23:49:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 12795340 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 17E41C433F5 for ; Tue, 29 Mar 2022 23:51:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 223F88D0002; Tue, 29 Mar 2022 19:51:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1AD4D8D0001; Tue, 29 Mar 2022 19:51:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 026798D0002; Tue, 29 Mar 2022 19:51:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id E4F628D0001 for ; Tue, 29 Mar 2022 19:51:16 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 8EFCAA564F for ; Tue, 29 Mar 2022 23:51:16 +0000 (UTC) X-FDA: 79299072552.19.7F4E009 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf03.hostedemail.com (Postfix) with ESMTP id E4C5920005 for ; Tue, 29 Mar 2022 23:51:15 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 64FEC1F37B; Tue, 29 Mar 2022 23:51:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1648597874; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=decwXtYK4xzf9z+YJq9kZIT8RF7eJZEH+v+/UIEpIs0=; b=gIlals8TlB5yctjTv9aD0cnYjD5k+Z3UK4jKAFB9nKXC2iWqPABcPBOBg/Kq12vS0dHNym ZvqMi5c0BDJqW6tnJz0/0h3/c++bM+JN9onMMUO98A0/fYuNG77UqOAuJm+79FANKppCrL KSYerLOwkBAWGWWT+u2XCxNfUCxukeE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1648597874; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=decwXtYK4xzf9z+YJq9kZIT8RF7eJZEH+v+/UIEpIs0=; b=oZLW8JZWx9ZEKj2ved76aCXNp4XaZHcDloX0gXO0FFuNXj9vIjOpVdlfSPB/uUG6xIVVcZ +VSqHzJJz1AbC2Bg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6BFCF13A7E; Tue, 29 Mar 2022 23:51:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id hZv0CXCbQ2IcLwAAMHmgww (envelope-from ); Tue, 29 Mar 2022 23:51:12 +0000 Subject: [PATCH 00/10] MM changes to improve swap-over-NFS support From: NeilBrown To: Andrew Morton Cc: Christoph Hellwig , David Howells , linux-nfs@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Wed, 30 Mar 2022 10:49:41 +1100 Message-ID: <164859751830.29473.5309689752169286816.stgit@noble.brown> User-Agent: StGit/0.23 MIME-Version: 1.0 Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=gIlals8T; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=oZLW8JZW; spf=pass (imf03.hostedemail.com: domain of neilb@suse.de designates 195.135.220.29 as permitted sender) smtp.mailfrom=neilb@suse.de; dmarc=pass (policy=none) header.from=suse.de X-Rspam-User: X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: E4C5920005 X-Stat-Signature: txqzr3dur13aj8wb4jsd3c7zyfu3565q X-HE-Tag: 1648597875-315551 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: Assorted improvements for swap-via-filesystem. This is a resend of these patches, rebased on current HEAD. The only substantial changes is that swap_dirty_folio has replaced swap_set_page_dirty. Currently swap-via-fs (SWP_FS_OPS) doesn't work for any filesystem. It has previously worked for NFS but that broke a few releases back. This series changes to use a new ->swap_rw rather than ->readpage and ->direct_IO. It also makes other improvements. There is a companion series already in linux-next which fixes various issues with NFS. Once both series land, a final patch is needed which changes NFS over to use ->swap_rw. Thanks, NeilBrown Tested-by: David Howells Tested-by: Geert Uytterhoeven --- NeilBrown (10): MM: create new mm/swap.h header file. MM: drop swap_dirty_folio MM: move responsibility for setting SWP_FS_OPS to ->swap_activate MM: reclaim mustn't enter FS for SWP_FS_OPS swap-space MM: introduce ->swap_rw and use it for reads from SWP_FS_OPS swap-space MM: perform async writes to SWP_FS_OPS swap-space using ->swap_rw DOC: update documentation for swap_activate and swap_rw MM: submit multipage reads for SWP_FS_OPS swap-space MM: submit multipage write for SWP_FS_OPS swap-space VFS: Add FMODE_CAN_ODIRECT file flag Documentation/filesystems/locking.rst | 18 +- Documentation/filesystems/vfs.rst | 17 +- drivers/block/loop.c | 4 +- fs/cifs/file.c | 7 +- fs/fcntl.c | 9 +- fs/nfs/file.c | 20 ++- fs/open.c | 9 +- fs/overlayfs/file.c | 13 +- include/linux/fs.h | 4 + include/linux/swap.h | 7 +- include/linux/writeback.h | 7 + mm/madvise.c | 8 +- mm/memory.c | 2 +- mm/page_io.c | 247 +++++++++++++++++++------- mm/swap.h | 30 +++- mm/swap_state.c | 22 ++- mm/swapfile.c | 13 +- mm/vmscan.c | 38 ++-- 18 files changed, 347 insertions(+), 128 deletions(-) -- Signature