Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2685466pxp; Tue, 22 Mar 2022 04:06:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXN8cvQ1YZEl81IWkX+F574a5kO1WKKuTDxJLmo/1pkoxwTDQBcIeqoK9ogZNOXIiTecyn X-Received: by 2002:a05:6a00:4107:b0:4fa:ac90:f299 with SMTP id bu7-20020a056a00410700b004faac90f299mr6435123pfb.58.1647947217117; Tue, 22 Mar 2022 04:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647947217; cv=none; d=google.com; s=arc-20160816; b=vmnz91yQZ+W8wVn/vMAjWvdX8trL9TYMRQMm99Gi6+W+3/uS6y2Bq4QG0GsIUBqviK m9EYNl/Vw7gu4UKAEXy+EAKAGLbYWFhUHbWNcxUZJF3JKDkPFh4msvJ7fqm5ROqPBlyg XyFfNezQww4dyg2TeOxJdi2gHuba3FLVj4iA59FH62qes9AWNRjACuwCKhwX2VWzxb1y Wy9zIHUCKtR5n6oxEIfgReT3Py2in6meoJtV24cmBBY1nOvF9rofrlsqOxvYhEAAfAX5 lfK1Zwn4Isb7rc0lTqlBD/26e/dcdgy+7JyNKTfHeFgZPD9Ncdet9fAYUAUCSMwbNnai DmOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=QUKbEll3B3MyYDyon4P+rDcqkN3F18MECGrGkqKUuno=; b=R8OyDhaTo+Y9b4ugb3C7g/gaSHWErbN4PwtrOS3rIvc7iFhLGOyDkfsp4izrosiSJn CisyWpjjJnSOPd6yfH3NaQVBLHOZ2VtsKXJ8I25sYxUsr02MgifgyKVuDtdnsEvJ7ynS vxeT0acn72cA2vnC/r/WMvgRcgr8k0ofG+RWN8rDqP081wQSBzjWaQYIwH4Y2VVA4uBS w3mtonJM9KlAl+I0yAKCJuTMD7W2InjCYVgGGaLOG2WtTScaEjCL0N37VZMlo51X6VPj Iqx7KWMsZIZiW0Xqg2deitNVCZNnjMKhR7NjqzuTtCXMwBIx+CnB0IkBEnclMwMawnfz pEtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=rm2us6OK; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e14-20020a65648e000000b003816043ef27si15840420pgv.284.2022.03.22.04.06.44; Tue, 22 Mar 2022 04:06:57 -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=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=rm2us6OK; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230054AbiCVIuY (ORCPT + 99 others); Tue, 22 Mar 2022 04:50:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231308AbiCVIuW (ORCPT ); Tue, 22 Mar 2022 04:50:22 -0400 Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B37F6E540 for ; Tue, 22 Mar 2022 01:48:55 -0700 (PDT) Received: by mail-yb1-xb32.google.com with SMTP id g138so11982290ybf.5 for ; Tue, 22 Mar 2022 01:48:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QUKbEll3B3MyYDyon4P+rDcqkN3F18MECGrGkqKUuno=; b=rm2us6OKRLqK7uRSyjF58yCfkJFOuUQJ9OiT0aRPlGY+hdgxdLxevBebqmkYxi7Kvp dYYnA0yznikOIfcp94kmvCoHwd3eBaIBjlxJ5Ao8gBTwrcNcKI6+UrEemVYlvx+6/UVx xQVQLCPAuf2wJfSSvaL+r0brkUh5rLAurDIX9UxgFBAzX35pIb/O7NdcUgsovcWiJygc +F4Hmk9ymVELB1ruVF0OKDyHW3I9h6mok5rpFm1I/Rmx2oeIeTvKOXwH/USeLye/E6CX mVxSVtQpis0R05ccolu21RU+dA8oYht1hQDmNtryYzocmi033mHBJGcf8CtqqD9ukgUX BV2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QUKbEll3B3MyYDyon4P+rDcqkN3F18MECGrGkqKUuno=; b=cz9acXi9mz2//9fTBHVrUX2nXO7c8RJm2JfLZ0wBRY336FU/oUKQixINkM3IqmEaQC A5w1AwjfkWK/Cb0Pecm0PLLsojIYSjUcz3iAyaEi7pwmdtAhWQg4vbp7X8XJdZct7HdL bniPQyIovPEuhDhWjKm/7gcwdkDklP7pGVJ/ngIqNAp7Zg+w/W8KQjkJtLLJYzCIw9P1 qR7ItlY5zmHk/tyuQN/IZm7SkvoRqeRWtQMT4Ub9xV3aGxL/CHRYANBFKuh25xBblcyi ocTCNI8ALyeDvkkT3CbpygS9BM9sEx3Qz7GBeIWYGk7Z0rDejRBdcPv4po+TLjT+Nxc1 DcNw== X-Gm-Message-State: AOAM532U679mo5dwhhFw1CN5O9r+eO26Ql6wiDMu6QzKTjfH7Y9bbcf5 m9+3fjPaXO8JyLm8LsNuWdWXztBIl/dUt/MKkS+RIw== X-Received: by 2002:a25:8390:0:b0:629:2839:9269 with SMTP id t16-20020a258390000000b0062928399269mr25658972ybk.246.1647938934543; Tue, 22 Mar 2022 01:48:54 -0700 (PDT) MIME-Version: 1.0 References: <20220318074529.5261-1-songmuchun@bytedance.com> <20220318074529.5261-6-songmuchun@bytedance.com> In-Reply-To: From: Muchun Song Date: Tue, 22 Mar 2022 16:46:59 +0800 Message-ID: Subject: Re: [PATCH v5 5/6] dax: fix missing writeprotect the pte entry To: Christoph Hellwig Cc: Dan Williams , Matthew Wilcox , Jan Kara , Alexander Viro , Andrew Morton , Alistair Popple , Yang Shi , Ralph Campbell , Hugh Dickins , Xiyu Yang , "Kirill A. Shutemov" , Ross Zwisler , linux-fsdevel , Linux NVDIMM , LKML , Linux Memory Management List , Xiongchun duan , Muchun Song Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, 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 On Tue, Mar 22, 2022 at 4:37 PM Christoph Hellwig wrote: > > > +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? Good point. I'll fold dax_entry_mkclean() into the caller. > > Otherwise looks good: > > Reviewed-by: Christoph Hellwig Thanks.