linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Brauner <christian@brauner.io>
To: Martijn Coenen <maco@android.com>
Cc: "Matthew Wilcox" <willy@infradead.org>,
	"Christoph Hellwig" <hch@infradead.org>,
	"Al Viro" <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Todd Kjos" <tkjos@android.com>,
	rlove@google.com, ben@decadent.org.uk
Subject: Re: [PATCH 1/4] file: export __alloc_fd()
Date: Tue, 31 Jul 2018 12:07:01 +0200	[thread overview]
Message-ID: <20180731100701.GA18871@mailbox.org> (raw)
In-Reply-To: <CAB0TPYG5T_d32iwt8Lgq_nDO_COWfWBfuSzErraASSuTYGm3yQ@mail.gmail.com>

On Tue, Jul 31, 2018 at 10:44:33AM +0200, Martijn Coenen wrote:
> On Mon, Jul 30, 2018 at 10:36 PM, Matthew Wilcox <willy@infradead.org> wrote:
> > I'm not entirely sure I understand the binder code (... does anyone?)
> > but from what I can see, it intends to open a file descriptor in the
> > process which is the target of the message being sent.
> 
> You're right.
> 
> > That strikes
> > me as wrong-headed; it should be allocating a struct file and passing
> > that file to the other process.  When that process receives the message,
> > *it* allocates a file descriptor for itself.ho
> 
> We're looking into cleaning this up (historically it was done this way
> because VIVT caches made this not very efficient), and this is indeed
> a very good candidate for fixing it.

Ah, this wasn't brought up in the original thread when discussing to
turn this into a module. If using internal functions like this is going
away it makes sense to wait for this work to happen first. Is there a
time-frame for this?

Thanks!
Christian

> 
> >
> > But I think the binder user-space API relies on this.  The userspace API
> > seems to rely on passing fd numbers around ... but I'm having trouble
> > figuring most of this user API out.  Perhaps Martijn can help here.
> 
> The UAPI does expect a file descriptor, but we may be able to do the
> mapping from fd to struct file (and vice-versa) in the kernel driver,
> so userspace wouldn't notice.
> 
> Thanks,
> Martijn

  reply	other threads:[~2018-07-31 11:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-30 14:37 [RFC PATCH 0/4] file: export functions for binder module Christian Brauner
2018-07-30 14:37 ` [PATCH 1/4] file: export __alloc_fd() Christian Brauner
2018-07-30 16:31   ` Christoph Hellwig
2018-07-30 20:36     ` Matthew Wilcox
2018-07-30 21:43       ` Al Viro
2018-07-31  8:44       ` Martijn Coenen
2018-07-31 10:07         ` Christian Brauner [this message]
2018-07-31 10:37           ` Martijn Coenen
2018-07-30 14:37 ` [PATCH 2/4] file: export __fd_install() Christian Brauner
2018-07-30 16:32   ` Christoph Hellwig
2018-07-30 14:37 ` [PATCH 3/4] file: export get_files_struct() Christian Brauner
2018-07-30 16:32   ` Christoph Hellwig
2018-07-30 14:37 ` [PATCH 4/4] file: export put_files_struct() Christian Brauner
2018-07-30 16:33   ` Christoph Hellwig
2018-07-30 16:34 ` [RFC PATCH 0/4] file: export functions for binder module Christoph Hellwig
2018-07-30 20:12   ` Christian Brauner
2018-07-30 20:19     ` Matthew Wilcox
2018-07-30 20:28       ` Christian Brauner
2018-07-30 21:41         ` Al Viro
2018-08-02 13:31           ` Christian Brauner
2018-07-31 14:27   ` Ben Hutchings

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=20180731100701.GA18871@mailbox.org \
    --to=christian@brauner.io \
    --cc=arve@android.com \
    --cc=ben@decadent.org.uk \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maco@android.com \
    --cc=rlove@google.com \
    --cc=tkjos@android.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.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;
as well as URLs for NNTP newsgroup(s).