Received: by 10.213.65.68 with SMTP id h4csp2061499imn; Sun, 1 Apr 2018 23:36:35 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+1/QMf+oZwtAFkGb2TWFzqlm8tWocTXXfPwVsJeEZ1v5SZ8BBzmNHvOcidG9tAfGnNOzfn X-Received: by 10.101.82.141 with SMTP id y13mr1927119pgp.245.1522650995344; Sun, 01 Apr 2018 23:36:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522650995; cv=none; d=google.com; s=arc-20160816; b=GRLnnHBla2u/pzWpYL04lZmmVc0Q985AvIhnZphJmpusO6t+fBq9j8JyN7MxIzmzuh E+Da6H6XvnszvEH95q1g+JrcEKeomzOtiwgi6APsAa22WnxLl74+P6fXR44kTkRPwmXU ses/3YmkBLasD/VXkxTTSWaBERvLyjxC4Q9grAOpOs3BuI/wi8Rqfqs+EBAa+mWjnyEu gvB0gOl0UpaAgQ9By2m9NR9d3F0LuCb1MHtgLpHP//4Nh8mr8NIRY2gc+aaJcWEo93EJ OZ6cCEGpYDxiTAFzS9Zh1ba8dMUMcTE0wF5G6Wxq+CiBg4smx12S2izBfMQstnpIroXv MLSg== 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:dkim-signature:arc-authentication-results; bh=QbmgbsINsLrJOChnfJu5xAny15eRmwFjCeAwW048jDw=; b=DwGq5KxuGyyBvnZd45gyfm+0FvTF6NftRp6GU98xXkTz8e+j8BjReBgz2UQflawVyj tCuU8giOA+2Vs6HbJ9EbrdhjAt1atXsmE99cv+vs2DbrtXYEEmhtGJRwdjiawWzyWIRY x6aG1DGgdV8cRYmN90CIYwWhjDWUFm0MJ9M1N8hrWysq2k46DE0f2YOJ1bex+kjSeDSz Of6Jert1LFgkh+tDWUZw7k9S3NnY93bsmrADTryB3vk9IfMxCUF9NFk12KE7/rw/1aNy /4ha+W2HNf0/bvXQhNWKHG/XYu4YzY7Z2288Page+OU3f++E9AldH4JEb3W6ugIrGe8/ 7oDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=IzHXhpBg; 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 m15si3772539pgs.721.2018.04.01.23.36.21; Sun, 01 Apr 2018 23:36:35 -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=fail header.i=@gmail.com header.s=20161025 header.b=IzHXhpBg; 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 S1754176AbeDBGe5 (ORCPT + 99 others); Mon, 2 Apr 2018 02:34:57 -0400 Received: from mail-it0-f45.google.com ([209.85.214.45]:37657 "EHLO mail-it0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752369AbeDBGey (ORCPT ); Mon, 2 Apr 2018 02:34:54 -0400 Received: by mail-it0-f45.google.com with SMTP id 71-v6so15299510ith.2 for ; Sun, 01 Apr 2018 23:34:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QbmgbsINsLrJOChnfJu5xAny15eRmwFjCeAwW048jDw=; b=IzHXhpBgcuU3p48m01sMgg1mayIr+TFCLXqEhQTWO3XT4g0vGb25BbBvZAAwpWbcdy 0dFZYj3E9zeGVPycFS+KYsJxgCLgLL+5VrnMhV6Z95/0UOVebp/D4zN61CODN13GBgdM 9q0Jw1kP1XbikzGIAhkU6Y+kgYxIqdlR+MtCCuGxcCqZva8lmvCNa9TNqvhiJ7PuZ213 pYcKQKwKaEJ0ZL2A7aDvXu3lfTpw//cBLD4fzS/IdJJFeT7i8C9cRue9Yvo6ZAlcLPa6 Hj530ywefxF40zyztLK0WF8Er1ogbSt41vefQdCeZb4DKeILCeIDVIh1o2C7sw0AoAEn w6Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=QbmgbsINsLrJOChnfJu5xAny15eRmwFjCeAwW048jDw=; b=iQ7ulWMuE3PkHSfOvighNNiUb5i2ia4nq8SlYfUlxV5WZBwu2IJ5zJWoZXPUwhMR6D Rt4Tock4wFZuTZuglrPDKvw2ytZeiWM2/ALMmdUhUhrGuoMin2tuumFYvs1P3PEROVXa ZyMpHaZwbGHpRy9h0rN2uRa+UBF2xYa9ZZJ3qKHlUBKRGvI2dcn62dsbzetgO0F5V+Ru xoHxAelJ1sWENs8qW4wDwyxYV979iXfe5a1HPtkxOernZQpF0+vV4aRl1xw7fiV1Npey to/YJ3z9hTgC5+Drybb0SljddldJ8qHEOVR6uqWb0ygjNFyiQZF8rpL3MCjL79UYha04 efIQ== X-Gm-Message-State: AElRT7E0ElPPXjVse1vvLphTaWv6U/4V0m2Hh1UrD1Aj8HaQJ0ZEI4F3 xrlvn3hpO5x9oDfZdsl8mSA= X-Received: by 2002:a24:5151:: with SMTP id s78-v6mr11074492ita.103.1522650894255; Sun, 01 Apr 2018 23:34:54 -0700 (PDT) Received: from rodete-desktop-imager.corp.google.com ([2401:fa00:d:0:7630:de9:f6f2:276f]) by smtp.gmail.com with ESMTPSA id w132-v6sm5004987itf.6.2018.04.01.23.34.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 01 Apr 2018 23:34:52 -0700 (PDT) Date: Mon, 2 Apr 2018 15:34:48 +0900 From: Minchan Kim To: Greg Kroah-Hartman 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: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180330100407.GB19140@kroah.com> User-Agent: Mutt/1.9.2 (2017-12-15) 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 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? 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.