[<prev] [next>] [day] [month] [year] [list]
Message-ID: <5FBCBE569E134E4CA167B91C0A77FD610198F8495C@EXMBX-SZMAIL022.tencent.com>
Date: Thu, 8 Nov 2018 08:09:57 +0000
From: chouryzhou(周威) <chouryzhou@...cent.com>
To: Davidlohr Bueso <dave@...olabs.net>
CC: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"arve@...roid.com" <arve@...roid.com>,
"tkjos@...roid.com" <tkjos@...roid.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
chouryzhou(周威) <chouryzhou@...cent.com>
Subject: RE: [PATCH V2] binder: ipc namespace support for android binder
> From: Davidlohr Bueso <dave@...olabs.net>
> Sent: Thursday, November 8, 2018 3:00 PM
>
> 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.
Yes, you're right, the binder_contexts is just modified when initing and exiting
namespace, we don't need this lock.
I will update the code you mentioned above.
Powered by blists - more mailing lists