lkml.org 
[lkml]   [2003]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] dentry/inode accounting for vm_enough_mem()
Dave Hansen <haveblue@us.ibm.com> wrote:
>
> +void inode_dtor(void * objp, struct kmem_cache_s *cachep, unsigned long dflags)
> +{
> + atomic_dec(&inodes_stat.nr_alloced);
> }

This isn't called anywhere.

inodes are a problem, because their sizes differ, and because each
filesystem uses its own slab cache for them.

I'm wondering if it would not be better to modify slab to do this. For all
the inode caches and the dentry cache and the mb cache and that new
shrinkable cache which just got added to XFS, we can pass a new flag into
kmem_cache_create() which tells slab.c to account for this cache.

So then, in slab.c, it's just a matter of incrementing or decrementing a
global counter each time slab allocates or frees a page on behalf of a
thus-tagged cache. And simply read that counter in vm_enough_memory().



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.047 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site