From patchwork Sat Feb 4 14:58:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shiyang Ruan X-Patchwork-Id: 13128729 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 D6AFBC61DA4 for ; Sat, 4 Feb 2023 14:59:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B95D06B0072; Sat, 4 Feb 2023 09:59:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B461E6B0073; Sat, 4 Feb 2023 09:59:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A0EDF6B0074; Sat, 4 Feb 2023 09:59:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 8D4DF6B0072 for ; Sat, 4 Feb 2023 09:59:06 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 5B7951A068F for ; Sat, 4 Feb 2023 14:59:06 +0000 (UTC) X-FDA: 80429917092.11.0483F6E Received: from mail1.bemta34.messagelabs.com (mail1.bemta34.messagelabs.com [195.245.231.1]) by imf09.hostedemail.com (Postfix) with ESMTP id F0329140002 for ; Sat, 4 Feb 2023 14:59:03 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=fujitsu.com header.s=170520fj header.b="vuB9Dkq/"; spf=pass (imf09.hostedemail.com: domain of ruansy.fnst@fujitsu.com designates 195.245.231.1 as permitted sender) smtp.mailfrom=ruansy.fnst@fujitsu.com; dmarc=pass (policy=none) header.from=fujitsu.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675522744; 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=Y6556VUSt0g6C9g9VUOGSPdcCC4oR7BzWPz7nW90/xI=; b=7lUB9EKHeraIzIgo8smD8iDv1oFCppHvaimeYdZHEflLSiXimtFtAhh2U3kwy6d/dTRlxy rrxr2Wxv6wQN7sYWg39OYfeQwyjqAFaWjJ4tGDwdPjcNoUaaxuS9BXvcCMT2Z972sNOwxL XK/VCUJQSfTp39yoPf4Ln7ABqK3VcEg= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=fujitsu.com header.s=170520fj header.b="vuB9Dkq/"; spf=pass (imf09.hostedemail.com: domain of ruansy.fnst@fujitsu.com designates 195.245.231.1 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=1675522744; a=rsa-sha256; cv=none; b=37N9a71ZtUlo4WNd/7YmTZ4auCjfS4zGQdHe1kdyxhg/F2sM9HD0pb/j/ruQk3mRt/SWaD 9WOXY932DTqKhH657ZPiubS6GSvluryzJjsOjzzOVRq4wCetzJzn4WNIAqXabrp2Mvfk+t lkSN9rg4QkuUSXe+buosUqU4uHBibRE= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fujitsu.com; s=170520fj; t=1675522742; i=@fujitsu.com; bh=Y6556VUSt0g6C9g9VUOGSPdcCC4oR7BzWPz7nW90/xI=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=vuB9Dkq/CcCu6kUL9IGhoRjSHTuDyqt/LgQw4M3XYGQeXGNDdQTHT5rvZF+9aCLQG O8Agu3z8w6ml0kJNoKNzepUVnlqbwYWPqMeskN7XoFmZb93wDlnZUGxhphfwWVRqvH cn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uQfatKQ3iDAo7WhRbXqx1ou3mffJy2UP1n468/zi7VbzOKNPzz47JF3dciX I7/vB/Fky4rmRIgEKkmt3/Vu8us/g9EeztKJXD+XdRM9kOWz6mKlSm67cv1DXxtIyz3XNNuMk r0LDjPU/Ix45PduTUHbY/yCXe6xOXvAmm849Sc6Zhzg2Lmgy36/FVXDz2Fzx20WLLTcrP29p5 7yuefzFefXE4guSDCtjXm/wCLNY8+bFO48wJZbijERDLeai4kQAxJmK9JcDAAA= X-Env-Sender: ruansy.fnst@fujitsu.com X-Msg-Ref: server-15.tower-548.messagelabs.com!1675522738!73849!1 X-Originating-IP: [62.60.8.179] X-SYMC-ESS-Client-Auth: outbound-route-from=pass X-StarScan-Received: X-StarScan-Version: 9.102.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 28624 invoked from network); 4 Feb 2023 14:58:58 -0000 Received: from unknown (HELO n03ukasimr04.n03.fujitsu.local) (62.60.8.179) by server-15.tower-548.messagelabs.com with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 4 Feb 2023 14:58:58 -0000 Received: from n03ukasimr04.n03.fujitsu.local (localhost [127.0.0.1]) by n03ukasimr04.n03.fujitsu.local (Postfix) with ESMTP id DB0FD150; Sat, 4 Feb 2023 14:58:57 +0000 (GMT) Received: from R01UKEXCASM223.r01.fujitsu.local (R01UKEXCASM223 [10.182.185.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by n03ukasimr04.n03.fujitsu.local (Postfix) with ESMTPS id CEB6E7B; Sat, 4 Feb 2023 14:58:57 +0000 (GMT) Received: from localhost.localdomain (10.167.225.141) by R01UKEXCASM223.r01.fujitsu.local (10.182.185.121) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Sat, 4 Feb 2023 14:58:53 +0000 From: Shiyang Ruan To: , , , , CC: , , , , Subject: [RESEND PATCH v9 0/3] mm, pmem, xfs: Introduce MF_MEM_REMOVE for unbind Date: Sat, 4 Feb 2023 14:58:35 +0000 Message-ID: <1675522718-88-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 R01UKEXCASM223.r01.fujitsu.local (10.182.185.121) X-Virus-Scanned: ClamAV using ClamSMTP X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: F0329140002 X-Stat-Signature: ar9j7j8z1gjfse7c41m9ybtpp4ycb397 X-Rspam-User: X-HE-Tag: 1675522743-843364 X-HE-Meta: U2FsdGVkX19FmddW00S6gvaTJNNkQ3Lk3zlK7Im5qu+P4PGdpSWEm72fMiDIQ6liDIPt9Q6OS0ODz7XBIYPUty1SVFuCAmFxLGfNHvQ/r+sVQs8A9U5uQ0Cqo0J/Yqv9WdlJSU1dYFvN7kySHxtzUTV2mkaR8IbPD0RZMrkHcnzfcSZDSdgfALA0kZOyXsGhFysHNpbLuFV5lOuZtgTmmfZYI37QutOASE7uBO6xJ1WnJS5WX0fziUXqnP5cVCt5+20XSC92STcxeAdeg0gX8/xTNCqFX+H4Kx4XfF/JpEDYPHxlF5wpEq5BioWkflqez7okPN0O2o4O1EfzGYZxs8aJZ8qtTRGAAXRjifnF2mMZrRluAUd+0WxQrk7+bt33eXicVmR+lLFdsb3LZDsla/xNlhHdQbi5i8AdygnmNwSoT3F6bIetHnrh5VnX33Wq0AGEEWlEaCKLOePL0qFric1NiCXyn+dFY0T7WkNhOuYvujDANHcqtEJW3KaqJphgw/5pTuNivE9ROnDBMunp74f5jzqcEuD135h0AgC2o66XGCNcZvfkLpKjvU+o0xJC+Zb2xs0mF2doWS7tJKtSFijYKXLO0Os0vLRVRqof638vfdfZSgqaNKwz+A6iUumbWj291KeX8O8S2ntHij7vHoI55lcf3zafVAVMGB7a5LyCgER04WOHuMVq2ILTwSg77aDj/T5nnij0GJacfGxn8gRGgBCdI6++WFDhyMB8O+Cq3pQqUzamMm05SUko7fbwUBpIKT6awUu5BB+tTfO7gKrWaUiIjgvhOlIZTBIe/VtOJ5WgcEKXFpsrP9Oc+iU4Rg7mrsfNaTN2eiYlVtPOvdy6fYlriFpjeTqh1x9cD2XQtdcCA9eeK7suyDsyDIvaMQR0ZQXtmb5VwK0NslEXG3Ypu7+IEZGyMrNQo5ObSE7nbnFKx/dFGjTLlUyoa3Hy4pGuQuz/TdJ5gTvOldT u4wd1PGp gBtoufjF7Ts2O8WecTPclVdhYS9xGVeJ8FNQFJKztUhJeQZr+/+sfK6C/WBL+RT7UGT6Kf0iGDJMVEOoOUwtK6ljyIiV0z6iI8JN7ybDVvt0fg1A21qcqTLjK/aais24O3Q2WfcBXARdPB37yjea38e2G7fckoMbyBeJcj/RN0grIMfAEM5NnCkGGkYrQp0kddsNWm0ub09YjpHTuhf5mwr1mBolPuLtTcF3cMFVsmH8xdSWdaDBxor62H7mtJlIYXI9sV/hh4UUWvha8UafB8tCXgfhIX/gqy+9GNqhJSJ+vIjY= 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 v9: 1. Rebase on 6.2-rc6 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(-)