Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1072593imu; Fri, 9 Nov 2018 10:27:56 -0800 (PST) X-Google-Smtp-Source: AJdET5fxF3+Q2MgfoURQzCga8QCjdVlLxBxIxFUSi4hrBV9aVTHcvxM50f9yvuEtwbNfUVCgiLBx X-Received: by 2002:a17:902:bc83:: with SMTP id bb3-v6mr9356368plb.223.1541788076301; Fri, 09 Nov 2018 10:27:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541788076; cv=none; d=google.com; s=arc-20160816; b=VMnW7U9Fnth3ANRzmG0wPOgIMc0TAycnKgTcD09UyaEkU03fDpXYa+HA4zz+BgLqDg bRjmGAWggIdpc6vkZmiMKwdi+kimY1FfDHb7D4T9CoDo62qoZholLhjbCdhM27nhk/Qv k1/U/P2TN/fkd4pQ9KDbhf+98TKMku96ZqRsulJo5bRaNumleHnVMfPL/Th2Y8pboLTi F6D8dFZ7CoVJWJ7Jr3M7ybN+oGSS9kGM1EOS6sUqSneZfisHQKUvbyes/yQ+/8OazvLA xXwnHB7DgdbGNIL4jVSgq38zJ2HTyUNTYax8XTUpip1dIy4Qk7y+7b+Gt5B6dPZTeBGN zqyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=RLUrFHX3ewO05ywrhfHnTKAn1qc/A/Js1yPGw5ub/x8=; b=oze3PaA1rLrnLXJhbNrV1i45IBdvqvqix+Rbx+2QBlVRxY3pWe2B7v1OXdHai9TrXr qHQPpxDoZ/BhkH9y6fcE7mCMpVTqSnCVAA6sGuTocXbb+f92xh/fmtRcs7AiPnjXKsC4 QXWMHQQZ3je13Fw/YrTwSv1YadXEX49sK+TM5cldI9zJRkGzfaOJf5+jZFxCqB6MSg7k 8aDbZuw7AvXv4i2CGIn4ovs6paXFkIisFtDVx7pSmAmJJpGsu/waAak8LqfyFn3oAzLH URnnoVQ4crg+NzytufHCvvu4Gk2iti7siQpMIibrimXkX3CbjE2KypU23YnDQ64e05DC EIyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x32si7322904pgk.309.2018.11.09.10.27.27; Fri, 09 Nov 2018 10:27:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728492AbeKJEIv (ORCPT + 99 others); Fri, 9 Nov 2018 23:08:51 -0500 Received: from mx2.suse.de ([195.135.220.15]:46354 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728162AbeKJEIv (ORCPT ); Fri, 9 Nov 2018 23:08:51 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0B4CAB057; Fri, 9 Nov 2018 18:27:03 +0000 (UTC) Date: Fri, 9 Nov 2018 10:26:54 -0800 From: Davidlohr Bueso To: "chouryzhou(??????)" Cc: "gregkh@linuxfoundation.org" , "arve@android.com" , "tkjos@android.com" , "akpm@linux-foundation.org" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH V3] binder: ipc namespace support for android binder Message-ID: <20181109182654.ojzc7wae3jcivlup@linux-r8p5> References: <5FBCBE569E134E4CA167B91C0A77FD610198F851AC@EXMBX-SZMAIL022.tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <5FBCBE569E134E4CA167B91C0A77FD610198F851AC@EXMBX-SZMAIL022.tencent.com> User-Agent: NeoMutt/20180323 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Thanks, Davidlohr