Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

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

 



On Fri 13-04-18 22:35:19, Minchan Kim wrote:
> On Mon, Mar 05, 2018 at 01:37:43PM +0000, Roman Gushchin wrote:
[...]
> > @@ -1614,9 +1623,11 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
> >  		name = &slash_name;
> >  		dname = dentry->d_iname;
> >  	} else if (name->len > DNAME_INLINE_LEN-1) {
> > -		size_t size = offsetof(struct external_name, name[1]);
> > -		struct external_name *p = kmalloc(size + name->len,
> > -						  GFP_KERNEL_ACCOUNT);
> > +		struct external_name *p;
> > +
> > +		reclaimable = offsetof(struct external_name, name[1]) +
> > +			name->len;
> > +		p = kmalloc(reclaimable, GFP_KERNEL_ACCOUNT);
> 
> Can't we use kmem_cache_alloc with own cache created with SLAB_RECLAIM_ACCOUNT
> if they are reclaimable? 

No, because names have different sizes and so we would basically have to
duplicate many caches.
-- 
Michal Hocko
SUSE Labs



[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