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:54:46 +0900 [thread overview]
Message-ID: <4B73F006.7090706@kernel.org> (raw)
In-Reply-To: <E1NfVho-0002nJ-V2@pomaz-ex.szeredi.hu>
Hello,
On 02/11/2010 06:51 PM, Miklos Szeredi wrote:
> And even a page_id is superfluous, since all we want is differentiate
> between possibly separate maps for the same file and don't care about
> individual pages.
>
> And even differentiating between maps on the same file is only ever
> possible for char devs, normal files will only ever have a single map.
>
> So instead of "page_id" it could just be a "map_id", which will be
> zero for normal maps, and whatever for /dev/fuse maps.
Well, not exactly. There are device mmap() implementations which
simply ignore @offset because offsetting doesn't make any sense at
all. ossp mmap is actually done that way. I really don't think it
would be wise to impose such restriction at the kernel API level. For
highlevel interface, dealing with separate regions could be fine tho.
>> 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.
>
> And there's a weakness in the current server side mmap interface, for
> example:
>
> 1) user mmaps region 3-5 (in page index)
> server maps this region at 3-5
>
> 2) user mmaps region 1-7
> server can't tell kernel that it wants to reuse region 3-5 but
> wants to create two other regions
>
> What happens in that case?
If the server wants the two regions to be separate, it can map it to
say 5-11 and returnt he offset of 5. If it wants them to be shared,
it will have to mmap 1-2 and 6-7 and return offset of 1. But, the
server should really know better than growing the area this way. If
this type of expansion ever becomes problem, we can implement
expendable mmap on the server side (ie. don't require VM_DONT_EXPAND).
> On the other hand if the map_id is separate from the dev_offset, then
> the server can map the second region as one map and the kernel can
> connect it up with the right pages based on the map_id returned in the
> MMAP reply.
How is this not possible in the current implementation?
Thanks.
--
tejun
next prev parent reply other threads:[~2010-02-11 11:47 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 [this message]
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
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=4B73F006.7090706@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