Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2670464pxp; Tue, 22 Mar 2022 03:46:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3LfhjVORj42LdLhhy6lphgESU/bTD4q3yK6T9MlVlZ4S20UJQfmfaKDia9GQ8SY4nzWR3 X-Received: by 2002:a17:902:d896:b0:153:563a:3716 with SMTP id b22-20020a170902d89600b00153563a3716mr17342826plz.86.1647945993983; Tue, 22 Mar 2022 03:46:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647945993; cv=none; d=google.com; s=arc-20160816; b=PCIwI/aVrCs/e35wybYOYnsCIKffCVNahJv7ssu2tr1W67YF0tv5tlFsest+hcBWlE hFwdbxNXDB3fS1i0vsWnn1nwD3GJ5S+/qDEpvC4lNkel8132rowcK9N6Zy3TSnx1JuzT mIfQgCcLchGTtXvc/eUeRo/n9WTNgoKUOcnW33N0dUiFUJSn7xUx+QLNlWZjkJ5kzYKG DAslcDohVw5RHlXXuXIgpw0VnBIL0QPioqRAFuVYD3Be2090/rObZOh55h05KneAyaq4 cEnmXiXzfD5KkD44RnnRLv69AgfXVlT+mnTAKj6rleAM+g81SeSpRychhXLEmUog2tSo CPOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dM4Devf9AxYRsJbry+GdljYWNC1RVwNRs/wmrQdV5X0=; b=nnNClvI+7n6nZf1LykinJbjA1HFLpdQi+L0F3RYPeAjq9gP35TqWOf4z88ZNL1xuDt 4kDGrDEgjUUeh2+W4cGLcZvaICbomT4vYDJbtgDjmVm8LWShMshCWE2PE3NB2DeRJuCp acQ5D6rE1l0DfxJDnZp/Wh0ooufSr4M8H16y0YjE9itkgF3/1jnbqBSGg8ROCo/B1dbS X571ezt3Z8OBHkRIIH0p4W6ctpLNwY4Ll6UevpyLlHHVAGRmZEtldTW3RCi8VqrRehNC fQw+gWPeQDnw/6gokapzVCIbA4Vj4XuqD61LirmJ/5nM+pXZvnRhM1HVXzpHQc8M3LNl U/KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=F7D+qgEn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fw23-20020a17090b129700b001bf576ca141si1855739pjb.1.2022.03.22.03.46.18; Tue, 22 Mar 2022 03:46:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=F7D+qgEn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231367AbiCVIjP (ORCPT + 99 others); Tue, 22 Mar 2022 04:39:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231297AbiCVIjO (ORCPT ); Tue, 22 Mar 2022 04:39:14 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD37F6AA4D; Tue, 22 Mar 2022 01:37:47 -0700 (PDT) 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=dM4Devf9AxYRsJbry+GdljYWNC1RVwNRs/wmrQdV5X0=; b=F7D+qgEn0hYzxLExaBQdxlCTo7 +Nzq36CHgpBmxsqxnHpmCLkzUrhOvePCCPAWtfbSGjKobx5cSHnL74IWm0cFRv8z+kJaFY0fDCbPD XmS2uP+/64IE9eeKEUHpwXN3RTN0Epc9SfCmR81EfmjgDaG6RdRPh4zbxoC4/kuEv/C+wS0KpGpof PllcHUQ46QDdKv/LYXQggc87GTszPdWrb5EEkEcVllPvuBFDNbdQzl7SzFECUcQ+XfE4qpFlCBV7X WFSz3lzoTDVpRPg+1VXBTlioMvfgERhyIoFAmmDcPo4TyCPy9aeGsKAZ06Kv2hUubDr5goafl6Lq8 jPxEabuQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nWa1J-00ARWh-66; Tue, 22 Mar 2022 08:37:37 +0000 Date: Tue, 22 Mar 2022 01:37:37 -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 5/6] dax: fix missing writeprotect the pte entry Message-ID: References: <20220318074529.5261-1-songmuchun@bytedance.com> <20220318074529.5261-6-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220318074529.5261-6-songmuchun@bytedance.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +static void dax_entry_mkclean(struct address_space *mapping, unsigned long pfn, > + unsigned long npfn, pgoff_t start) > { > struct vm_area_struct *vma; > + pgoff_t end = start + npfn - 1; > > i_mmap_lock_read(mapping); > + vma_interval_tree_foreach(vma, &mapping->i_mmap, start, end) { > + pfn_mkclean_range(pfn, npfn, start, vma); > cond_resched(); > } > i_mmap_unlock_read(mapping); Is there any point in even keeping this helper vs just open coding it in the only caller below? Otherwise looks good: Reviewed-by: Christoph Hellwig