Received: by 10.223.176.5 with SMTP id f5csp1007754wra; Fri, 2 Feb 2018 09:36:12 -0800 (PST) X-Google-Smtp-Source: AH8x226iK/32FvVF3kqOUYtO+dTtcE9ND6W84BKPYgtNVg8V3SCvwK/t04dsRO69wNAFoDSoh7pq X-Received: by 10.98.201.199 with SMTP id l68mr41187694pfk.199.1517592972362; Fri, 02 Feb 2018 09:36:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517592972; cv=none; d=google.com; s=arc-20160816; b=aXf6LHCQELWDrCCxCn2D9OnO7ZeStCNB3e4onRdu51OLeH5IGmy+r/zq7m5kwL+K0L 74uldAYVnCEK3Z1lt7aFma/t8sQXQtdhOpL8AzrhlsFPa4xCnq2aPt6gDUWZq/T47Zg9 gHygkHhddwXMQTnhSH4DHfTgqQzULQXSL9QYehCJKq61KkXb2mG+Pgq3sGUowl2+W6KJ vfIMAIgd6EdSLgMq1xP7ibdhaaIYMxv0TdXicfnN61Pe26qJZQ/01yxtj0+9AV28cmjh 0wu4AIUiydE8cMoMoCW3EcCDQQ1UZvlL8vSZee4dKtdqFK5N+NJ4UT6Mq3uYNzycvxbA vZoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=QJJzDayzoABr3f9zrXuxSfhZN57YiX9sAih7rGsVJdk=; b=elqBE2uacyXNVcpX3YoYiP3RvfPS1oFnqi1iOtgsW/bjN750kHmbScyhiGHsERSIwd Zbp5aJbOGKeXn7SXVydE0OjTqMiVK56xcHXlsnB6dwkTvAHqK20KDA9AjuTHqlGV0CVU vv2IydMQssRJyAro1uFg59baevJQIqRVBGXs7NZtn2d8OGOEzRqp9m6MkwVvEAKs4d/O HUpXdv0yhlzg+5MYpaC+8H10zEFAJIIqGIJSMBgdxxiUtN9sweFYy5FDb6/ZYuLzCZ3q WhCPxQ2QD/lx1rtqLT0Rk2RmMw1+HP9BvZRtVnL7xPQFn+NiN2aDcMuZTprQhXI9hV0f djuQ== 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 v6-v6si82026plk.720.2018.02.02.09.35.57; Fri, 02 Feb 2018 09:36:12 -0800 (PST) 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 S1753733AbeBBRWa (ORCPT + 99 others); Fri, 2 Feb 2018 12:22:30 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39554 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753534AbeBBRNq (ORCPT ); Fri, 2 Feb 2018 12:13:46 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 44843F33; Fri, 2 Feb 2018 17:13:44 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ganesh Mahendran , Martijn Coenen , Todd Kjos Subject: [PATCH 4.14 145/156] android: binder: use VM_ALLOC to get vm area Date: Fri, 2 Feb 2018 17:58:46 +0100 Message-Id: <20180202140846.937885894@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180202140840.242829545@linuxfoundation.org> References: <20180202140840.242829545@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ganesh Mahendran commit aac6830ec1cb681544212838911cdc57f2638216 upstream. VM_IOREMAP is used to access hardware through a mechanism called I/O mapped memory. Android binder is a IPC machanism which will not access I/O memory. And VM_IOREMAP has alignment requiement which may not needed in binder. __get_vm_area_node() { ... if (flags & VM_IOREMAP) align = 1ul << clamp_t(int, fls_long(size), PAGE_SHIFT, IOREMAP_MAX_ORDER); ... } This patch will save some kernel vm area, especially for 32bit os. In 32bit OS, kernel vm area is only 240MB. We may got below error when launching a app: <3>[ 4482.440053] binder_alloc: binder_alloc_mmap_handler: 15728 8ce67000-8cf65000 get_vm_area failed -12 <3>[ 4483.218817] binder_alloc: binder_alloc_mmap_handler: 15745 8ce67000-8cf65000 get_vm_area failed -12 Signed-off-by: Ganesh Mahendran Acked-by: Martijn Coenen Acked-by: Todd Kjos Signed-off-by: Greg Kroah-Hartman --- drivers/android/binder_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -668,7 +668,7 @@ int binder_alloc_mmap_handler(struct bin goto err_already_mapped; } - area = get_vm_area(vma->vm_end - vma->vm_start, VM_IOREMAP); + area = get_vm_area(vma->vm_end - vma->vm_start, VM_ALLOC); if (area == NULL) { ret = -ENOMEM; failure_string = "get_vm_area";