mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@stgolabs.net>
To: "chouryzhou(??????)" <chouryzhou@tencent.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"arve@android.com" <arve@android.com>,
	"tkjos@android.com" <tkjos@android.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH V3] binder: ipc namespace support for android binder
Date: Fri, 9 Nov 2018 10:26:54 -0800	[thread overview]
Message-ID: <20181109182654.ojzc7wae3jcivlup@linux-r8p5> (raw)
In-Reply-To: <5FBCBE569E134E4CA167B91C0A77FD610198F851AC@EXMBX-SZMAIL022.tencent.com>

On Thu, 08 Nov 2018, chouryzhou(??????) wrote:

>+#ifdef CONFIG_ANDROID_BINDER_IPC
>+       /* next fields are for binder */
>+       struct mutex      binder_procs_lock;
>+       struct hlist_head binder_procs;
>+       struct hlist_head binder_contexts;
>+#endif

Now, I took a look at how the binder_procs list is used; and no, what
follows isn't really related to this patch, but a general observation.

I think that a mutex is also an overkill and you might wanna replace it
with a spinlock/rwlock. Can anything block while holding the binder_procs_lock?
I don't see anything... you mainly need it for consulting the hlist calling
print_binder_proc[_stat]() - which will take the proc->inner_lock anyway, so
no blocking there. Also, if this is perhaps because of long hold times, dunno,
the rb_first_cached primitive might reduce some of it, although I don't know
how big the rbtrees in binder can get and if it matters at all.

Anyway, that said and along with addressing Todd's comments, the ipc/ bits look
good. Feel free to add my:

Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>

Thanks,
Davidlohr

  parent reply	other threads:[~2018-11-09 18:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-08 13:02 chouryzhou(周威)
2018-11-08 14:28 ` Christian Brauner
2018-11-09 17:54 ` Todd Kjos
2018-11-10  3:09   ` chouryzhou(周威)
2018-11-10  4:16     ` Todd Kjos
2018-11-10  4:43       ` Re: [PATCH V3] binder: ipc namespace support for android binder(Internet mail) chouryzhou(周威)
2018-11-10  5:24         ` Todd Kjos
2018-11-10  5:43           ` chouryzhou(周威)
2018-11-10  6:38             ` Todd Kjos
2018-11-09 18:26 ` Davidlohr Bueso [this message]
2018-11-09 19:03   ` [PATCH V3] binder: ipc namespace support for android binder Todd Kjos
2018-11-09 19:16     ` Davidlohr Bueso

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=20181109182654.ojzc7wae3jcivlup@linux-r8p5 \
    --to=dave@stgolabs.net \
    --cc=akpm@linux-foundation.org \
    --cc=arve@android.com \
    --cc=chouryzhou@tencent.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tkjos@android.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

all inboxes | Powered by JetHome®