From: Benjamin Gilbert <bgilbert@cs.cmu.edu>
To: danms@us.ibm.com
Cc: dm-devel@redhat.com, Niraj Tolia <ntolia@cmu.edu>
Subject: dm-userspace memory consumption in remap cache
Date: Fri, 25 Aug 2006 14:13:25 -0400 [thread overview]
Message-ID: <44EF3DC5.2040403@cs.cmu.edu> (raw)
Hi Dan,
I've been playing with a program which uses the libdmu/libdevmapper
interface to map a block device through dm-userspace. (I haven't been
using cowd; I'm looking to integrate dmu support into an existing program.)
I noticed that after I wrote 1 GB of data to a dmu device with a 4 KB
blocksize, the dm-userspace-remaps slab cache consumed about 39 MB of
memory. Looking at alloc_remap_atomic(), dmu makes no attempt to reuse
dmu_maps until a memory allocation fails, so that potentially dmu could
force a large amount of data out of the page cache to make room for its map.
I've considered some workarounds from the userspace side, but they all
seem fairly suboptimal:
1. Periodically invalidate the entire table. When cowd does this right
now (on SIGHUP), it invalidates each page individually, which is not
very pleasant. I suppose this could be done by loading a new dm table.
2. Periodically trigger block invalidations from userspace, fired by
either the completion notification mechanism or a periodic timer.
Userspace couldn't do this in an LRU fashion, since it doesn't see remap
cache hits.
(As an aside, I haven't been able to figure out the semantics of the
completion notification mechanism. Could you provide an example of how
you expect it to be used from the userspace side?)
3. Map in dm-linear when there are large consecutive ranges, to try to
keep the table size down. Some of the early dm-cow design notes
mentioned this approach*, but I notice that the current cowd doesn't use
it. Is this still a recommended procedure?
From the kernel side -- if the remap cache in the kernel is expected to
be a subset of the mapping information maintained by userspace, it seems
as though it should be possible to more aggressively reuse the LRU
dmu_maps. That would impose a performance penalty for the extra map
requests to userspace, but I wonder how that balances against having a
larger page cache.
Thoughts?
Thanks
--Benjamin Gilbert
* http://www.redhat.com/archives/dm-devel/2006-March/msg00013.html
next reply other threads:[~2006-08-25 18:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-25 18:13 Benjamin Gilbert [this message]
2006-08-25 18:43 ` dm-userspace memory consumption in remap cache Dan Smith
2006-08-25 19:32 ` Benjamin Gilbert
2006-08-25 19:40 ` Dan Smith
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=44EF3DC5.2040403@cs.cmu.edu \
--to=bgilbert@cs.cmu.edu \
--cc=danms@us.ibm.com \
--cc=dm-devel@redhat.com \
--cc=ntolia@cmu.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.