From: "Pekka J Enberg" <penberg@cs.helsinki.fi>
To: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Pekka Enberg <penberg@gmail.com>,
linux-kernel@vger.kernel.org,
v9fs-developer@lists.sourceforge.net,
viro@parcelfarce.linux.theplanet.co.uk,
linux-fsdevel@vger.kernel.org
Subject: Re: v9fs: VFS superblock operations (2.0-rc6)
Date: Wed, 25 May 2005 15:15:05 +0300 [thread overview]
Message-ID: <courier.42946C49.00007170@courier.cs.helsinki.fi> (raw)
In-Reply-To: <a4e6962a0505250455605faec9@mail.gmail.com>
Hi,
On Wed, 2005-05-25 at 06:55 -0500, Eric Van Hensbergen wrote:
> Well, I'm not using slabs as a custom allocator just to track leaks.
> I'm using them for two specific structures which end up getting
> allocated and freed quite often (which is what I thought slab
> allocators were for). The two structures I'm slab allocating are the
> directory structure (which has a fixed size), and the packet structure
> (which has a fixed size per session, and may grow or shrink based on
> protocol negotiation/command-line options). I use the find_slab
> routine to see if there is a slab (that I created) that already
> matches the protocol negotiated size so I don't create a
> slab-per-session unnecessarily.
>
> Is this not the right way to use slabs? Should I just be using
> kmalloc/kcalloc? (Is that what you mean by drop the custom allocator?)
You can create your own slab for known fixed-size objects (your
directory structure). Look at other filesystems for an example. They
usually create a cache for their inode_info structs.
The problem with your approach on packet structure slab is that we
potentially get slabs with little or no activity. You would have to
write custom code to tear down unused slabs but now you've got something
that clearly does not belong in filesystem code. So yes, I think you'd
be better of using kmalloc()/kcalloc() for your packet structures.
Pekka
next prev parent reply other threads:[~2005-05-25 12:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-23 22:25 [RFC][patch 4/7] v9fs: VFS superblock operations (2.0-rc6) ericvh
2005-05-24 7:11 ` Pekka Enberg
2005-05-24 19:08 ` Eric Van Hensbergen
2005-05-25 4:54 ` Pekka Enberg
2005-05-25 11:55 ` Eric Van Hensbergen
2005-05-25 12:15 ` Pekka J Enberg [this message]
2005-05-25 14:41 ` Eric Van Hensbergen
2005-05-25 5:17 ` [RFC][patch 4/7] " Pekka Enberg
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=courier.42946C49.00007170@courier.cs.helsinki.fi \
--to=penberg@cs.helsinki.fi \
--cc=ericvh@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@gmail.com \
--cc=v9fs-developer@lists.sourceforge.net \
--cc=viro@parcelfarce.linux.theplanet.co.uk \
/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;
as well as URLs for NNTP newsgroup(s).