From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Pavel Machek <pavel@ucw.cz>
Cc: Roland Dreier <rdreier@cisco.com>,
linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
general@lists.openfabrics.org, akpm@linux-foundation.org,
torvalds@linux-foundation.org
Subject: Re: [ofa-general] Re: [GIT PULL] please pull ummunotify
Date: Mon, 28 Sep 2009 15:40:57 -0600 [thread overview]
Message-ID: <20090928214057.GX19540@obsidianresearch.com> (raw)
In-Reply-To: <20090928204923.GA1960@elf.ucw.cz>
On Mon, Sep 28, 2009 at 10:49:23PM +0200, Pavel Machek wrote:
> > > I don't remember seeing discussion of this on lkml. Yes it is in
> > > -next...
> >
> > eg http://lkml.org/lkml/2009/7/31/197 and followups, or search for v2
> > and earlier patches.
> Well... it seems little overspecialized. Just modifying libc to
> provide hooks you want looks like better solution.
That is what MPI people are doing today and their feedback is that it
doesn't work - there are a lot of ways to mess with memory and no good
choices to hook the raw syscalls and keep sensible performance.
The main focus of this is high performance MPI apps, so lower overhead
on critical paths like memory allocation is part of the point. It is
ment to go hand-in-hand with the specialized RDMA memory pinning
interfaces..
> > > Basically it allows app to 'trace itself'? ...with interesting mmap()
> > > interface, exporting int to userspace, hoping it behaves atomically...?
> >
> > Yes, it allows app to trace what the kernel does to memory mappings. I
> > don't believe there's any real issue to atomicity of mmap'ed memory,
> > since userspace really just tests whether read value is == to old read
> > value or not.
>
> That still needs memory barriers etc.. to ensure reliable operation,
> no?
No, I don't think so..
The application is expected to provide sequencing of some sort between
the memory call (mmap/munmap/brk/etc) and the int check - usually just
by running in the same thread, or through some kind of locking scheme.
As long as the mmu notifiers run immediately in the same context as
the mmap/etc then it should be fine.
For example, the most common problem to solve looks like this:
x = mmap(...)
do RDMA with x
[..]
mmunmap(x);
[..]
y = mmap(..);
do RDMA with y
if by chance x == y things explode.
So this API puts the int test directly before 'do RDMA with'.
Due to the above kind of argument the net requirement is either to
completely synchronously (and with low overhead) hook every
mmap/munmap/brk/etc call into the kernel and do the accounting work,
or have a very low over head check every time the memory region is
about to be used.
Jason
next prev parent reply other threads:[~2009-09-28 21:40 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-11 4:38 [GIT PULL] please pull ummunotify Roland Dreier
2009-09-11 5:56 ` KOSAKI Motohiro
2009-09-11 6:03 ` Roland Dreier
2009-09-11 6:11 ` KOSAKI Motohiro
2009-09-11 16:42 ` Gleb Natapov
2009-09-11 6:15 ` Brice Goglin
2009-09-11 6:21 ` KOSAKI Motohiro
2009-09-11 6:22 ` Roland Dreier
2009-09-11 6:40 ` [ofa-general] " Jason Gunthorpe
2009-09-11 16:58 ` Roland Dreier
2009-09-15 7:03 ` KOSAKI Motohiro
2009-09-15 8:27 ` Roland Dreier
2009-09-15 12:38 ` Jeff Squyres
2009-09-15 11:34 ` Pavel Machek
2009-09-15 14:57 ` [ofa-general] " Roland Dreier
2009-09-28 20:49 ` Pavel Machek
2009-09-28 21:40 ` Jason Gunthorpe [this message]
2009-09-16 16:30 ` Roland Dreier
2009-09-16 16:40 ` Linus Torvalds
2009-09-17 11:30 ` Peter Zijlstra
2009-09-17 14:24 ` [ofa-general] " Roland Dreier
2009-09-17 14:32 ` Roland Dreier
2009-09-17 14:49 ` Peter Zijlstra
2009-09-17 15:03 ` Roland Dreier
2009-09-17 15:22 ` Peter Zijlstra
2009-09-17 15:45 ` Roland Dreier
2009-09-18 11:50 ` Ingo Molnar
2009-09-29 17:13 ` Pavel Machek
2009-09-30 9:44 ` Ingo Molnar
2009-09-30 16:02 ` Jason Gunthorpe
2009-10-12 18:19 ` Ingo Molnar
2009-10-12 19:30 ` Jason Gunthorpe
2009-10-12 20:20 ` Ingo Molnar
2009-10-13 4:05 ` Jason Gunthorpe
2009-10-13 6:40 ` Ingo Molnar
2009-10-13 16:27 ` Jason Gunthorpe
2009-10-13 5:43 ` Brice Goglin
2009-10-13 6:38 ` Ingo Molnar
2009-09-30 17:06 ` Roland Dreier
2009-10-02 16:32 ` Roland Dreier
2009-10-02 20:45 ` Pavel Machek
2009-10-07 22:34 ` Roland Dreier
2009-10-12 17:33 ` Peter Zijlstra
2009-09-17 14:43 ` Peter Zijlstra
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=20090928214057.GX19540@obsidianresearch.com \
--to=jgunthorpe@obsidianresearch.com \
--cc=akpm@linux-foundation.org \
--cc=general@lists.openfabrics.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=pavel@ucw.cz \
--cc=rdreier@cisco.com \
--cc=torvalds@linux-foundation.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