From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753847AbcFGHGZ (ORCPT ); Tue, 7 Jun 2016 03:06:25 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:33442 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbcFGHGX (ORCPT ); Tue, 7 Jun 2016 03:06:23 -0400 Subject: Re: [Linaro-mm-sig] [RFC][PATCH 0/6] ion: improved ABI To: Laura Abbott , Sumit Semwal , John Stultz , =?UTF-8?Q?Arve_Hj=c3=b8nnev=c3=a5g?= , Riley Andrews References: <1465237413-10549-1-git-send-email-labbott@redhat.com> CC: , Jon Medhurst , "Android Kernel Team" , Liviu Dudau , , , "Jeremy Gebben" , Eun Taik Lee , Greg Kroah-Hartman From: Chen Feng Message-ID: <575670BF.5070808@hisilicon.com> Date: Tue, 7 Jun 2016 14:59:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1465237413-10549-1-git-send-email-labbott@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.142.193.64] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.575670F9.00ED,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 4d4b55f45c843227f3ddbdd6bcab029f Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The idea is good, define the heap ids in header file is inconvenient. But if we query the heaps information from user-space. It need to maintain this ids and name userspace one by one. The code may be complicated in different module user-space. In android, the gralloc and other lib will all use ion to alloc memory. This will make it more difficult to maintain user-space code. But beyond this, The new alloc2 with not-handle flag is good. And the pull out of ioctl interface is also a good cleanup. On 2016/6/7 2:23, Laura Abbott wrote: > > The ABI for Ion's ioctl interface are a pain to work with. The heap IDs > are a 32-bit non-discoverable namespace that form part of the ABI. There's > no way to determine what ABI version is in use which leads to problems > if the ABI changes or needs to be updated. > > This series is a first approach to give a better ABI for Ion. This includes: > > - Following the advice in botching-up-ioctls.txt > - Ioctl for ABI version > - Dynamic assignment of heap ids > - queryable heap ids > - Runtime mapping of heap ids, including fallbacks. This avoids the need to > encode the fallbacks as an ABI. > > I'm most interested in feedback if this ABI is actually an improvement and > usable. The heap id map/query interface seems error prone but I didn't have > a cleaner solution. There aren't any kernel APIs for the new features as the > focus was on a userspace API but I anticipate that following easily once > the userspace API is established. > > > Thanks, > Laura > > P.S. Not to turn this into a bike shedding session but if you have suggestions > for a name for this framework other than Ion I would be interested to hear > them. Too many other things are already named Ion. > > Laura Abbott (6): > staging: android: ion: return error value for ion_device_add_heap > staging: android: ion: Switch to using an idr to manage heaps > staging: android: ion: Drop heap type masks > staging: android: ion: Pull out ion ioctls to a separate file > staging: android: ion: Add an ioctl for ABI checking > staging: android: ion: Introduce new ioctls for dynamic heaps > > drivers/staging/android/ion/Makefile | 3 +- > drivers/staging/android/ion/ion-ioctl.c | 243 ++++++++++++++++++ > drivers/staging/android/ion/ion.c | 438 ++++++++++++++++---------------- > drivers/staging/android/ion/ion_priv.h | 109 +++++++- > drivers/staging/android/uapi/ion.h | 164 +++++++++++- > 5 files changed, 728 insertions(+), 229 deletions(-) > create mode 100644 drivers/staging/android/ion/ion-ioctl.c >