Received: by 10.223.176.46 with SMTP id f43csp302421wra; Tue, 23 Jan 2018 21:26:42 -0800 (PST) X-Google-Smtp-Source: AH8x224AHj7zZ3koas8aU1dADzuhD7HK/B6QEzzvsHKPw0QtvA0MQ0wmccuCWZfEyX9FYwqWvaHb X-Received: by 2002:a17:902:860a:: with SMTP id f10-v6mr7020347plo.292.1516771602308; Tue, 23 Jan 2018 21:26:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516771602; cv=none; d=google.com; s=arc-20160816; b=ICKm/JzDmUs2Yc3Pu6jnIEsxLa7b7lhPZ+gvgKZaBMuwvSXVAT80M62LaoAT1xKL44 S9+ugCRmuZUsWzSE2BkpaYgpGTzfpPb3IpETwD2ER4On9HcxaenUuFxvrXPcE1mndJh0 UgnKFDRRXKi0Bppe3l/YHcfv+ZrAJ+j9tt+eu+jyjk63d84dP863rpZcRNZDygbP5GVA whmYeP9e2zb1mGZ4/5rNmuocJhjHZLlLB6FPzAhAb2fEP6dtYgRE4oTIpUxs4ORW63bP YOLXVVsoblo9tJ+ueL8HZoyRGgk6xQbSuYcjhfSeRD+tANd6VMP7/4jBD0oGJ9S3okvE kfzg== 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=mlCYvUc4t2JbqbRRxdeVc69aJXG4TDeLss1/Nt3ejxM=; b=xJsmIU9Zb6BTJ+gNqx+8gFaq48F+9Ebtziynl82bbskVQbLB0Xw5QcBI7iaeZrNuQ2 96L0idVhilrIFkaW8E9iMM50NezK8+0cDt1wWH+Jm5FRDMtu9EJ9ESNloWfOhpHHoz8A Z24fALwfR4dAucTINrneM+pvpuWN69aHAcIUReWcreuR2YkSdw8w8kwrACZQYM+w5mcz 6b0p0f3sO0W7ZqYJRGmG/5PlCzY3HjU6/en6lfzKuXBgZQu5LjScKMvGaNHkZ33284E1 jYMTQpesufxzeTeI7o+QtGgkQ1pjMWaYZrHTeUzpg7YeJ3CMtePhK1XdfDWv/rvDSV6R yTyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=icG6p+hi; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u10si6089356pgp.222.2018.01.23.21.26.18; Tue, 23 Jan 2018 21:26:42 -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=@gmail.com header.s=20161025 header.b=icG6p+hi; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752265AbeAXFYt (ORCPT + 99 others); Wed, 24 Jan 2018 00:24:49 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:37536 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751081AbeAXFYs (ORCPT ); Wed, 24 Jan 2018 00:24:48 -0500 Received: by mail-it0-f65.google.com with SMTP id q8so3741344itb.2 for ; Tue, 23 Jan 2018 21:24:48 -0800 (PST) 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:content-transfer-encoding; bh=mlCYvUc4t2JbqbRRxdeVc69aJXG4TDeLss1/Nt3ejxM=; b=icG6p+hi/9Fn7K+8498QqHfLYbtGCcmKGjOltEzsDcw9DhVRrU2uNI5u/Tf7GjMK9E cgICa49SJ7rIlCIWriy1cQy6T77dyMEUjeKjnRe02U1CAyO00lrk8srvGcfT95seqb3L NxADe3qYKCuET21ITS4EjZDcvs2SHU2ZUM26bUpNNmETdlIhApfSljW6658149x276Xf uh0bwsoF6b+iKDklOo1p53Pm3rMNt5vHONzIgES3didsC8jL++FxcWG1gy4T4tmkErOV CxZyC7GRkFDGBu5712F7FqZVSlzGV0g2pBsA7IdXlvSpE9pTS7sExzxeC09MwATQbs8j CBDg== 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=mlCYvUc4t2JbqbRRxdeVc69aJXG4TDeLss1/Nt3ejxM=; b=QOvoOIHv5w3Q/4+ZKiiXvmh03WVfHKRnbJxaotxXOfFZhZxtncxAkx31ez56asD2Ok 5OXDrXhKum/jVXiDIX2iVpZxrWQDisuANBtwQE5blVdEJhmmJhyY1LUbj3e7ptbmgJ5g EOtI6JQzulg9C8ZSTljmUZVPfEls1XCh9auNEqa02ZUncLwaim1OFJWeZToIDXJdzsvD RdCPmd96RHzRLIowyAYoFWynus4yUXcNw4fiNvyJf4bVphiX8bRde8A3KkH/wLfB7ab7 g3DytWBoUhWBOTjIFFz8e8qx3m72wXySDRHw8TW4SmOiUmkwSSGWLw3ZGBbF56MMhN8+ PNAw== X-Gm-Message-State: AKwxytehV/HJLMS/DsMzj7hTl9hR6EWH8gdCTy1IlloOzZq0pMlFhiw7 IhTVMuH3dXy8Ahcg81otmx7LCPyos30UHeANbus= X-Received: by 10.36.198.197 with SMTP id j188mr7249580itg.76.1516771487758; Tue, 23 Jan 2018 21:24:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.59.75 with HTTP; Tue, 23 Jan 2018 21:24:47 -0800 (PST) In-Reply-To: References: <1515552545-18311-1-git-send-email-opensource.ganesh@gmail.com> <20180122155428.GB7714@kroah.com> From: Ganesh Mahendran Date: Wed, 24 Jan 2018 13:24:47 +0800 Message-ID: Subject: Re: [PATCH v3] android: binder: use VM_ALLOC to get vm area To: =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= Cc: Todd Kjos , Greg KH , 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 Hi, Arve: 2018-01-23 2:55 GMT+08:00 Arve Hj=C3=B8nnev=C3=A5g : > On Mon, Jan 22, 2018 at 9:02 AM, Todd Kjos wrote: >> On Mon, Jan 22, 2018 at 7:54 AM, Greg KH wr= ote: >>> 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 8ce67= 000-8cf65000 get_vm_area failed -12 >>>> <3>[ 4483.218817] binder_alloc: binder_alloc_mmap_handler: 15745 8ce67= 000-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_IOREM= AP? >> > > I don't remember for sure, but I think it used alloc_vm_area at some > point, and that uses VM_IOREMAP. Yes, in alloc_vm_area(), it uses VM_IOREMAP flag. In binder, the ~1MB vm area is cut into binder_buffer which is not even page aligned. So for binder IPC, there is no need to align vm area(512KB now). For 64 bit OS, the vm area is very big, but for 32 bit OS, default vm area is only 240. The vm area will soon be exhausted, then no app can be launched. Thanks. > > -- > Arve Hj=C3=B8nnev=C3=A5g