Return-Path: Received: from ipmail06.adl6.internode.on.net ([150.101.137.145]:36979 "EHLO ipmail06.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752570AbcD3AYa (ORCPT ); Fri, 29 Apr 2016 20:24:30 -0400 Date: Sat, 30 Apr 2016 10:24:18 +1000 From: Dave Chinner To: Michal Hocko Cc: NeilBrown , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Andrew Morton , "Theodore Ts'o" , Chris Mason , Jan Kara , ceph-devel@vger.kernel.org, cluster-devel@redhat.com, linux-nfs@vger.kernel.org, logfs@logfs.org, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-mtd@lists.infradead.org, reiserfs-devel@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, linux-f2fs-devel@lists.sourceforge.net, linux-afs@lists.infradead.org, LKML Subject: Re: [PATCH 0/2] scop GFP_NOFS api Message-ID: <20160430002418.GP26977@dastard> References: <1461671772-1269-1-git-send-email-mhocko@kernel.org> <8737q5ugcx.fsf@notabene.neil.brown.name> <20160429120418.GK21977@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20160429120418.GK21977@dhcp22.suse.cz> Sender: linux-nfs-owner@vger.kernel.org List-ID: On Fri, Apr 29, 2016 at 02:04:18PM +0200, Michal Hocko wrote: > I would also like to revisit generic inode/dentry shrinker and see > whether it could be more __GFP_FS friendly. As you say many FS might > even not depend on some FS internal locks so pushing GFP_FS check down > the layers might make a lot of sense and allow to clean some [id]cache > even for __GFP_FS context. That's precisely my point about passing a context to the shrinker. It's recursion within a single superblock context that makes up the majority of cases GFP_NOFS is used for, so passing the superblock immediately allows for reclaim to run the superblock shrinker on every other superblock. We can refine it further from there, but I strongly suspect that further refinement is going to require filesystems to specifically configure the superblock shrinker. e.g. in XFS, we can't allow evict() even on clean VFS inodes in a PF_FSTRANS context, because we may run a transaction on a clean VFS inode to prepare it for reclaim. We can, however, allow the fs-specific shrinker callouts to run (i.e. call into .free_cached_objects) so that it can reclaim clean XFS inodes because that doesn't require transactions.... i.e. the infrastructure I suggested we use is aimed directly at providing the mechanism required for finer-grained inode/dentry cache reclaim in contexts that it is currently disallowed completely. I was also implying that once the infrastructure to pass contexts is in place, I'd then make the changes to the generic superblock shrinker code to enable finer grained reclaim and optimise the XFS shrinkers to make use of it... Cheers, Dave. -- Dave Chinner david@fromorbit.com