Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3503366pxb; Mon, 24 Jan 2022 10:55:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJzH+o+cfhrzjFpUzp2WAZfUlp4J4uVyZzIgpk2+enW5gV0lKuO11M/Z8aIEFElNygQ2tcdu X-Received: by 2002:a17:90a:ead6:: with SMTP id ev22mr3297077pjb.10.1643050550924; Mon, 24 Jan 2022 10:55:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643050550; cv=none; d=google.com; s=arc-20160816; b=g/xq/CY5e8UZTd/6THSXrpsy0I1peZB3gE9z2hPofWMRF0pJu5XJLLmRzZH19EZ3AU zW6z8Kws51aTAz63GfVkp6fhaUixzLC9xD3LThnJvbnS9qE/zwentR7LbN/Z3cfJ03Vn wb7Qwia52i+elTQuWplBHtesZDjGJGDM2G0jX1aFXInsoFNBElOj9EUUuyjbqIxzHiNH rmQzWX8TfYXnDzv7uz/GmJw+U0Y1WEqwPKeejrp8SCq5P/cQjs5pi6Z23h7xgw7BJLPk //RQfo1RYREMVk47ogbT3jrZGJXNKA5/3hhhsxVsjp1lB8OJNdfgaDIDFGYajHQv5MbY BFZw== 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=Mo+uj8+53Ax7tIU91723WHax5XvtDO7oGefV09g/Eiw=; b=uE/WBtwSr+7FZscK+FUKBfIOxopmdO59zfg+NnZ+tu84+CvcXibwXfhcS/jLKV39sK +8YDgyisPfMDpDTMWsBd8bK38Aw7Z0/BV3g3BQmpHGn7FoDy4waEVzgPxKcmKKtLOvSQ WUqmSYW3LWeF/4SFSrne0gqNpcLofZ8T9xfEefAkmje9hGQU1R8mM9VcyDV4VsuvA9XA P+jSiWVB28ETTJd+XI04+tdOHj+A494m/hEie40BVjq93hNLSZdZH197Wj1T/gfVDoVI YLSTjAVGpKVXprq1zcmICrjbS2GvdkuEVdyFnXYOIjKlQx0HnimELxqj07smVfP6/EGk pIlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="Lag6Tc/V"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h24si5688389plr.265.2022.01.24.10.55.38; Mon, 24 Jan 2022 10:55:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="Lag6Tc/V"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S242575AbiAXJIW (ORCPT + 99 others); Mon, 24 Jan 2022 04:08:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242418AbiAXJIP (ORCPT ); Mon, 24 Jan 2022 04:08:15 -0500 Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D37DBC061401 for ; Mon, 24 Jan 2022 01:08:14 -0800 (PST) Received: by mail-yb1-xb33.google.com with SMTP id i62so2682023ybg.5 for ; Mon, 24 Jan 2022 01:08:14 -0800 (PST) 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=Mo+uj8+53Ax7tIU91723WHax5XvtDO7oGefV09g/Eiw=; b=Lag6Tc/VjcamDe0m5xYuMi0i4GEJpQqzDv2xv15qjoOeqbVWxK+nR+z87z3/Uds7yJ xVMZsrEWXOp0quH66zVcVy5D9zyeeMNJ8MBFrQnj3VltAmEoKjttsv3dlG98dSbynjqk PFnaOxWJQVmTUr0iugE5+mXiRzDIDnlGpq+Atf0UWF/05kXEtP98JOBc8mLU8YHEPRFF F4B6lwfKhGX8rPNJo3AwlCueRsN7Pt4RrmA0biTfkV0Baij7u6nDkDnXHHN+LcrqhAqH CShC3LlIw2tHICgexcSbDwofHLOvSY3OXjtQdxIIJaw/jzgvcxhEH1G/dQIPzOMr2C70 ai4w== 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=Mo+uj8+53Ax7tIU91723WHax5XvtDO7oGefV09g/Eiw=; b=SL2E/xcOnCA6wT3CKMvQcUwUnaCqX00o/vD81Zfs8os8l7EfoUvVT/qBxFvYsIGsZ3 47SWmPcU1AWROyVQ9obn3IrrlHlIyyt6kYgeHM4FeF51xu/nr4c9MyJ0mokTPrZtIFic b9fhxzdRpRo+acpFtfG09lWNddvSYQ4gNKBpj+z14vFGALH7bo8MwAX0YkDV8hL1/6YG kEl3PMoe4KTOMLsNOq/kAvZ4Dr3abmgagXjjZkRDNutvX4fFCpFTb0hMj/P/QzuwIB5V JRN14eGVnllALvNNPOvTRR+8A46Rpflr2Jt/TMxsdjF5kNxvGvK4PaTYpG9F6JMQErzp RGsw== X-Gm-Message-State: AOAM5324yAOkkFhQSvMLeO8mp2P0JbKpHqsSBDj0xf963sG17w/TE+Zs 2BaWsb6kw8VWe21ld2uoNSabWazIRB9KlbMVjM/3pw== X-Received: by 2002:a05:6902:100c:: with SMTP id w12mr6231737ybt.317.1643015294113; Mon, 24 Jan 2022 01:08:14 -0800 (PST) MIME-Version: 1.0 References: <20220121075515.79311-1-songmuchun@bytedance.com> <20220121075515.79311-4-songmuchun@bytedance.com> In-Reply-To: From: Muchun Song Date: Mon, 24 Jan 2022 17:07:38 +0800 Message-ID: Subject: Re: [PATCH 4/5] dax: fix missing writeprotect the pte entry To: Christoph Hellwig Cc: Dan Williams , Matthew Wilcox , Jan Kara , Alexander Viro , Andrew Morton , apopple@nvidia.com, Yang Shi , rcampbell@nvidia.com, Hugh Dickins , Xiyu Yang , "Kirill A. Shutemov" , zwisler@kernel.org, linux-fsdevel , nvdimm@lists.linux.dev, LKML , Linux Memory Management List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 24, 2022 at 3:41 PM Christoph Hellwig wrote: > > On Fri, Jan 21, 2022 at 03:55:14PM +0800, Muchun Song wrote: > > Reuse some infrastructure of page_mkclean_one() to let DAX can handle > > similar case to fix this issue. > > Can you split out some of the infrastructure changes into proper > well-documented preparation patches? Will do. I'll introduce page_vma_mkclean_one in a prepared patch and then fix the DAX issue in a separate patch. Thanks for your suggestions. > > > + pgoff_t pgoff_end = pgoff_start + npfn - 1; > > > > i_mmap_lock_read(mapping); > > - vma_interval_tree_foreach(vma, &mapping->i_mmap, index, index) { > > - struct mmu_notifier_range range; > > - unsigned long address; > > - > > + vma_interval_tree_foreach(vma, &mapping->i_mmap, pgoff_start, pgoff_end) { > > Please avoid the overly long lines here. Just using start and end > might be an easy option. > Will do. Thanks.