Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1035512yba; Thu, 4 Apr 2019 02:57:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZn44iiviKCGeNTSES6JV7DS/lV32+50Jjg8pr00v5eJn7JdKwgvXcL+HQ8vErSCUpxjI4 X-Received: by 2002:a17:902:2aca:: with SMTP id j68mr5294936plb.233.1554371877116; Thu, 04 Apr 2019 02:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554371877; cv=none; d=google.com; s=arc-20160816; b=u67Z7ClZcySuyThU+ndBoc3yDW3mnAVrMp/lhCAAwixUdoNcoIzATB7xUh1KeWKJju 2fpBNeZ0jiGpmSmd3Pz5V88Zii2Z7uat3I9yPW9pt2N4vJLI23GFbm8RyESLR0EFD4Ue +odl+7piS94dvgaPSCJREge8hjWh3FZnfR0LLBz6/q2ytzTuuaL2NbTu3EDpFFJA5HnG kunHzJ/zG2hVL1sAWvzLwx8+Zjy9o+BAuO2/nAnluKlq9ClzV3C6vZfir0Rl6S/Os01C emxsbWyYSxCMawZi3rbf155foYn5WMwbPqPMDcftx+1WrjytM9/Z0LCttsdwKbdl2iiD zoHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=WH1oy88b3/VSZ77x03pLR/FCnrjwJ9EPmCr12Uo9n10=; b=GfK87+jtiH3IYZylZX1hD6E+MtLSfMDb6xzWdcANdSWt6Hx0IyX+/e0Qb/EKpsmVKO /dLtWA03773+/a46C6qWmi3vPNzWy8gZRrPx8YW7XLaFQ/9Si+MNAv2TYiwsWSeeaGka YPhdbs0b+PS8shvNz+EmkZye0S2nRiTP0NW+1fhBLxUu3CTAMcBWknVLQ7dgvuznZ3hj 01PNHkpOET6F49tpvyNAWvXws60IH6O7L/eqHz1DaS3gNwUkJUo4C38xOp3Bm2SLN9rQ X5Ammgo89rJBXjBPGgmPKlZg9Hl37LV19VedVTb4LZSBvmFqX4az0iEt73d7ioxMsSCT 96dw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3si15739640pfa.239.2019.04.04.02.57.41; Thu, 04 Apr 2019 02:57:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729559AbfDDJ5L (ORCPT + 99 others); Thu, 4 Apr 2019 05:57:11 -0400 Received: from tartarus.angband.pl ([54.37.238.230]:60640 "EHLO tartarus.angband.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728040AbfDDJ5J (ORCPT ); Thu, 4 Apr 2019 05:57:09 -0400 Received: from kilobyte by tartarus.angband.pl with local (Exim 4.92) (envelope-from ) id 1hBz73-0003Sa-AG; Thu, 04 Apr 2019 11:56:49 +0200 Date: Thu, 4 Apr 2019 11:56:49 +0200 From: Adam Borowski To: Pankaj Gupta Cc: Dave Chinner , darrick wong , linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, kvm@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-acpi@vger.kernel.org, qemu-devel@nongnu.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, dan j williams , zwisler@kernel.org, vishal l verma , dave jiang , mst@redhat.com, jasowang@redhat.com, willy@infradead.org, rjw@rjwysocki.net, hch@infradead.org, lenb@kernel.org, jack@suse.cz, tytso@mit.edu, adilger kernel , lcapitulino@redhat.com, kwolf@redhat.com, imammedo@redhat.com, jmoyer@redhat.com, nilal@redhat.com, riel@surriel.com, stefanha@redhat.com, aarcange@redhat.com, david@redhat.com, cohuck@redhat.com, xiaoguangrong eric Subject: Re: [PATCH v4 5/5] xfs: disable map_sync for async flush Message-ID: <20190404095649.GB8738@angband.pl> References: <20190403104018.23947-1-pagupta@redhat.com> <20190403104018.23947-6-pagupta@redhat.com> <20190403220912.GB26298@dastard> <1518295599.17367903.1554358350929.JavaMail.zimbra@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1518295599.17367903.1554358350929.JavaMail.zimbra@redhat.com> X-Junkbait: aaron@angband.pl, zzyx@angband.pl User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: kilobyte@angband.pl X-SA-Exim-Scanned: No (on tartarus.angband.pl); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 04, 2019 at 02:12:30AM -0400, Pankaj Gupta wrote: > > All this ad hoc IS_DAX conditional logic is getting pretty nasty. > > > > xfs_file_mmap( > > .... > > { > > struct inode *inode = file_inode(filp); > > > > if (vma->vm_flags & VM_SYNC) { > > if (!IS_DAX(inode)) > > return -EOPNOTSUPP; > > if (!dax_synchronous(xfs_find_daxdev_for_inode(inode)) > > return -EOPNOTSUPP; > > } > > > > file_accessed(filp); > > vma->vm_ops = &xfs_file_vm_ops; > > if (IS_DAX(inode)) > > vma->vm_flags |= VM_HUGEPAGE; > > return 0; > > } > > Sure, this is better. > > Even better, factor out all the "MAP_SYNC supported" checks into a > > helper so that the filesystem code just doesn't have to care about > > the details of checking for DAX+MAP_SYNC support.... > > o.k. Will add one common helper function for both ext4 & xfs filesystems. Note this pending patch for Goldwyn Rodrigues' patchset for btrfs: https://lore.kernel.org/linux-btrfs/20190328102418.5466-1-kilobyte@angband.pl/ We might want to coordinate. Meow! -- ⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Did ya know that typing "test -j8" instead of "ctest -j8" ⢿⡄⠘⠷⠚⠋⠀ will make your testsuite pass much faster, and fix bugs? ⠈⠳⣄⠀⠀⠀⠀