Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1020815pxb; Thu, 26 Aug 2021 22:28:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykDA/hPC2NlTzRwhA0B7SlY4nf087TYE5XQcqzyyIzJT7u6Bo4EfiqBwbldRkyVDiGHK98 X-Received: by 2002:a17:906:af9a:: with SMTP id mj26mr7881607ejb.96.1630042131769; Thu, 26 Aug 2021 22:28:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630042131; cv=none; d=google.com; s=arc-20160816; b=q72csNquav/mzZGD5ZV7t2zt7k8yL0yycTRjYi7vgTfS7gj2fbddQozxGsxcs6EZWl dqK/xs+fs2aTM1Lh2xm7hIWb9M+rkE46o6w/+Hq4Rn4VjqXnUldnAlIWCf8+kuMDZGQp 38kfEkKhjDYlv+wVU5rnmNtL6a4BZk8M+ZnJNArOWE7fS0tMF3B1Zxk+w95TV1UL/0uX GOHzkekfrqZceCFLfaia1IXnIxeQ3kwHR3sD02VgTrZUuwopfAVW/+S72mrSWb9oGiuj irlDqYvCZbUaZ6xG3Sjg7wosQsosr9nUtMUtil52XfOJonecS80Em1GI2c36z/YSkSIB tHgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject:ironport-hdrordr; bh=ACDcgmom3AjuEFf5ChBsYuGjlNBzExSEeVejwvdn3sA=; b=ujliitvNovuXYHB1VTmJbVf/8UWp2P0FIAP7+PJvlSYicEKAziLbeSbrGP8cY/9yDL ZKiapyS48w6p75pkDnSEBJcv8HNiN4ZV80J735hQ1S16U6Z6+n2FsY4Cn6+LXs/YFtL3 LJlnRxgAVxlGrBEZyB2x9czIs92IFzfWXKpVM6e1NUXOURLo5l3JxIHKqv9jgAtawNx1 vN0hRB0oHJ5QmEzGMjAaNd0NQPKQPYnX6w9E81bR20Qegm3Y4PKSLsyvWYI17McrYJ/t vxEQOpjMLoHRU9O1E79zz6StuSVyqH9Qx4GBsS20Gof7pT0l43JViIv4SpbIg8QEuuWU sITw== ARC-Authentication-Results: i=1; mx.google.com; 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=fujitsu.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id yr5si4785493ejb.442.2021.08.26.22.28.28; Thu, 26 Aug 2021 22:28:51 -0700 (PDT) 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; 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=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244191AbhH0F1h (ORCPT + 99 others); Fri, 27 Aug 2021 01:27:37 -0400 Received: from mail.cn.fujitsu.com ([183.91.158.132]:7098 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229645AbhH0F1g (ORCPT ); Fri, 27 Aug 2021 01:27:36 -0400 IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AytThfqsqpwTceRZEfg/WGsuq7skDStV00zEX?= =?us-ascii?q?/kB9WHVpm62j5qSTdZEguCMc5wx+ZJheo7q90cW7IE80lqQFhLX5X43SPzUO0V?= =?us-ascii?q?HARO5fBODZsl/d8kPFltJ15ONJdqhSLJnKB0FmsMCS2mKFOudl7N6Z0K3Av4vj?= =?us-ascii?q?80s=3D?= X-IronPort-AV: E=Sophos;i="5.84,355,1620662400"; d="scan'208";a="113551348" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 27 Aug 2021 13:26:46 +0800 Received: from G08CNEXMBPEKD04.g08.fujitsu.local (unknown [10.167.33.201]) by cn.fujitsu.com (Postfix) with ESMTP id D933F4D0D9CF; Fri, 27 Aug 2021 13:26:42 +0800 (CST) Received: from G08CNEXCHPEKD09.g08.fujitsu.local (10.167.33.85) by G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 27 Aug 2021 13:26:43 +0800 Received: from [192.168.22.65] (10.167.225.141) by G08CNEXCHPEKD09.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.23 via Frontend Transport; Fri, 27 Aug 2021 13:26:41 +0800 Subject: Re: [PATCH v7 3/8] fsdax: Replace mmap entry in case of CoW To: Dan Williams CC: Christoph Hellwig , "Darrick J. Wong" , linux-xfs , david , linux-fsdevel , Linux Kernel Mailing List , Linux NVDIMM , Goldwyn Rodrigues , Al Viro , Matthew Wilcox , Goldwyn Rodrigues , Ritesh Harjani References: <20210816060359.1442450-1-ruansy.fnst@fujitsu.com> <20210816060359.1442450-4-ruansy.fnst@fujitsu.com> <20210823125715.GA15536@lst.de> From: Shiyang Ruan Message-ID: <6e86fe6e-fcbb-908c-11a4-4c322199bc5e@fujitsu.com> Date: Fri, 27 Aug 2021 13:26:41 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-yoursite-MailScanner-ID: D933F4D0D9CF.A1623 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: ruansy.fnst@fujitsu.com X-Spam-Status: No Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/8/27 13:00, Dan Williams wrote: > On Thu, Aug 26, 2021 at 8:22 PM Shiyang Ruan wrote: >> >> >> >> On 2021/8/23 20:57, Christoph Hellwig wrote: >>> On Thu, Aug 19, 2021 at 03:54:01PM -0700, Dan Williams wrote: >>>> >>>> static void *dax_insert_entry(struct xa_state *xas, struct vm_fault *vmf, >>>> const struct iomap_iter *iter, void >>>> *entry, pfn_t pfn, >>>> unsigned long flags) >>>> >>>> >>>>> { >>>>> + struct address_space *mapping = vmf->vma->vm_file->f_mapping; >>>>> void *new_entry = dax_make_entry(pfn, flags); >>>>> + bool dirty = insert_flags & DAX_IF_DIRTY; >>>>> + bool cow = insert_flags & DAX_IF_COW; >>>> >>>> ...and then calculate these flags from the source data. I'm just >>>> reacting to "yet more flags". >>> >>> Except for the overly long line above that seems like a good idea. >>> The iomap_iter didn't exist for most of the time this patch has been >>> around. >>> >> >> So should I reuse the iter->flags to pass the insert_flags? (left shift >> it to higher bits) > > No, the advice is to just pass the @iter to dax_insert_entry directly > and calculate @dirty and @cow internally. > I see. Yes, they can be calculated inside the dax_insert_entry() because it already has enough arguments. -- Thanks, Ruan.