linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Brauner <christian@brauner.io>
To: Todd Kjos <tkjos@google.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Todd Kjos" <tkjos@android.com>,
	"open list:ANDROID DRIVERS" <devel@driverdev.osuosl.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Martijn Coenen" <maco@android.com>,
	joel@joelfernandes.org
Subject: Re: [PATCH v1 2/2] binderfs: reserve devices for initial mount
Date: Thu, 3 Jan 2019 21:34:19 +0100	[thread overview]
Message-ID: <20190103203418.rpx3wcs3ozncpnhu@brauner.io> (raw)
In-Reply-To: <CAHRSSEythiuV6HH9c-q5TwU=tDyZ-K5gjgF+uYZmd6pmAJTovw@mail.gmail.com>

On Thu, Jan 03, 2019 at 12:25:24PM -0800, Todd Kjos wrote:
> On Sun, Dec 23, 2018 at 6:36 AM Christian Brauner <christian@brauner.io> wrote:
> >
> > The binderfs instance in the initial ipc namespace will always have a
> > reserve of 4 binder devices unless explicitly capped by specifying a lower
> > value via the "max" mount option.
> > This ensures when binder devices are removed (on accident or on purpose)
> > they can always be recreated without risking that all minor numbers have
> > already been used up.
> >
> > Cc: Todd Kjos <tkjos@google.com>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
> > ---
> > v1:
> > - patch introduced
> > v0:
> > - patch not present
> > ---
> >  drivers/android/binderfs.c | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c
> > index 873adda064ac..aa635c7ea727 100644
> > --- a/drivers/android/binderfs.c
> > +++ b/drivers/android/binderfs.c
> > @@ -40,6 +40,8 @@
> >  #define INODE_OFFSET 3
> >  #define INTSTRLEN 21
> >  #define BINDERFS_MAX_MINOR (1U << MINORBITS)
> > +/* Ensure that the initial ipc namespace always has a devices available. */
> > +#define BINDERFS_MAX_MINOR_CAPPED (BINDERFS_MAX_MINOR - 4)
> 
> Why do you ever need more minors per instance than the number of
> devices listed in CONFIG_ANDROID_BINDER_DEVICES?

Are you asking asking why this is 4 and not 3? In that case we should
probably parse CONFIG_ANDROID_BINDER_DEVICES once at init time and then
reserve that many binder devices. Thoughts?

Christian

  reply	other threads:[~2019-01-03 20:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-23 14:35 [PATCH v1 1/2] binderfs: implement "max" mount option Christian Brauner
2018-12-23 14:35 ` [PATCH v1 2/2] binderfs: reserve devices for initial mount Christian Brauner
2019-01-03 20:25   ` Todd Kjos
2019-01-03 20:34     ` Christian Brauner [this message]
2019-01-03 21:47       ` Todd Kjos
2019-01-03 22:08         ` Christian Brauner
2019-01-03 22:27           ` Todd Kjos
2018-12-24 11:09 ` [PATCH v1 1/2] binderfs: implement "max" mount option Christian Brauner
2018-12-24 11:45   ` Greg KH
2018-12-24 11:48     ` Christian Brauner
2019-01-02  9:17 ` Dan Carpenter
2019-01-02 11:16   ` Christian Brauner

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=20190103203418.rpx3wcs3ozncpnhu@brauner.io \
    --to=christian@brauner.io \
    --cc=arve@android.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=joel@joelfernandes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maco@android.com \
    --cc=tkjos@android.com \
    --cc=tkjos@google.com \
    /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).