From mboxrd@z Thu Jan 1 00:00:00 1970 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 68C9FC433FE for ; Tue, 22 Mar 2022 08:34:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 01E9A6B0073; Tue, 22 Mar 2022 04:34:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F11596B0074; Tue, 22 Mar 2022 04:34:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD9A06B0075; Tue, 22 Mar 2022 04:34:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id CE47A6B0073 for ; Tue, 22 Mar 2022 04:34:40 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id AB35960B4D for ; Tue, 22 Mar 2022 08:34:40 +0000 (UTC) X-FDA: 79271361120.10.1FFD5FB Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf09.hostedemail.com (Postfix) with ESMTP id 3BE5314000D for ; Tue, 22 Mar 2022 08:34:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=bK/bRjCsilG76Zx9QpWZl8IsADdDvzITYegWrnMZgG0=; b=gE2vwGiPaE3Z2US+L37e/vcT2p rHT9WE4N73NfIlMrU8r8c4AaKabWtlJ50gnKyY1mhXEYAUTNLLhjj+HPiso+4RmMhnat95t3cNiA2 6aQZXw1bIzH3CG0CVnJpDUewhqu6ZZaN/8A1Jlg3I1hEuyoz+u2bVru4NstDMT2Jt6ayxtR5lzrQJ ALLBwtWUrna/ZifwObcrzMwXWMnKajr1BwhefRL8t63QbkrVvVc654Bgoc9RyKkShKAQnPFHrVGb7 0Qor9R86d4qZWpuF2rNU2ZbzPX5Jd7AmRsBRxGsnGq2ezTnMvieMFT1lRZGNp1kblipiyEsXqxUIE zgqbGdcA==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWZyC-00AQxs-Q8; Tue, 22 Mar 2022 08:34:24 +0000 Date: Tue, 22 Mar 2022 01:34:24 -0700 From: Christoph Hellwig To: Muchun Song Cc: 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, linux-fsdevel@vger.kernel.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org, linux-mm@kvack.org, duanxiongchun@bytedance.com, smuchun@gmail.com Subject: Re: [PATCH v5 2/6] dax: fix cache flush on PMD-mapped pages Message-ID: References: <20220318074529.5261-1-songmuchun@bytedance.com> <20220318074529.5261-3-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220318074529.5261-3-songmuchun@bytedance.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=gE2vwGiP; dmarc=none; spf=none (imf09.hostedemail.com: domain of BATV+cd3f9be249160558da0e+6785+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+cd3f9be249160558da0e+6785+infradead.org+hch@bombadil.srs.infradead.org X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 3BE5314000D X-Stat-Signature: 453e9z3ckb6mc1f5tm8x43rwydbu6fbc X-HE-Tag: 1647938080-839700 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: On Fri, Mar 18, 2022 at 03:45:25PM +0800, Muchun Song wrote: > The flush_cache_page() only remove a PAGE_SIZE sized range from the cache. > However, it does not cover the full pages in a THP except a head page. > Replace it with flush_cache_range() to fix this issue. This is just a > documentation issue with the respect to properly documenting the expected > usage of cache flushing before modifying the pmd. However, in practice > this is not a problem due to the fact that DAX is not available on > architectures with virtually indexed caches per: > > commit d92576f1167c ("dax: does not work correctly with virtual aliasing caches") > > Fixes: f729c8c9b24f ("dax: wrprotect pmd_t in dax_mapping_entry_mkclean") > Signed-off-by: Muchun Song > Reviewed-by: Dan Williams Looks good: Reviewed-by: Christoph Hellwig