From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 19 Jul 2018 11:13:24 +0200 From: Jan Kara To: Michal Hocko Cc: Dave Chinner , Andrew Morton , Matthew Wilcox , James Bottomley , Linus Torvalds , Waiman Long , Al Viro , Jonathan Corbet , "Luis R. Rodriguez" , Kees Cook , Linux Kernel Mailing List , linux-fsdevel , linux-mm , "open list:DOCUMENTATION" , Jan Kara , Paul McKenney , Ingo Molnar , Miklos Szeredi , Larry Woodman , "Wangkai (Kevin,C)" Subject: Re: [PATCH v6 0/7] fs/dcache: Track & limit # of negative dentries Message-ID: <20180719091324.ohattgzh53zlpi3p@quack2.suse.cz> References: <1531416080.18255.8.camel@HansenPartnership.com> <1531425435.18255.17.camel@HansenPartnership.com> <20180713003614.GW2234@dastard> <20180716090901.GG17280@dhcp22.suse.cz> <20180716124115.GA7072@bombadil.infradead.org> <20180716164032.94e13f765c5f33c6022eca38@linux-foundation.org> <20180717083326.GD16803@dhcp22.suse.cz> <20180719003329.GD19934@dastard> <20180719084538.GP7193@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180719084538.GP7193@dhcp22.suse.cz> Sender: owner-linux-mm@kvack.org List-ID: On Thu 19-07-18 10:45:38, Michal Hocko wrote: > On Thu 19-07-18 10:33:29, Dave Chinner wrote: > > > > and, apart from the external name thing (grr), that should address > > > > these fragmentation issues, no? I assume it's easy to ask slab how > > > > many pages are presently in use for a particular cache. > > > > > > I remember Dave Chinner had an idea how to age dcache pages to push > > > dentries with similar live time to the same page. Not sure what happened > > > to that. > > > > Same thing that happened to all the "select the dentries on this > > page for reclaim". i.e. it's referenced dentries that we can't > > reclaim or move that are the issue, not the reclaimable dentries on > > the page. > > > > Bsaically, without a hint at allocation time as to the expected life > > time of the dentry, we can't be smart about how we select partial > > pages to allocate from. And because we don't know at allocation time > > if the dentry is going to remain a negative dentry or not, we can't > > provide a hint about expected lifetime of teh object being > > allocated. > > Can we allocate a new dentry at the time when we know the life time or > the dentry pointer is so spread by that time that we cannot? It's difficult. We allocate dentry, put it in our structures, use it for synchronization e.g. of parallel lookups of the same name (so for that it is important that it is visible to everybody) and only after that we ask filesystem what does it have (if anything) under that name... So delaying allocation would mean overhauling the locking logic in the whole dcache. Honza -- Jan Kara SUSE Labs, CR