mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brian Starkey <brian.starkey@arm.com>
To: Laura Abbott <labbott@redhat.com>
Cc: "Sumit Semwal" <sumit.semwal@linaro.org>,
	"John Stultz" <john.stultz@linaro.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Riley Andrews" <riandrews@android.com>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	linaro-mm-sig@lists.linaro.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org,
	"Eun Taik Lee" <eun.taik.lee@samsung.com>,
	"Liviu Dudau" <Liviu.Dudau@arm.com>,
	"Jon Medhurst" <tixy@linaro.org>,
	"Mitchel Humpherys" <mitchelh@codeaurora.org>,
	"Jeremy Gebben" <jgebben@codeaurora.org>,
	"Bryan Huntsman" <bryanh@codeaurora.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Android Kernel Team" <kernel-team@android.com>
Subject: Re: [RFC][PATCH 0/6] ion: improved ABI
Date: Wed, 8 Jun 2016 16:15:10 +0100	[thread overview]
Message-ID: <20160608151510.GA6757@e106950-lin.cambridge.arm.com> (raw)
In-Reply-To: <1465237413-10549-1-git-send-email-labbott@redhat.com>

Hi Laura,

On Mon, Jun 06, 2016 at 11:23:27AM -0700, 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.
>

If I understand it right, the big improvement here is that userspace can
find out what heap IDs are available, and what type of heap they
correspond to? This seems good.

I'm not sure about how userspace is meant to use the usage mappings
though. Who calls ION_IOC_ID_MAP?

(also, map/mapping is pretty overloaded. How about groups/groupings?)

If I assume that the thing calling ION_IOC_ID_MAP is the same thing
doing the allocating, then there doesn't seem to be much need for
creating mappings. The combined mapper/allocator would necessarily need
some knowledge about which types can satisfy which usage, and so could
follow something like this:
  1. The heaps can be queried, finding their IDs and types
  2. A mask of heap IDs can be created which satisfies a "usage", based
     on the queried types
  3. Allocation operations can then simply use this constructed mask

On the other hand, if I assume that the thing doing the allocating is
different to the thing doing the usage mapping (i.e. the allocator
doesn't need to know about heap _types_, only usages); then I can't see
a way for the allocator to figure out which usage_id it's meant to
allocate with - which puts it right back to the old problem of opaque
heap IDs (-> opaque usage_ids), except it's worse because they can
change dynamically.

Thanks,
Brian

>
>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
>
>-- 2.5.5

  parent reply	other threads:[~2016-06-08 15:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-06 18:23 Laura Abbott
2016-06-06 18:23 ` [RFC][PATCH 1/6] staging: android: ion: return error value for ion_device_add_heap Laura Abbott
2016-06-08 13:02   ` Liviu Dudau
2016-06-06 18:23 ` [RFC][PATCH 2/6] staging: android: ion: Switch to using an idr to manage heaps Laura Abbott
2016-06-08 13:13   ` Liviu Dudau
2016-06-06 18:23 ` [RFC][PATCH 3/6] staging: android: ion: Drop heap type masks Laura Abbott
2016-06-06 18:23 ` [RFC][PATCH 4/6] staging: android: ion: Pull out ion ioctls to a separate file Laura Abbott
2016-06-08 13:20   ` Liviu Dudau
2016-06-06 18:23 ` [RFC][PATCH 5/6] staging: android: ion: Add an ioctl for ABI checking Laura Abbott
2016-06-06 18:23 ` [RFC][PATCH 6/6] staging: android: ion: Introduce new ioctls for dynamic heaps Laura Abbott
2016-06-08 13:50   ` Liviu Dudau
2016-06-08 17:35     ` Laura Abbott
2016-06-08 15:34   ` Brian Starkey
2016-06-08 19:14     ` Laura Abbott
2016-06-09  8:25       ` Brian Starkey
2016-06-07  6:59 ` [Linaro-mm-sig] [RFC][PATCH 0/6] ion: improved ABI Chen Feng
2016-06-08 17:29   ` Laura Abbott
2016-06-08 15:15 ` Brian Starkey [this message]
2016-06-08 18:58   ` Laura Abbott

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160608151510.GA6757@e106950-lin.cambridge.arm.com \
    --to=brian.starkey@arm.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=arve@android.com \
    --cc=bryanh@codeaurora.org \
    --cc=daniel.vetter@ffwll.ch \
    --cc=devel@driverdev.osuosl.org \
    --cc=eun.taik.lee@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgebben@codeaurora.org \
    --cc=john.stultz@linaro.org \
    --cc=kernel-team@android.com \
    --cc=labbott@redhat.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mitchelh@codeaurora.org \
    --cc=riandrews@android.com \
    --cc=sumit.semwal@linaro.org \
    --cc=tixy@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®