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 X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BF6FC432BE for ; Fri, 27 Aug 2021 05:26:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6CAD860F45 for ; Fri, 27 Aug 2021 05:26:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244175AbhH0F1g (ORCPT ); Fri, 27 Aug 2021 01:27:36 -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 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@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.