Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933932AbeAJCtQ (ORCPT + 1 other); Tue, 9 Jan 2018 21:49:16 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:33556 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933033AbeAJCtP (ORCPT ); Tue, 9 Jan 2018 21:49:15 -0500 X-Google-Smtp-Source: ACJfBouSlRPvKvBqCUcgy+sC0L3Y1FsHkzF1ysPOyAEZIPLod/iF4aHURFoqo/TsTa1Q3HM1MRc9vA== From: Ganesh Mahendran To: gregkh@linuxfoundation.org, maco@android.com, tkjos@google.com, arve@android.com Cc: linux-kernel@vger.kernel.org, Ganesh Mahendran Subject: [PATCH v3] android: binder: use VM_ALLOC to get vm area Date: Wed, 10 Jan 2018 10:49:05 +0800 Message-Id: <1515552545-18311-1-git-send-email-opensource.ganesh@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 ---- V3: update comments V2: update comments --- drivers/android/binder_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index 07b866a..5a426c8 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -670,7 +670,7 @@ int binder_alloc_mmap_handler(struct binder_alloc *alloc, 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"; -- 1.9.1