From patchwork Fri Mar 18 07:45:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12784975 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 EC0DAC433F5 for ; Fri, 18 Mar 2022 07:47:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3AF5B8D0002; Fri, 18 Mar 2022 03:47:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 35E378D0001; Fri, 18 Mar 2022 03:47:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 24DC98D0002; Fri, 18 Mar 2022 03:47:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 169068D0001 for ; Fri, 18 Mar 2022 03:47:22 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D5AC524BFE for ; Fri, 18 Mar 2022 07:47:21 +0000 (UTC) X-FDA: 79256726682.07.25D679A Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by imf08.hostedemail.com (Postfix) with ESMTP id D70E416001B for ; Fri, 18 Mar 2022 07:47:19 +0000 (UTC) Received: by mail-pf1-f181.google.com with SMTP id h2so8815720pfh.6 for ; Fri, 18 Mar 2022 00:47:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i2Kxzfqa17JeX6zvSFdcAC9AxQ0uSV/1LhJKBQM+dBo=; b=UaEE+RkmBrZgxg3Qvjtn9RTTC4YPIXWjUW3Bx10IPJLn++s9nnBXRZniYrNY6COzIK IWkHYHzSzSedHDyCgxfuemUSGpOTx5zN1JmXRIf53whpuiafHr/G2sS4UNAIPiCXouCX f7NU6IrexwNDdBmpVYRxBti1K01eoKRwavqtWnUNoWhKtBI3epsNz0UTwPO8TZNuRlwc rP7AVwj8FBWqc8Z4X6K04uw11sUXFWJGOw0tKuSKZ36JJTwHaE+ZqQywCT0hkJ+t3rCz dzFLUASMTSnQiZLWAimXIDIH94ns8HwpLb+C1q7OsjG3Mg72Y/9acnbkxQYG62WGtgNm i8zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=i2Kxzfqa17JeX6zvSFdcAC9AxQ0uSV/1LhJKBQM+dBo=; b=w44kVWTrWd+ySbco9iQEa+EjbfITQ7FiDUNVPwuZIYQAw5WBla/u/WrXtUSCdUlo1g nRQDiTRKJdIR1xlsT3KHIcF21hYStvZeBme2dr5l5FSoPofevu9TYVnxkGceirADXRKO 3OZBif/R1WnpEB4L9cvcfiSLRZdOiEsdQMHVmi+x7az0FvsPZkEsbB8BzVPJmdFiEool 8a7TaU4Ysjd8jTjU8mhsjGt2efC4w4/0SIt47x7BGzvnVRyTEVJymaXDkwocb0Cu9ngA dnth7PRO/wGEiG2qWf+Ks05gdtM55i95oP0BwCvDHKUj1T0wLR7ZDcU+ncjOujCpCGxb IUQg== X-Gm-Message-State: AOAM533Ent9Z0LhXTNM8kemtSlWLHcBkf0bwKGaI2L0HjSeRtUSJaSCx S0cXOQ9LrjjRB07FfEhjCNTgpQ== X-Google-Smtp-Source: ABdhPJzB6PRnA27+IVJTkfrLIjmVsbIVOijMyvlx7Btwx9xnKrLpV9UgKC2XAfpJ48RfsZJJk7x5bQ== X-Received: by 2002:a62:684:0:b0:4f7:803:d1b0 with SMTP id 126-20020a620684000000b004f70803d1b0mr8966912pfg.10.1647589638495; Fri, 18 Mar 2022 00:47:18 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.233]) by smtp.gmail.com with ESMTPSA id a38-20020a056a001d2600b004f72acd4dadsm8770941pfx.81.2022.03.18.00.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Mar 2022 00:47:18 -0700 (PDT) From: Muchun Song To: dan.j.williams@intel.com, willy@infradead.org, jack@suse.cz, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, apopple@nvidia.com, shy828301@gmail.com, rcampbell@nvidia.com, hughd@google.com, xiyuyang19@fudan.edu.cn, kirill.shutemov@linux.intel.com, zwisler@kernel.org, hch@infradead.org Cc: linux-fsdevel@vger.kernel.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org, duanxiongchun@bytedance.com, smuchun@gmail.com, Muchun Song Subject: [PATCH v5 0/6] Fix some bugs related to ramp and dax Date: Fri, 18 Mar 2022 15:45:23 +0800 Message-Id: <20220318074529.5261-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.32.0 (Apple Git-132) MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: D70E416001B X-Stat-Signature: ehrri8dgtpxf1swtntttjawxqsw4uhu8 Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=UaEE+Rkm; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf08.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.181 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspam-User: X-HE-Tag: 1647589639-517330 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: This series is based on next-20220225. Patch 1-2 fix a cache flush bug, because subsequent patches depend on those on those changes, there are placed in this series. Patch 3-4 are preparation for fixing a dax bug in patch 5. Patch 6 is code cleanup since the previous patch remove the usage of follow_invalidate_pte(). v5: - Collect Reviewed-by from Dan Williams. - Fix panic reported by kernel test robot . - Remove pmdpp parameter from follow_invalidate_pte() and fold it into follow_pte(). v4: - Fix compilation error on riscv. v3: - Based on next-20220225. v2: - Avoid the overly long line in lots of places suggested by Christoph. - Fix a compiler warning reported by kernel test robot since pmd_pfn() is not defined when !CONFIG_TRANSPARENT_HUGEPAGE on powerpc architecture. - Split a new patch 4 for preparation of fixing the dax bug. Muchun Song (6): mm: rmap: fix cache flush on THP pages dax: fix cache flush on PMD-mapped pages mm: rmap: introduce pfn_mkclean_range() to cleans PTEs mm: pvmw: add support for walking devmap pages dax: fix missing writeprotect the pte entry mm: simplify follow_invalidate_pte() fs/dax.c | 82 +++++----------------------------------------------- include/linux/mm.h | 3 -- include/linux/rmap.h | 3 ++ mm/internal.h | 26 +++++++++++------ mm/memory.c | 81 +++++++++++++++------------------------------------ mm/page_vma_mapped.c | 16 +++++----- mm/rmap.c | 68 +++++++++++++++++++++++++++++++++++-------- 7 files changed, 114 insertions(+), 165 deletions(-)