Received: by 10.213.65.68 with SMTP id h4csp160451imn; Fri, 30 Mar 2018 03:06:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx48KHoln/iyyr+5MSiDswy0aZdDaQjXJVGNUc2oDPmHZuPY02gCMsS4Cz3id5jqrLi1WcEYU X-Received: by 2002:a17:902:206:: with SMTP id 6-v6mr12310570plc.376.1522404379831; Fri, 30 Mar 2018 03:06:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522404379; cv=none; d=google.com; s=arc-20160816; b=UO9WE1GqI313iZorQbxjjtMZmRJp0xH06GsbcQ0dlB2IwwdCrrwPzzBwT6spVVWL2v cbMhN0d2RPw4suhk0jPiFu5Xy549GSIuOQ5myscLYqKpyr2VQ7Id6GxqkhfGAItZWtH6 Z+9mJ4/8hZPCsg3QBcDYvXO836bo6M4XwE6cAXinB+SLAGJxeTqsrke66xn4bUKGfCEQ P5IDA2TpOvIq5A1qr4QWLIBxsV8T97llL8+41hcZNq8fu5BapNFvE8JLdxTYnaPLqbvM 0mtGjf5eRMbPxsSiATsTGf1UWZ7vLq5gPSmVuWGh2/xcw9EO/BCHzX8JxwuxDDm8gMPA KFfQ== 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:arc-authentication-results; bh=QDwHf4QUZOJwo+DIgR/xWytyjFXkB4735TfOsqw/WDI=; b=ivd3AP9Ok8Danp4VIVDqA6Lg6DIIQz0/P7pbSgybQ19VqI75kMXMS5SdmzyCMFiAEF 7FKFqJt7fb3rQwWH088J50Jp/ykbWD1gl8rjiGIOTPndoxfyZMKkbh3s9cfhQsV0h+3D K505gQ+AOtmCSTkqCYnp9kxKJUW4fZWQS7L3jEiJJ4NyFQUejL0hXlEc/Arnbzt1juDj NGJ7VgCTYpkztwTp+oiAN9BeWvvq0B/+W9WPTIRxlFR3pB2hA0VOccqvIGAxBpiBWkMB F9Ty3C/54o5D/VakvKORbW76j7jGSDHodQJJCjCunuBu1hb5F36C9cTCLa4QmIFgzSql xOOQ== 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 37-v6si8029809plq.288.2018.03.30.03.06.05; Fri, 30 Mar 2018 03:06:19 -0700 (PDT) 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 S1751312AbeC3KEV (ORCPT + 99 others); Fri, 30 Mar 2018 06:04:21 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39114 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751053AbeC3KEU (ORCPT ); Fri, 30 Mar 2018 06:04:20 -0400 Received: from localhost (unknown [37.173.122.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id B18ADE71; Fri, 30 Mar 2018 10:04:18 +0000 (UTC) Date: Fri, 30 Mar 2018 12:04:07 +0200 From: Greg Kroah-Hartman To: Minchan Kim Cc: Ganesh Mahendran , LKML , Joe Perches , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Martijn Coenen Subject: Re: [PATCH v5] ANDROID: binder: change down_write to down_read Message-ID: <20180330100407.GB19140@kroah.com> References: <20180329065424.203172-1-minchan@kernel.org> <20180330012921.GB255979@rodete-desktop-imager.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180330012921.GB255979@rodete-desktop-imager.corp.google.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 30, 2018 at 10:29:21AM +0900, Minchan Kim wrote: > Hi Ganesh, > > On Fri, Mar 30, 2018 at 09:21:55AM +0800, Ganesh Mahendran wrote: > > 2018-03-29 14:54 GMT+08:00 Minchan Kim : > > > binder_update_page_range needs down_write of mmap_sem because > > > vm_insert_page need to change vma->vm_flags to VM_MIXEDMAP unless > > > it is set. However, when I profile binder working, it seems > > > every binder buffers should be mapped in advance by binder_mmap. > > > It means we could set VM_MIXEDMAP in binder_mmap time which is > > > already hold a mmap_sem as down_write so binder_update_page_range > > > doesn't need to hold a mmap_sem as down_write. > > > > > > Android suffers from mmap_sem contention so let's reduce mmap_sem > > > down_write. > > > > Hi, Minchan: > > > > It seems there is performance regression of this patch. > > You mean "This patch aims for solving performance regression" not "This patch > makes performance regression"? > > > > > Do you have some test result of android app launch time or binderThroughput? > > Unfortunately, I don't have any number. The goal is to reduce the number of > call mmap_sem as write-side lock because it makes priority inversion of threads > easily and that's one of clear part I spot that we don't need write-side lock. Please always run the binderThroughput tests when making binder changes (there is a binder test suite in the CTS Android tests), as that ensures that you are not causing performance regressions as well as just normal bug regressions :) thanks, greg k-h