Re: [patch 2/5] mm + fs: prepare for non-page entries in page cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 1 May 2012 22:15:04 +0200
Johannes Weiner <hannes@xxxxxxxxxxx> wrote:

> On Tue, May 01, 2012 at 12:02:46PM -0700, Andrew Morton wrote:
> > On Tue,  1 May 2012 10:41:50 +0200
> > Johannes Weiner <hannes@xxxxxxxxxxx> wrote:
> > 
> > > --- a/fs/inode.c
> > > +++ b/fs/inode.c
> > > @@ -544,8 +544,7 @@ static void evict(struct inode *inode)
> > >  	if (op->evict_inode) {
> > >  		op->evict_inode(inode);
> > >  	} else {
> > > -		if (inode->i_data.nrpages)
> > > -			truncate_inode_pages(&inode->i_data, 0);
> > > +		truncate_inode_pages(&inode->i_data, 0);
> > 
> > Why did we lose this optimisation?
> 
> For inodes with only shadow pages remaining in the tree, because there
> is no separate counter for them.  Otherwise, we'd leak the tree nodes.
> 
> I had mapping->nrshadows at first to keep truncation conditional, but
> thought that using an extra word per cached inode would be worse than
> removing this optimization.  There is not too much being done when the
> tree is empty.
> 
> Another solution would be to include the shadows count in ->nrpages,
> but filesystems use this counter for various other purposes.
> 
> Do you think it's worth reconsidering?

It doesn't sound like it's worth adding ->nrshadows for only that
reason.

That's a pretty significant alteration in the meaning of ->nrpages. 
Did this not have any other effects?

What does truncate do?  I assume it invalidates shadow page entries in
the radix tree?  And frees the radix-tree nodes?

The patchset will make lookups slower in some (probably obscure)
circumstances, due to the additional radix-tree nodes.

I assume that if a pagecache lookup encounters a radix-tree node which
contains no real pages, the search will terminate at that point?  We
don't pointlessly go all the way down to the leaf nodes?

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux