From: Brice Goglin <Brice.Goglin@inria.fr>
To: Roland Dreier <rdreier@cisco.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, jsquyres@cisco.com,
rostedt@goodmis.org
Subject: Re: [PATCH v3] ummunotify: Userspace support for MMU notifications
Date: Sun, 02 Aug 2009 21:59:09 +0200 [thread overview]
Message-ID: <4A75F00D.7010400@inria.fr> (raw)
In-Reply-To: <adaskgcptsz.fsf_-_@cisco.com>
Roland Dreier wrote:
> As discussed in <http://article.gmane.org/gmane.linux.drivers.openib/61925>
> and follow-up messages, libraries using RDMA would like to track
> precisely when application code changes memory mapping via free(),
> munmap(), etc. Current pure-userspace solutions using malloc hooks
> and other tricks are not robust, and the feeling among experts is that
> the issue is unfixable without kernel help.
>
> We solve this not by implementing the full API proposed in the email
> linked above but rather with a simpler and more generic interface,
> which may be useful in other contexts. Specifically, we implement a
> new character device driver, ummunotify, that creates a /dev/ummunotify
> node. A userspace process can open this node read-only and use the fd
> as follows:
>
> 1. ioctl() to register/unregister an address range to watch in the
> kernel (cf struct ummunotify_register_ioctl in <linux/ummunotify.h>).
>
> 2. read() to retrieve events generated when a mapping in a watched
> address range is invalidated (cf struct ummunotify_event in
> <linux/ummunotify.h>). select()/poll()/epoll() and SIGIO are
> handled for this IO.
>
Hello Roland,
I like the interface but I have a couple questions:
1) Why does userspace have to register these address ranges? I would
have just reported all invalidation evens and let user-space check which
ones are interesting. My feeling is that the number of invalidation
events will usually be lower than the number registered ranges, so
you'll report more events through the file descriptor, but userspace
will do a lot less ioctls.
2) What happens in case of fork? If father+child keep reading from the
previously-open /dev/ummunotify, each event will be delivered only to
the first reader, right? Fork is always a mess in HPC, but maybe there's
something to do here.
3) What's userspace supposed to do if 2 libraries need such events in
the same process? Should each of them open /dev/ummunotify separately?
Doesn't matter much for performance, just wondering.
thanks,
Brice
next prev parent reply other threads:[~2009-08-02 20:08 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-22 17:47 [PATCH/RFC] ummunot: Userspace support for MMU notifications Roland Dreier
2009-07-22 18:15 ` Andrew Morton
2009-07-22 19:27 ` Roland Dreier
2009-07-22 19:42 ` Andrew Morton
2009-07-23 2:26 ` Steven Rostedt
2009-07-23 20:21 ` Roland Dreier
2009-07-24 0:25 ` Steven Rostedt
2009-07-24 22:56 ` [PATCH v2] ummunotify: " Roland Dreier
2009-07-27 23:53 ` Andrew Morton
2009-07-28 16:14 ` Roland Dreier
2009-07-31 18:54 ` [PATCH v3] " Roland Dreier
2009-08-02 19:59 ` Brice Goglin [this message]
2009-08-03 4:55 ` Roland Dreier
2009-08-03 6:57 ` Brice Goglin
2009-08-04 17:14 ` Roland Dreier
2009-07-23 9:04 ` [PATCH/RFC] ummunot: " Li Zefan
2009-07-23 20:28 ` Roland Dreier
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=4A75F00D.7010400@inria.fr \
--to=brice.goglin@inria.fr \
--cc=akpm@linux-foundation.org \
--cc=jsquyres@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rdreier@cisco.com \
--cc=rostedt@goodmis.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