From: Andrew Morton <akpm@digeo.com>
To: Dave Hansen <haveblue@us.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dentry/inode accounting for vm_enough_mem()
Date: Tue, 20 May 2003 03:08:24 -0700 [thread overview]
Message-ID: <20030520030824.39235b00.akpm@digeo.com> (raw)
In-Reply-To: <1053391863.12309.2.camel@nighthawk>
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().
prev parent reply other threads:[~2003-05-20 9:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-20 0:51 Dave Hansen
2003-05-20 9:27 ` Andrew Morton
2003-05-20 10:08 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030520030824.39235b00.akpm@digeo.com \
--to=akpm@digeo.com \
--cc=haveblue@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®