From patchwork Wed Mar 2 08:27:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12765608 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 A2B21C433F5 for ; Wed, 2 Mar 2022 08:29:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 20F448D0002; Wed, 2 Mar 2022 03:29:08 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E7298D0001; Wed, 2 Mar 2022 03:29:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D7448D0002; Wed, 2 Mar 2022 03:29:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0032.hostedemail.com [216.40.44.32]) by kanga.kvack.org (Postfix) with ESMTP id F2CCE8D0001 for ; Wed, 2 Mar 2022 03:29:07 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 969D8181B5EAC for ; Wed, 2 Mar 2022 08:29:07 +0000 (UTC) X-FDA: 79198771134.27.BE6ABB9 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by imf14.hostedemail.com (Postfix) with ESMTP id 70076100002 for ; Wed, 2 Mar 2022 08:29:06 +0000 (UTC) Received: by mail-pl1-f169.google.com with SMTP id bd1so927346plb.13 for ; Wed, 02 Mar 2022 00:29:05 -0800 (PST) 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=nhj2UYDv6lhlSNPLYeAs8t7voAVPXKimrviFdjCHzWM=; b=DApuqsEmjJNLujancfXfCthOkTnRIUPq28/r6tOxkHmRYgOlkugPPK0h8zAh8enpIU HfkQBBHhLbFz8qxRq7E2RLuHrElDGGUHS9Y244UdqIirJhWbIHaCrn4YF7xafhgTecpu x6OH95W7ts5LUCdSkrPRN+VLxTqzK7oKM7OtnhOIOVkuakDHhP+07oAY8HWOUrVKWwpS DnRwLDlUAcWgA1CnWdFtO0QOL8kLiRQ+vjGLe4BEgo4v9XJAX76t8Q0sNmUSx1tdL1/b w7Y2MRd1la+tiYmu/lVxcH6LXEof0W4BIhpWEx+hwGiQJUbmqWHEmQaFjYs8VD1Hu04i l7tw== 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=nhj2UYDv6lhlSNPLYeAs8t7voAVPXKimrviFdjCHzWM=; b=sbR8LEhYViD0wQzpsjMcek+u2sz6DIij4zLwtiZSFIyiMpfFsELspeI9UdBr/SPZBW L6QEY8yrmos+s+IGdcKYjmH9acQmunwRbZorIE8lzzjqTIWiFnZMdTmPNGfPdZ5SVAgc 3VhY4IAkjW0YecCYPzxvyMOU+aKPneWEqnbJjtN5d/bl9ReapWdSwS8r7GfOd9L0ENmK s/2TB8Zz0bpg0akczegIsfP7ptj8NV6FfAOIJErQ/Ii9XUGqIViw2E44a68dU+KQgGlj S2PHl07tAIgRL8msNiSKPSu4JxhX3vytqP8G2jo1NAknr48pE/MStiGRxJL5Ex4sejiA nh7g== X-Gm-Message-State: AOAM533UJr2HqK3N6sEByYP8gL1+Lyn2A7wMlsq6XRXGMWM7Wo2fW0EF 614CgDR2LUMFOBwrRx9gx2adnQ== X-Google-Smtp-Source: ABdhPJw2Snc+gQoBgYJzFskUkuKAvbAT2RF7i6kPMEQuXqdEKU1ZjuWSi3E8iJ7UVQPqE+7d8aedhQ== X-Received: by 2002:a17:902:e5c4:b0:151:9bf6:f47f with SMTP id u4-20020a170902e5c400b001519bf6f47fmr635388plf.110.1646209745090; Wed, 02 Mar 2022 00:29:05 -0800 (PST) Received: from FVFYT0MHHV2J.bytedance.net ([61.120.150.70]) by smtp.gmail.com with ESMTPSA id a20-20020a056a000c9400b004f396b965a9sm20922228pfv.49.2022.03.02.00.28.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 00:29:04 -0800 (PST) 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 v4 0/6] Fix some bugs related to ramp and dax Date: Wed, 2 Mar 2022 16:27:12 +0800 Message-Id: <20220302082718.32268-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.32.0 (Apple Git-132) MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 70076100002 X-Stat-Signature: z9qgrwtzhwpp5p3rouh7itcbdfx7n3dh Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=DApuqsEm; spf=pass (imf14.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.214.169 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-HE-Tag: 1646209746-316692 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(). 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: remove range parameter from follow_invalidate_pte() fs/dax.c | 82 +++++----------------------------------------------- include/linux/mm.h | 3 -- include/linux/rmap.h | 3 ++ mm/internal.h | 26 +++++++++++------ mm/memory.c | 23 ++------------- mm/page_vma_mapped.c | 5 ++-- mm/rmap.c | 68 +++++++++++++++++++++++++++++++++++-------- 7 files changed, 89 insertions(+), 121 deletions(-)