Received: by 10.213.65.68 with SMTP id h4csp2118328imn; Thu, 29 Mar 2018 18:30:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx48iNRQeFVlP/UPF2sDG8r9eFBDs0HM1ltreVptiBOef2smmpXDvmZphQkAnxjscDqxnhy4L X-Received: by 2002:a17:902:7445:: with SMTP id e5-v6mr11062593plt.352.1522373457660; Thu, 29 Mar 2018 18:30:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522373457; cv=none; d=google.com; s=arc-20160816; b=w3ZgCGU58DxqYpoRfbpAKKHmjB6OWsULNAEz+u3uF9eGgrEDzTXqMwcw5MBwCnIrIy hUWcTc4H1R1CGXDLQK8AS0soRp4jfUqOaieynyQndiDM97RtyACQ5VjZT1LPvcjjNrgL 5E1tKkJjxX9Nrdcv6Td0goTGagMOBtYGeDYS0OhhxLiYx1LVCF1qZ3g1Di/lUj4iZxW/ hy1EEp7r1GnLysKlULB2FFaClNxAA2bCGFW7NzzJboEOGpByuKDNP4nRCdH1MN14AHOh OKQGgO36IqqluJAYGDFUpRJWrsdVMCVIWgNRjbFQlq8ziBRwY4n8MwWzAr0SmBrN/Arp 0SKQ== 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=sayygcNPwLdmM4szSNCkmzUagOZS0siTnqqwZd3iNAI=; b=PtLG/6ENhAq33PWUNj79QOCn9yrAf9JNWhkUyL7GsoTrc+2J5kWoJvkIdVGdohD91Q o9S0dlIVMahSkkjdrm4pYLx1JZmz6BTkm+PmbtQUmFYwJyJLNSXJuA/SU0Gvv1Xit9+1 x51IhzN5WL10pr/kehl6Fwi4wHj8N1Bee0ZG3TnJOyQKItTL/2NlPmCFriZx6kb0hh87 xqnw3L0ovnl1G3RJVFGEhnardQTE9tB5G7aIt7G0b+k3mt6z588RxQwsrSm1cdb7201n eHu1E8G+FUSt2Npze5qujpk6pSQdX+O9zB8Pf3wpU3sv1Yl2iBkopb0ytevGLAGcZgsm x3fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=n4A35PqZ; 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 f26si5237900pfn.121.2018.03.29.18.30.43; Thu, 29 Mar 2018 18:30:57 -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=n4A35PqZ; 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 S1752455AbeC3B3d (ORCPT + 99 others); Thu, 29 Mar 2018 21:29:33 -0400 Received: from mail-pg0-f49.google.com ([74.125.83.49]:41575 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751865AbeC3B32 (ORCPT ); Thu, 29 Mar 2018 21:29:28 -0400 Received: by mail-pg0-f49.google.com with SMTP id t10so4173782pgv.8 for ; Thu, 29 Mar 2018 18:29:27 -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=sayygcNPwLdmM4szSNCkmzUagOZS0siTnqqwZd3iNAI=; b=n4A35PqZXVmwyW+a1egsOgyaMi3/BiQBoR48xczeYBJvCXanCJCoYB5KWDg2h16wNc eZvmAmj0Kbw+6XQa9l0Xz+iZ4IAPCrUgiwHMKqn+RV8Dxob3jDinOFHWmcFfCY4ELiU7 bKsxMUjH+2U9oo7Y0mw3Uzgu4Ztj790MaZtUdEr0ZqRTQ8CMEyH2uPrnKc4Kkm6l+myx EJZTwXktFKe7RIsM1jKdNqjrZ6gYNeMlZZKPf9bhXMO/nMRDZXFkfkkEa0sPF2gJPKQw y65Uql9gnRxN63SjK26rVTx0gxkJtodQMukAW+gXsWXPbXlMu0wm5+8AMnbJNeJ1mu43 cF0g== 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=sayygcNPwLdmM4szSNCkmzUagOZS0siTnqqwZd3iNAI=; b=sO/TrU8AXYRfI098zPFo+BPyXa4V2Aa01YVcoOUarfWneQtWumz+v1ec09Ahizm9/1 p6J2r6QpdWYwCR8H7Wyi8DBh2CHDQ+TEcePlbs89vla3GCwKmoWALGRon5vpiR6QW95T NV8hAieGypxc98zVnCW2mR8nGkE+08o+yvtQ5emg8CBlN1LsBTv3f8A6wKqC5YLzEqDM FxGmOzsplUmm8qPcKdN4RqzTDknuP6u7SEphlP09+0R1XwAYHyOLvnnHUMkyYGbfGhje D+fc6j+CeCW+fR48g4FXxEXQ47RW6zjeWu3iEruTdHAA2WMjuWRLNhtMs+8JZbuU6ZDA 9dLg== X-Gm-Message-State: AElRT7GhMQJjDGIywu9yqRsy8rjhQn4HDgR9hB6xDJKCjGzsT2KClFHJ Q3J3cMGM5MC3f5RRCzLVHRg= X-Received: by 2002:a17:902:9a44:: with SMTP id x4-v6mr11012296plv.332.1522373367139; Thu, 29 Mar 2018 18:29:27 -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 y23sm12217468pgv.4.2018.03.29.18.29.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Mar 2018 18:29:25 -0700 (PDT) Date: Fri, 30 Mar 2018 10:29:21 +0900 From: Minchan Kim To: Ganesh Mahendran Cc: LKML , Joe Perches , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , Todd Kjos , Greg Kroah-Hartman , Martijn Coenen Subject: Re: [PATCH v5] ANDROID: binder: change down_write to down_read Message-ID: <20180330012921.GB255979@rodete-desktop-imager.corp.google.com> References: <20180329065424.203172-1-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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. Thanks.