public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 22:30:05 +0900	[thread overview]
Message-ID: <4B74065D.2000707@kernel.org> (raw)
In-Reply-To: <E1NfYfb-00039p-Uh@pomaz-ex.szeredi.hu>

Hello,

On 02/11/2010 10:01 PM, Miklos Szeredi wrote:
>> That's the requirement coming from allowing the server to determine
>> how these mmaps are served, not from the fact that the management is
>> done via server side mmaps or the server maps those regions into its
>> process address space.  No matter how you do it, if you want to mix
>> and match client mmap requests, the SHMLBA alignment will be visible.
> 
> Can you give an example?

Hmmm... I don't have any specific example.  osspd is the only real
thing which uses it and it serves each mmap request with a separate
region.  Oh... the fmmap example program serves the same region to
mmap requests coming from the same UID, so it does both sharing and
putting maps apart.

>> I suppose you're talking about not allowing offsets to be adjusted at
>> all but I don't think that's a restriction we would want to have at
>> the kernel API level because offset might encode different things for
>> device mmaps.
> 
> Possibly.  But there's some confusion about offsets again.  This
> offset is not the same as the one currently returned in fuse_mmap_out.

This offset is the offset client requests.

> And neither is the SHMLBA alignment requirement so clear:
> 
> You say, that ossp ignores the client mmap offset.  So basically it
> resets the offset to zero, whatever it was, no?  That sounds fine, but
> then you are adjusting the offset by something not necessarily a
> multiple of SHMLBA.

Yeap and that would be a bug.  It will probably have to do % SHMLBA on
the offset.  I don't think all OSS drivers would be caring about these
stuff anyway.  Most of them work on only x86 where SHMLBA == PAGE_SIZE.

> So there are different offsets:
> 
>  a) vma->vm_pgoff (which may mean anything, but usually means b)

Yeap, vma->vm_pgoff can be any value and doesn't really matter.  The
only visible difference would be the /proc listing, right?  Setting
this to the requested offset is trivial.

>  b) the offset at which the pages of the mapping are located
>  c) the offset at which the server side mmap is located

There are three offsets.

a) the offset a client requested

b) the offset into dmmap AS, a client mmap region is mapped to.  This
   could be different from a) by multiple of SHMLBA / PAGE_SIZE.

c) the offset into dmmap AS, a server mmap region is mapped to, where
   collection of these mmaps define the dmmap AS.

The offsets used in b) and c) are the same offsets.

Thanks.

-- 
tejun

  reply	other threads:[~2010-02-11 13:23 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
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 [this message]
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=4B74065D.2000707@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