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 V2] binder: ipc namespace support for android binder
Date: Wed, 7 Nov 2018 22:59:42 -0800 [thread overview]
Message-ID: <20181108065942.6gnb675xb2wuerrl@linux-r8p5> (raw)
In-Reply-To: <5FBCBE569E134E4CA167B91C0A77FD610198F6BB7D@EXMBX-SZMAIL022.tencent.com>
On Mon, 29 Oct 2018, chouryzhou(??????) wrote:
>@@ -63,6 +63,12 @@ struct ipc_namespace {
> unsigned int mq_msg_default;
> unsigned int mq_msgsize_default;
>
>+ /* next fields are for binder */
>+ struct mutex binder_procs_lock;
>+ struct hlist_head binder_procs;
>+ struct mutex binder_contexts_lock;
>+ struct hlist_head binder_contexts;
I don't think you want a mutex here protecting the binder_contexts list.
Afaict there is no concurrency going on: you only modify it in when doing
namespace init and exit (for which you have no serialization); do you even
need a lock here? Or at least I would think a more lightweight alternative
(rcu/spinlock/rwlock) would suffice.
Thanks,
Davidlohr
next prev parent reply other threads:[~2018-11-08 6:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-29 6:18 [PATCH V2] binder: ipc namespace support for android binder chouryzhou(周威)
2018-11-07 0:07 ` Andrew Morton
2018-11-08 6:21 ` Davidlohr Bueso
2018-11-08 6:27 ` Davidlohr Bueso
2018-11-08 6:59 ` Davidlohr Bueso [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-11-07 1:48 chouryzhou(周威)
2018-11-07 22:37 ` Andrew Morton
2018-11-08 3:01 chouryzhou(周威)
2018-11-08 8:09 chouryzhou(周威)
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=20181108065942.6gnb675xb2wuerrl@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;
as well as URLs for NNTP newsgroup(s).