Received: by 10.223.176.46 with SMTP id f43csp3257072wra; Mon, 22 Jan 2018 10:56:18 -0800 (PST) X-Google-Smtp-Source: AH8x225o5I3WRTCs3b9vK74jFvvJ5Vpn0MZxN2etGlVP4gw1WvFsYh3LJS7YPfm/GcHO4HJEcGYE X-Received: by 10.36.121.211 with SMTP id z202mr9045825itc.107.1516647378866; Mon, 22 Jan 2018 10:56:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516647378; cv=none; d=google.com; s=arc-20160816; b=jFYeEWiHiW1kpnsMnVthHq8YN1vxsZXRoXK28LZH2UbiP3Jb/5tRG4rXXvUm9GtN61 j0Pz/H7xnGc7Qiwjn1AqSBetkDe8q3C4Y5exL73WYhL96o9MofsYM9KnchElMS/pHIS1 VbyUIJcDHKDe1Zv7CJPWbTK99KWb3yTPWKQJuwMxLsbPx/JtF14oKTsXh81sSnPIji7D V6zeSZoY5pgq7FadMH5frVHrvhTqodGXFKf2loDl/fJv+jJKwiufWAZiuhw1VZiFGpfZ zziSQPYtH5yKRiFegcpVcqZWHby2bvc7owmZCxys0b9BnWBjylTz6sdo7X1zRLQuJVM0 6BVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=a7BSkL+5B/IIDwQ+lRPQhcL931Qni1H6WFcarYCvnAs=; b=hXoNeUXaYnRwjDSHqjcMbqi54eLuLUrt8eFmoEeK34KPF7AlehfrHvZpGJRCsPpGPf QYE9C0mchanKXVIprkWjz9oUL17NqBfeov/Mg8bbT8WtzKrs5SWC+RKp0OGdfC0QGo5n uVucBfP8d0TxhTDfZRP7McKCoFI/4VC4NKXUqkc0VOE+DEcgbh+0a7nDWzYxdNr4m+80 pdAdewejNi/GHQ7FhAU8KxzwuO0TYiCpgdY4zOP94PJLgd74VlYFr0CEP/1X15sga/OF SiVw1nydDlaIsRzcTt5UzxUANM0m+xO8wVKr5QJsMDrczCoNN9eIOpXCwydFnpZdu/KV 6TQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b=WidaL6ab; 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=NONE dis=NONE) header.from=android.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1si10115016iob.113.2018.01.22.10.56.06; Mon, 22 Jan 2018 10:56:18 -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; dkim=pass header.i=@android.com header.s=20161025 header.b=WidaL6ab; 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=NONE dis=NONE) header.from=android.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751810AbeAVSzV (ORCPT + 99 others); Mon, 22 Jan 2018 13:55:21 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35548 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751121AbeAVSzT (ORCPT ); Mon, 22 Jan 2018 13:55:19 -0500 Received: by mail-wm0-f66.google.com with SMTP id r78so18921093wme.0 for ; Mon, 22 Jan 2018 10:55:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=a7BSkL+5B/IIDwQ+lRPQhcL931Qni1H6WFcarYCvnAs=; b=WidaL6abwefpt3e2R97oKDvX/I2GEugbxMfKoPdmaYQ3179wdqwymbNE+Lyib5dd58 lRZfGdHKrSqqNQk3xPN0KUAMPCmQ16GwR3GkHkuc/5wHl6BQ9YTylBdGtdSH0lf4FYdY q6Q4mFtQbrVUuIAHviJLEJGEsikU9zXC2U4NTfXZ0PPYBoZET3HY8YAJhKgS5kg8Prwq HsFGeSKQLJOhpEmFB2Bwx05zekfYyAvU1gY1jjQWtpBDDTCQl2WISFU0lQn424kpxgfq Od7HVHEFnwzyz0EQvCvy7D7ZYjKbUVdrMOA6uFgdK3oW4rVQ7jR8R4eOaLbV2Rg+41Gc WxAA== 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:content-transfer-encoding; bh=a7BSkL+5B/IIDwQ+lRPQhcL931Qni1H6WFcarYCvnAs=; b=ca1F70sa9v8d28EdeifvqE2TSy4PdUrBPDRDBHL9teKN1Lv1sYbh9b0pfTgFI5GAPZ 8C8LpOtt4ZCQbr6cQWRw58GDTKJvLj5Gm4P1vfVVP28SusO18CATJFhy3qIw/3OZyOjc 6sl2U8RC91Gkl3QLbyf3NW5Lx/jMs4yZR4vJ2JXSBmo9jt1gvewv4FcSYgDIRyUZuRNF OfndMeveu7LDXrLYerGWI60rbF/Y8yvKvwFov8h4VCB5GIKRkknWITVnTPyUhLQeilPD 7lGwTlvVV54Tb0shn8Z8hdUf2fZxO8y1OLTcXBLjObrlXyPOy4d1klmrE6ugsdmrxySI OIDA== X-Gm-Message-State: AKwxytej64T0LTarQoA//PU6+ZQtYDgPf8jUkbUzI8CFujjPqdaapUJD 7Bo+Unbmlw5/56i4vzBoSMsX4t782xS/dcn7r69A7hDO X-Received: by 10.80.219.1 with SMTP id o1mr14630102edk.301.1516647318144; Mon, 22 Jan 2018 10:55:18 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.146.55 with HTTP; Mon, 22 Jan 2018 10:55:17 -0800 (PST) In-Reply-To: References: <1515552545-18311-1-git-send-email-opensource.ganesh@gmail.com> <20180122155428.GB7714@kroah.com> From: =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= Date: Mon, 22 Jan 2018 10:55:17 -0800 Message-ID: Subject: Re: [PATCH v3] android: binder: use VM_ALLOC to get vm area To: Todd Kjos Cc: Greg KH , Ganesh Mahendran , Martijn Coenen , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 22, 2018 at 9:02 AM, Todd Kjos wrote: > On Mon, Jan 22, 2018 at 7:54 AM, Greg KH wro= te: >> On Wed, Jan 10, 2018 at 10:49:05AM +0800, Ganesh Mahendran wrote: >>> 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 =3D 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 8ce670= 00-8cf65000 get_vm_area failed -12 >>> <3>[ 4483.218817] binder_alloc: binder_alloc_mmap_handler: 15745 8ce670= 00-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(-) >> >> Martijn and Todd, any objections to this patch? > > Looks fine to me. Arve, do you remember the rationale for using VM_IOREMA= P? > I don't remember for sure, but I think it used alloc_vm_area at some point, and that uses VM_IOREMAP. --=20 Arve Hj=C3=B8nnev=C3=A5g