Received: by 10.213.65.68 with SMTP id h4csp2124271imn; Thu, 29 Mar 2018 18:40:26 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+UJ4ZxofUDmK2nck46DITBfJ+ybrxHIbTJSSF3EOogUuqjWJMZHPKYyU91uAkxjeRV3/zR X-Received: by 10.98.247.9 with SMTP id h9mr8204740pfi.212.1522374026411; Thu, 29 Mar 2018 18:40:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522374026; cv=none; d=google.com; s=arc-20160816; b=nY6+3gwiqM+ucIwwL+6jYwzX3o6jjOw8ECVpFOGNnqzpuFpSjd4hLR9wqadfGIQ9pD qs/Nk63BRrYs9bnbnmYMmRmJ6ialx3Rdb7nWXvuxb8BCstup2lf8X9ZIuQZkV4/N6arC yZ9TwF+59H0ZYLKPLQ7PbJO0/5DgiU90mdTmYR09waXV0n8jOLyrfgAOztSQvJqj0Kwc zROdCtSmreVwoGbC1Y0KrECWBa1IqIMvgjiIdz1zbOiWLn67iIqyCI1AUPyfQtmHdJt3 2MnYE6wMpDK9O/W2tcYwktqHPhggXOs3N70Iqq4GAmVxoY2LtEMofkw2DTaEiWLOtXTk W73A== 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=cJF/KlIP2Znzrqew5cfnvQTsMWEQykAKfrA0VahZ38k=; b=AZXXJCu0cvshD1jG1cyxrmge9PJgX3HrUvv9dni61nTDyDNVYSTZC4wzdgmMEtcKTY MAy9Pq/TxX7PJL+lIC+h/vX3xzX8GAK/JcKVZD4/4jR8cuxCwbvDQJFKz+jWVULlCeaw jxSRoGia9xocwFtWEQd60bRdOyjK0OCeI/2VPLKM47rawfHLmixJWCv3pLW8WccjTlTu 9j4U+2awTS+CM+bM9lSPXGOqAfKj95CKbmM+2WQyNyVAbLpG2sLI/9+UOMICR6gG3w5H l/YJPahRpzSyfR4pcPNWndITV7qcQ+BIvp6irfPIm/GcYvIGAv4ccVWbDZHnDI8RnVII 2Eaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DhkF+GNB; 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 u1-v6si7861249plj.409.2018.03.29.18.40.12; Thu, 29 Mar 2018 18:40:26 -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=DhkF+GNB; 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 S1752455AbeC3BjF (ORCPT + 99 others); Thu, 29 Mar 2018 21:39:05 -0400 Received: from mail-it0-f47.google.com ([209.85.214.47]:55596 "EHLO mail-it0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751906AbeC3BjE (ORCPT ); Thu, 29 Mar 2018 21:39:04 -0400 Received: by mail-it0-f47.google.com with SMTP id 142-v6so10320475itl.5 for ; Thu, 29 Mar 2018 18:39:04 -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=cJF/KlIP2Znzrqew5cfnvQTsMWEQykAKfrA0VahZ38k=; b=DhkF+GNBD4jHj5u32LYfo56YFFS+gFoUmeU2cOcpDhfiAlnuxr06f83NwSw3T4OuJi jdngX64a9r8uJDe32JUr1eKaK2NWMQt1bpo0L5sIpPhpTtONjLLp5jk+axiBfdKdjM4J rLcLl60/fdbIJlYhxOypLgJMr1MLEu0rE/XHEZE/K/lzD4XVFrculXwes5zW1BWbGxBI 4tCerbewX4xKSoEtuDsHZyUvZtahnu+gQxJtpOHwi7jEcm1uGPyKaxzgjKsnxLX34WGR oTchgJA4Bwgxtm9yyTPCT5K8yGo091+FABk9vIDw55PEGVzEnm5K6DLaG06lAzzyWzLs 08SA== 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=cJF/KlIP2Znzrqew5cfnvQTsMWEQykAKfrA0VahZ38k=; b=KKWuge1FhNtiWMVuSN/V+BK9gvt4fLDqTW9e2OTd4udHSH2RDZZS0NZ+1gQ/SYc1GY TpPS0zLD3O08saNpDjh/7GQZVgqw05KQhZMB08erykgLI+1QQNroCJtdiUnUwdIm9smO VznLsARWbqNa5T/uc8mJOHcvFv3pRYb/nCE+oaMJ8YolBDUDf018+7YEdlqe80APvxtI mVXMdAShrjGiicPCRzSgX6aT2kBqVdH+6uuWIXW3eMM6nWLQLPw6xOjM0qaYEVZjCWU7 ID0i+icNbmILgDDqZB0mei0PHGT4VkGMpPh4vlSrrkxpJAFOXoLbHvkAeAgk5BecSAbc AnTw== X-Gm-Message-State: AElRT7HaV25JFuZmVPajnzxLwmd1dpGpyVJ3+74sPCMbo9CKuXRl9uVg 5wvrkm+kbtEvAfIr+y9W8UruoLQlA9k+JIrtPHg= X-Received: by 2002:a24:4702:: with SMTP id t2-v6mr1379360itb.74.1522373943731; Thu, 29 Mar 2018 18:39:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.168.153 with HTTP; Thu, 29 Mar 2018 18:39:03 -0700 (PDT) In-Reply-To: <20180330012921.GB255979@rodete-desktop-imager.corp.google.com> References: <20180329065424.203172-1-minchan@kernel.org> <20180330012921.GB255979@rodete-desktop-imager.corp.google.com> From: Ganesh Mahendran Date: Fri, 30 Mar 2018 09:39:03 +0800 Message-ID: Subject: Re: [PATCH v5] ANDROID: binder: change down_write to down_read To: Minchan Kim Cc: LKML , Joe Perches , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Todd Kjos , Greg Kroah-Hartman , 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-03-30 9:29 GMT+08:00 Minchan Kim : > 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"? After applying this patch in our devices, app launch time increases about 15% in average. "This patch makes performance regression", yes, from the results, it is like this. I will do more test of this patch. > >> >> 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. > > Thanks.