Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1126971ybb; Wed, 8 Apr 2020 17:22:22 -0700 (PDT) X-Google-Smtp-Source: APiQypIPeW34Ja/WXa6He5+rIYkw/35F1ITMVUbXZ7VX/EO9j8aoG8BKs2QbSZsO7OvZUyWF7MkR X-Received: by 2002:a9d:6c94:: with SMTP id c20mr8180581otr.49.1586391742260; Wed, 08 Apr 2020 17:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586391742; cv=none; d=google.com; s=arc-20160816; b=PJYD1QLScfvlrisBuKpLO1Anp0wCcz/zgwGBTpSb8knIHhfac3d2vc3mWHqEZei9yX LPU/Nyyp+ixL79wOYTUapxK1M5x2ysc2sQSqZbTCf/mtSGlBOEkP48WWGPygLuEUGtdM bj3QLABXkZ43NSvXJi+ARC+qPIsMmQwtbo0yU0lIrf//xyPH2Kz2JNHulauxZRFi8Jxk OyWW8F0LVkqEG1YjVegG1CLKdjjy2hl7sUA/q/gdSb+Md7Vg6nSTRAEQnHe8rv3Igloc iNsCwZ1FY2AO6xEY2KFJQPO1IXOBv98NG0NhkG8/ZDx70t8YSnJWXc9tHDd05Jx+SXY3 Xs+A== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=ycIKO8BF7NWHZgDeN44ioDaEKHFakbaZDoY/rHERVF0=; b=ZOq20bVniKPZEtG/rCFwWz4Vb32VwrVJhLonSqHWakdoHiY9GgXvpyAc8yNCzmog0R jCdbn1lKZkVm//ctFFxiErB1xeXFL/HbbOjRRXZLBXZIn+yhuULjXmnQxF637OibqtD6 wU3HS274c4kiRC12TiFtxrPNAudO1n9otDAwKtCykcvs7b32vsjvkUH+rmZQXYaN3uVy UXWV/Yga2qIwF+mXpl0Nc1kVEDgKWCx5NcuLSZnR3qvB401b4Fp4GhqbAEbg0Z0bv2ce 9waQeRY8yFzXjAuhapJNUIULlQtWpfyaJFvAyvS/iseF2ux/UiTkjycJZC7u6PvbJtdR wsXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9si920344otr.238.2020.04.08.17.22.06; Wed, 08 Apr 2020 17:22:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726534AbgDIAWE (ORCPT + 99 others); Wed, 8 Apr 2020 20:22:04 -0400 Received: from mga05.intel.com ([192.55.52.43]:31348 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726508AbgDIAWE (ORCPT ); Wed, 8 Apr 2020 20:22:04 -0400 IronPort-SDR: y3GGlKUdTIrtflzcvc7g+gNoPgcIjFjbdBj28t4XMTscClC1uDryBUwBUacq05ag5XAEIuAE5B u9SSw/H/7krw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2020 17:22:04 -0700 IronPort-SDR: LoRxrN0v7Yij4I1aWo1Li88CuPwBtFEWvt42QBqLJwvvc/HLMBKCHYdxQQFi/aS4KtY8m6ul9y /w19/tI52P/Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,360,1580803200"; d="scan'208";a="398377351" Received: from iweiny-desk2.sc.intel.com ([10.3.52.147]) by orsmga004.jf.intel.com with ESMTP; 08 Apr 2020 17:22:03 -0700 Date: Wed, 8 Apr 2020 17:22:03 -0700 From: Ira Weiny To: Dave Chinner , Jan Kara , Christoph Hellwig Cc: Dan Williams , Linux Kernel Mailing List , "Darrick J. Wong" , Christoph Hellwig , "Theodore Y. Ts'o" , Jan Kara , Jeff Moyer , linux-ext4 , linux-xfs , linux-fsdevel Subject: Re: [PATCH V6 6/8] fs/xfs: Combine xfs_diflags_to_linux() and xfs_diflags_to_iflags() Message-ID: <20200409002203.GE664132@iweiny-DESK2.sc.intel.com> References: <20200407182958.568475-1-ira.weiny@intel.com> <20200407182958.568475-7-ira.weiny@intel.com> <20200408020827.GI24067@dread.disaster.area> <20200408170923.GC569068@iweiny-DESK2.sc.intel.com> <20200408210236.GK24067@dread.disaster.area> <20200408235836.GQ24067@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200408235836.GQ24067@dread.disaster.area> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Apr 09, 2020 at 09:58:36AM +1000, Dave Chinner wrote: > On Wed, Apr 08, 2020 at 02:28:30PM -0700, Dan Williams wrote: > > On Wed, Apr 8, 2020 at 2:02 PM Dave Chinner wrote: > > > THis leads to an obvious conclusion: if we never clear the in memory > > > S_DAX flag, we can actually clear the on-disk flag safely, so that > > > next time the inode cycles into memory it won't be using DAX. IOWs, > > > admins can stop the applications, clear the DAX flag and drop > > > caches. This should result in the inode being recycled and when the > > > app is restarted it will run without DAX. No ned for deleting files, > > > copying large data sets, etc just to turn off an inode flag. > > > > Makes sense, but is that sufficient? I recall you saying there might > > be a multitude of other reasons that the inode is not evicted, not the > > least of which is races [1]. Does this need another flag, lets call it > > "dax toggle" to track the "I requested the inode to clear the flag, > > but on cache-flush + restart the inode never got evicted" case. > > You mean something like XFS_IDONTCACHE? > > i.e. the functionality already exists in XFS to selectively evict an > inode from cache when the last reference to it is dropped rather > than let it go to the LRUs and hang around in memory. > > That flag can be set when changing the on disk DAX flag, and we can > tweak how it works so new cache hits don't clear it (as happens > now). Hence the only thing that can prevent eviction are active > references. > > That means we'll still need to stop the application and drop_caches, > because we need to close all the files and purge the dentries that > hold references to the inode before it can be evicted. That sounds like a great idea... Jan? Christoph? I will reiterate though that any delayed S_DAX change be done as a follow on series to the one proposed here. Ira