From patchwork Wed Feb 2 14:33:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12733093 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 C70DEC433FE for ; Wed, 2 Feb 2022 14:34:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3DE3E8D0108; Wed, 2 Feb 2022 09:34:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 38D3C8D00F9; Wed, 2 Feb 2022 09:34:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 22E7A8D0108; Wed, 2 Feb 2022 09:34:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0188.hostedemail.com [216.40.44.188]) by kanga.kvack.org (Postfix) with ESMTP id 10E1F8D00F9 for ; Wed, 2 Feb 2022 09:34:21 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B5C3D9A27F for ; Wed, 2 Feb 2022 14:34:20 +0000 (UTC) X-FDA: 79098085080.15.9ECA044 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by imf17.hostedemail.com (Postfix) with ESMTP id C157640006 for ; Wed, 2 Feb 2022 14:34:19 +0000 (UTC) Received: by mail-pf1-f175.google.com with SMTP id i65so18945122pfc.9 for ; Wed, 02 Feb 2022 06:34:19 -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=16vqX60UmjqWNFm7zG92JTmfSodESNq7kHVS1cy34iA=; b=pIE1avRsIxoQ5fVb4NSUe2Fxzd41PZOYVQWoiDsv0TjH20bhHYZ6DaMZU98/la6pab Ys6Qj3meDpkxL4odhvTHC3NKoSceGl6HCEEbjCFCljQyHx5pq0eXnKt4rhvwLEM0WPdN jxHZWknT/IImkOgRBUgIUSkYo1p5IUWAten8PDNxyfwCOk0eIpxZlep6r6Cv3FkTx58R WtJuO/aQKel4Hjwnsn33aCyWIn6ru+9Fc/xQZ459ZpfYNxVWtVIg2Gi0IwMANRRV4wML QMzxLkfQltwAIg0/1hSHN0+y8MX9A61/sDEgQ5LaKetiS2+zr6uC64oWPnFzQ3mwsGs8 mgeA== 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=16vqX60UmjqWNFm7zG92JTmfSodESNq7kHVS1cy34iA=; b=Ub3x/Qx+kqnLdXY1YtOP3lyNEmoo0IDDizAcuGrLddfo4TgM6AC8muqysufQsB26t+ 0OdJA+vDex+ZxzdXuUMmHB1h6WBccX0WKkpvECKoGOkmspXaVRofiyapBzE9mZVPeS1p 2EflUk1Q4GV1D6cPRQtr+oDBPPWuWaclryOQqwUd67Onfc/PSuueRyr8Wvl0YJ4luwTw X9EzWi9fhLjL+I9NdlVpAf0VvB8qh113C+lSUF8K17fyJ9zhVZvFoUnuqPGka+21zmz1 F/GHVN0j6y+K9atZayTj/8fECb4CQnI2BCR5mrPdxGdLuuofuD8Jc9/q2og6mOkGG/G+ So7g== X-Gm-Message-State: AOAM532TC+tMtmqH8ByPkCS5hc0Wj7yygzcY/WgWkeHOlJK74bDG22Ic kPeySX0UCeC4GF8Tn9+EBfxPZw== X-Google-Smtp-Source: ABdhPJxOdQap8/4HoWdm4i8JqHFqRS1d4ylTDNP39+aW3pX5NvYo3r+I5ODTVwdlAGTqeidAEK+lQQ== X-Received: by 2002:a62:7650:: with SMTP id r77mr29703773pfc.85.1643812458488; Wed, 02 Feb 2022 06:34:18 -0800 (PST) Received: from FVFYT0MHHV2J.tiktokcdn.com ([139.177.225.241]) by smtp.gmail.com with ESMTPSA id s9sm29079268pgm.76.2022.02.02.06.34.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 06:34:18 -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, Muchun Song Subject: [PATCH v2 0/6] Fix some bugs related to ramp and dax Date: Wed, 2 Feb 2022 22:33:01 +0800 Message-Id: <20220202143307.96282-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.32.0 (Apple Git-132) MIME-Version: 1.0 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: C157640006 X-Stat-Signature: 4fj8duz5xegdnqjd4mn6gjhsraf3iq1t Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=pIE1avRs; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf17.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.210.175 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspam-User: nil X-HE-Tag: 1643812459-671809 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: 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(). Changes in 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: page_vma_mapped: support checking if a pfn is mapped into a vma mm: rmap: introduce pfn_mkclean_range() to cleans PTEs 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 | 17 ++++++++-- include/linux/swapops.h | 13 +++++--- mm/internal.h | 52 +++++++++++++++++++---------- mm/memory.c | 23 ++----------- mm/page_vma_mapped.c | 68 ++++++++++++++++++++++++-------------- mm/rmap.c | 87 ++++++++++++++++++++++++++++++++++++++----------- 8 files changed, 180 insertions(+), 165 deletions(-)