Received: by 10.213.65.68 with SMTP id h4csp2067549imn; Sun, 1 Apr 2018 23:47:39 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+QSKR+Lmh32F8Xcd1jFSgAKzLrG5LbhEMvqZ2yjpoFceYZBLps+JLjObM6v1IwCPve9kZI X-Received: by 10.98.225.20 with SMTP id q20mr6502113pfh.142.1522651659177; Sun, 01 Apr 2018 23:47:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522651659; cv=none; d=google.com; s=arc-20160816; b=Vz/byGqrovuWvXQp6Hl7nQO2Ndh4CQTjgVz3AMa1LhXzKdiLrYMHAmHDh5/r3kqPya hkFHIKK0Oc0ppHPAOJPA2PrILsHS2/8RALIL8UTJejypu55mJzGxZAD7fiJOUKSUeI1R HAj4Iw7NL17M3bW3oYNVobq7jZCaxTedkcFjtmH+QePeTQPi+wX58QV0TBtDfwdQwoa5 2/hOFagVC+1KuLbgT44n3AtmnnDJrNCQh1h5t3WhEy4Nba5SWAJCco42sY7Tr0trGKnX OyJDMZYS2RM7y33LHLOLkFNV7IN763s3YkFniZxSO93+BLDE7tSSLN2cSr6Gbx8s+Xnu wD+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=1hfZy5K2fZ99yu5evPoFCgTHFEwpe/0snBed+Vb4XkE=; b=m41qLIe5kW8ZcVixhiVBG6PHmRthU97X5hvesuruJzxH0DY03nl0PY4kJcF9qYkfvL 1CedrHkzoMI6n8WF3Vlbvr+DffOJmyskFXaWvb+SE7gbck0W6i4HTWeLmlEA2W9eksfl WkpODfGZbjyJrDfMT6aUt4eqHl5/WvxaK66NyxTx3NwmJw1Uh0Bx7DLtMp0VwZR4qyiC OR+mo6Uo+XAJof+aCNgnmN5Qs3aY7ImN3b2ossYmvUL0KNvvJXGg9JY3DH6++wpqWX0a dB9ypxsJjpmRqToViQYba1/QMTJejJYsGg5UidhKQTUP6kZoBTJqOfLhTllyYevKIqH8 j00w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Xk4tYAE0; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1-v6si14061525pld.204.2018.04.01.23.47.25; Sun, 01 Apr 2018 23:47:39 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Xk4tYAE0; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754214AbeDBGqS (ORCPT + 99 others); Mon, 2 Apr 2018 02:46:18 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:53605 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752150AbeDBGqP (ORCPT ); Mon, 2 Apr 2018 02:46:15 -0400 Received: by mail-it0-f67.google.com with SMTP id m134-v6so17740091itb.3 for ; Sun, 01 Apr 2018 23:46:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=1hfZy5K2fZ99yu5evPoFCgTHFEwpe/0snBed+Vb4XkE=; b=Xk4tYAE0Qzy7yuqs58sZ5ho02pinDuyVzClAIdQAALNPUgAwaptKjeCiCaFMoYvKtX HJM/i+kCk1UeeHYYdLqK3c3+fuc4WISaI6BfDx+1vIA/s84QiCHT+jo0bLSfQlpRIyS2 U3kd1fuIN1D1fmwlN80ONvY+YaIUqm/91a+vPyLs6Xzs7V4s5YgA+IIGn2J45cX62Zk2 no6m2RwxnyxHPxMwGWCGEEuDXXCATAV8wwDRoswg6njbKYLVQdVwrsYLNQYWh5uBU3CW aWaGfIyx5sGiZ6tjLoa0FGP7qi96Fx8kCyYrOObH5AKb4wzF6P5COlJ7hnnhGcZZxa/7 UVWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=1hfZy5K2fZ99yu5evPoFCgTHFEwpe/0snBed+Vb4XkE=; b=WUttYLnnXYZ7AcJeWZjDI4NzyMzxDWIboaE9vj0Ipa7vg8H8FrkSeHF2GqYkNgLCqs R9hnKdcwvhlwGPg/n8/sy5Zij9FIV43N539w7XqrjO2Pp2+RtResqTX+P9JGEFF6Eth1 YWV0+xDi7499uuGDog6Iwk1IBWPRl9fbCUaOnsbCDTd9M2PVicWDw+iIE+lKqR603Eyg HBHcEVDZUFPB5bWOL55j/kKSZvD7etoqHxC6wfGuQ9bfaGWkijDSFzJhEbeTUizWRqZV e2ITUa294w3fo0nPX7FrAxz9yoV+Ox4eKkacbTp+SLgGL7UnT1ypaKgwmZe9lCXgLxah NZ1w== X-Gm-Message-State: AElRT7G+n4J0fguw6AODLlmGI29eelxeLHXs0VKEM1Sget3U9Zpf3Yfd t3+utcolXDXgGa2Udwni6/R365cwisNRv5+F7kQRXw== X-Received: by 2002:a24:4702:: with SMTP id t2-v6mr12233897itb.74.1522651574548; Sun, 01 Apr 2018 23:46:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.168.153 with HTTP; Sun, 1 Apr 2018 23:46:14 -0700 (PDT) In-Reply-To: <20180402063448.GA250086@rodete-desktop-imager.corp.google.com> References: <20180329065424.203172-1-minchan@kernel.org> <20180330012921.GB255979@rodete-desktop-imager.corp.google.com> <20180330100407.GB19140@kroah.com> <20180402063448.GA250086@rodete-desktop-imager.corp.google.com> From: Ganesh Mahendran Date: Mon, 2 Apr 2018 14:46:14 +0800 Message-ID: Subject: Re: [PATCH v5] ANDROID: binder: change down_write to down_read To: Minchan Kim Cc: Greg Kroah-Hartman , LKML , Joe Perches , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Todd Kjos , Martijn Coenen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-04-02 14:34 GMT+08:00 Minchan Kim : > On Fri, Mar 30, 2018 at 12:04:07PM +0200, Greg Kroah-Hartman wrote: >> 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 for the information. I didn't notice that such kinds of tests for > binder. I will keep it in mind. > > Today, I have setup the testing for my phone and found testing was very > fluctuating even without my patch. It might be not good with my test > skill. I emulated user's behavior with various touch event. With it, I open > various apps and play with them several times. Before starting the test, > I did "adb shell stop && adb shell start && echo 3 > /proc/sys/vm/drop_caches" > > Such 15% noise was very easy to make it. > > Ganesh, How did you measure? What's the stddev? Hi, Minchan: Sorry for the late response, a little busy these days. :) We have our own test tools to measure app launch time, or you can use android systrace to get the app launch time. We tested your V1 patch: https://patchwork.kernel.org/patch/10312057/ and found app lunch time regression. I will use binderThroghput tool to test the patch today or tomorrow. Thanks. > Please let me know how you measure without noise so I'd like to reproduce > the result in my phone. > > I will do binderThroghput test, too. > >