From: Tejun Heo <tj@kernel.org>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: mszeredi@suse.cz, linux-kernel@vger.kernel.org,
fuse-devel@lists.sourceforge.net, polynomial-c@gentoo.org,
akpm@linux-foundation.org
Subject: Re: [fuse-devel] [PATCH] FUSE/CUSE: implement direct mmap support
Date: Thu, 11 Feb 2010 20:47:52 +0900 [thread overview]
Message-ID: <4B73EE68.4070004@kernel.org> (raw)
In-Reply-To: <E1NfVOi-0002l9-5l@pomaz-ex.szeredi.hu>
Hello,
On 02/11/2010 06:31 PM, Miklos Szeredi wrote:
> On Thu, 11 Feb 2010, Tejun Heo wrote:
>>> If there's a pattern there, we might make the sharing/non-sharing
>>> automated, and greatly simplify the interface.
>>
>> Isn't the interface pretty simple as it is?
>
> On one hand it's simple, on the other it has pretty weird
> limitations, considering that server side mmap shouldn't be
> mandatory.
It's not like it's something completely foreign. It's a limitation
which can also be found in shared memory and the server side mmap
doesn't really have much to do with it. It's also necessary to avoid
aliasing issues among clients.
> But of course if server side mmap isn't used, then the SHMLBA
> limitation is not necessary anymore so the implementation could
> choose an arbitrary "offset".
It of course is necessary. How else can aliasing among clients be
avoided? The alignment is not only for the server. If you're gonna
share memories and want to adjust the mapping in any way, you need to
follow the SHMLBA alignment.
> My biggest gripe with the kernel API is that we shouldn't be calling
> that thing in fuse_mmap_out an offset at all, because it's not and
> it's confusing (like making you set vma->vm_pgoff to that value, which
> is bogus). Adding a separate "page_id" or whatever would make me
> happy.
It _is_ an offset into the dmmap address space. mmap() requests to
map certain length at certain offset of an address space. The FUSE
server can redirect the offset to make it share, not share or combine
or whatever. It's very simple conceptually.
> And if the server wants to mmap /dev/fuse then it can do that and send
> the result in "dev_offset", to make it clear that it's a different
> offset from the one the client used on the mmap. And it can even use
> that value as page_id, if it wants to or it can use a different
> page_id.
>
> Does that sound reasonable?
I can't really follow what you're suggesting. Either you're
misunderstanding why SHMLBA is necessary or I'm being plain dumb. Can
you please describe what you have on mind without referring to the
current implementation? How would it work?
>> If we want to make it easier for API users by imposing limits, I
>> think the correct layer to do that would be at the library level.
>
> Hmm, might do that. High level library users definitely shouldn't be
> having to mess around with SHMLBA.
The main thing would be to let the library manage mmap regions and ask
the server only two things - region size and share ID both of which
are optional. If both are not set (ie. -1 and -1), the mmap request
won't be shareable and sized as requested by the client. If the
server returns a positive ID, all mmap requests with the same ID will
share the region.
Also, I said it before but SHMLBA is something which is already known
to the userland for shared memories. I really don't think this is too
much to ask for if the server is playing with direct mmap.
Thanks.
--
tejun
next prev parent reply other threads:[~2010-02-11 11:41 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-09 6:08 [PATCH] FUSE/CUSE: implement direct mmap support Tejun Heo
2010-02-09 14:59 ` [fuse-devel] " Miklos Szeredi
2010-02-10 11:22 ` Tejun Heo
2010-02-10 11:29 ` Miklos Szeredi
2010-02-10 11:56 ` Tejun Heo
2010-02-10 12:15 ` Miklos Szeredi
2010-02-10 12:35 ` Tejun Heo
2010-02-10 15:02 ` Miklos Szeredi
2010-02-10 23:43 ` Tejun Heo
2010-02-11 9:31 ` Miklos Szeredi
2010-02-11 9:51 ` Miklos Szeredi
2010-02-11 11:54 ` Tejun Heo
2010-02-11 12:25 ` Miklos Szeredi
2010-02-11 12:49 ` Tejun Heo
2010-02-11 12:46 ` Miklos Szeredi
2010-02-11 13:05 ` Tejun Heo
2010-02-11 13:08 ` Miklos Szeredi
2010-02-11 13:40 ` Tejun Heo
2010-02-11 11:47 ` Tejun Heo [this message]
2010-02-11 12:34 ` Miklos Szeredi
2010-02-11 12:56 ` Tejun Heo
2010-02-11 13:01 ` Miklos Szeredi
2010-02-11 13:30 ` Tejun Heo
2010-02-11 13:40 ` Miklos Szeredi
2010-02-11 13:58 ` Tejun Heo
2010-02-11 14:40 ` Miklos Szeredi
2010-02-12 0:07 ` Tejun Heo
2010-02-12 0:25 ` Tejun Heo
2010-02-12 9:55 ` Miklos Szeredi
2010-02-12 13:33 ` Tejun Heo
2010-02-12 13:53 ` Miklos Szeredi
2010-02-12 17:56 ` Tejun Heo
2010-02-10 11:36 ` Tejun Heo
2010-02-10 8:24 ` Goswin von Brederlow
2010-02-10 8:40 ` Miklos Szeredi
2010-02-10 8:58 ` Paul Schutte
2010-02-10 10:02 ` Paul Schutte
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=4B73EE68.4070004@kernel.org \
--to=tj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=fuse-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=mszeredi@suse.cz \
--cc=polynomial-c@gentoo.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