From patchwork Sun Sep 25 13:33:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiyang Ruan X-Patchwork-Id: 12987986 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 6A796C6FA82 for ; Sun, 25 Sep 2022 13:33:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A9098D0005; Sun, 25 Sep 2022 09:33:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 659038D0001; Sun, 25 Sep 2022 09:33:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F92C8D0005; Sun, 25 Sep 2022 09:33:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 3E3088D0001 for ; Sun, 25 Sep 2022 09:33:43 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0AE274016B for ; Sun, 25 Sep 2022 13:33:43 +0000 (UTC) X-FDA: 79950700326.19.178229B Received: from mail3.bemta32.messagelabs.com (mail3.bemta32.messagelabs.com [195.245.230.82]) by imf26.hostedemail.com (Postfix) with ESMTP id 66E9C140007 for ; Sun, 25 Sep 2022 13:33:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.com; s=170520fj; t=1664112820; i=@fujitsu.com; bh=c7NQe7G34LBYxg4hwkKE43l4MRiwdYV+swWpJc9rsu0=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=kOCp5+qIKuMCfaB1F3maSLnvw4V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iJJEhJRUA9Mck1BRWx0tR+dL3zRWHPaY2sKxrOK/+ZsdNv+f/wya7WzyN 3OKSFva971rr1k1/eiJjIq7fGbjByNPj0DG1lpHlntXXwsqOufKzVBTtI5bcd3H4uGh398fTl 6yuGDuwuvT1rve9y7yDxY9+WPm/edf2ffzMc1xOGH31cCcnzPusutx4amvRD3WGkz1m5C1Mn9 BXF3kB78HqxKd2eRrnax04/1PT3uQOHnzuqw67icuIv0Bj2q2JrMsYNf597TS2slim+H7hQu/ lEbpvPp2XpY/IF5zip5W6H/eB+1//+srd147rnGmpNRnr3l7Um2y/KtyljOzslQzhaZdmJSrs DCa5e6mR/+ePLq3/ZNR2WQlluKMREMt5qLiRABFCfzrkgMAAA== X-Env-Sender: ruansy.fnst@fujitsu.com X-Msg-Ref: server-5.tower-585.messagelabs.com!1664112818!187471!1 X-Originating-IP: [62.60.8.146] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.87.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 4290 invoked from network); 25 Sep 2022 13:33:38 -0000 Received: from unknown (HELO n03ukasimr02.n03.fujitsu.local) (62.60.8.146) by server-5.tower-585.messagelabs.com with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 25 Sep 2022 13:33:38 -0000 Received: from n03ukasimr02.n03.fujitsu.local (localhost [127.0.0.1]) by n03ukasimr02.n03.fujitsu.local (Postfix) with ESMTP id 69FD41000CD; Sun, 25 Sep 2022 14:33:38 +0100 (BST) Received: from R01UKEXCASM121.r01.fujitsu.local (R01UKEXCASM121 [10.183.43.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by n03ukasimr02.n03.fujitsu.local (Postfix) with ESMTPS id 5CA071000C2; Sun, 25 Sep 2022 14:33:38 +0100 (BST) Received: from localhost.localdomain (10.167.225.141) by R01UKEXCASM121.r01.fujitsu.local (10.183.43.173) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Sun, 25 Sep 2022 14:33:34 +0100 From: Shiyang Ruan To: , , , , CC: , , , Subject: [PATCH v9 0/3] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind Date: Sun, 25 Sep 2022 13:33:20 +0000 Message-ID: <1664112803-57-1-git-send-email-ruansy.fnst@fujitsu.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.167.225.141] X-ClientProxiedBy: G08CNEXCHPEKD07.g08.fujitsu.local (10.167.33.80) To R01UKEXCASM121.r01.fujitsu.local (10.183.43.173) X-Virus-Scanned: ClamAV using ClamSMTP ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=fujitsu.com header.s=170520fj header.b=kOCp5+qI; spf=pass (imf26.hostedemail.com: domain of ruansy.fnst@fujitsu.com designates 195.245.230.82 as permitted sender) smtp.mailfrom=ruansy.fnst@fujitsu.com; dmarc=pass (policy=none) header.from=fujitsu.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664112822; a=rsa-sha256; cv=none; b=TTii66xt/1VYU9Nmd28QS8axF+UoKdoi0IflKQpoP2kx9LjogJNRHkSqdqUdJY7i83id9A 4KMRTNA6JvjRXH7zKhrVqfmkeZIjJVcBrCHrGFnDt0PtWjW7fMACdzqXsAYIdIwL+LHfqR 3L0nA4Vx8Ah0B0CtziE03GcX+QEujnU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664112822; 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:in-reply-to: references:dkim-signature; bh=c7NQe7G34LBYxg4hwkKE43l4MRiwdYV+swWpJc9rsu0=; b=x+xa/jD/9yQSP5UaxDSpI5BD60tutmanJ3biBhp01Ai6o8GLuFjFJ/J21ysON04B2vW2Dk 9gZK6I4SjeihLU2Y9Mgzww4xqVUnbPvrYdmy0zUymE5Pgq/uAm60YKe3R8fB6RFamwOZhy kc3A7gSLsmeKERO78NKZiFRxummMRl4= Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=fujitsu.com header.s=170520fj header.b=kOCp5+qI; spf=pass (imf26.hostedemail.com: domain of ruansy.fnst@fujitsu.com designates 195.245.230.82 as permitted sender) smtp.mailfrom=ruansy.fnst@fujitsu.com; dmarc=pass (policy=none) header.from=fujitsu.com X-Stat-Signature: qgc9jy94dbaxhehbwcw8fn1mokqt1ip1 X-Rspamd-Queue-Id: 66E9C140007 X-Rspamd-Server: rspam12 X-Rspam-User: X-HE-Tag: 1664112822-892165 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: Changes since v8: 1. P2: rename drop_pagecache_sb() to super_drop_pagecache(). 2. P2: let super_drop_pagecache() accept invalidate method. 3. P3: invalidate all dax mappings by invalidate_inode_pages2(). 4. P3: shutdown the filesystem when it is to be removed. 5. Rebase on 6.0-rc6 + Darrick's patch[1] + Dan's patch[2]. [1]: https://lore.kernel.org/linux-xfs/Yv5wIa2crHioYeRr@magnolia/ [2]: https://lore.kernel.org/linux-xfs/166153426798.2758201.15108211981034512993.stgit@dwillia2-xfh.jf.intel.com/ Shiyang Ruan (3): xfs: fix the calculation of length and end fs: move drop_pagecache_sb() for others to use mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind drivers/dax/super.c | 3 ++- fs/drop_caches.c | 35 ++---------------------------- fs/super.c | 43 +++++++++++++++++++++++++++++++++++++ fs/xfs/xfs_notify_failure.c | 36 ++++++++++++++++++++++++++----- include/linux/fs.h | 1 + include/linux/mm.h | 1 + include/linux/pagemap.h | 1 + mm/truncate.c | 20 +++++++++++++++-- 8 files changed, 99 insertions(+), 41 deletions(-)