All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laura Abbott <lauraa@codeaurora.org>
To: Sumit Semwal <sumit.semwal@linaro.org>, linux-kernel@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org, linaro-kernel@lists.linaro.org,
	dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org
Subject: Re: [Linaro-mm-sig] [RFC 0/4] dma-buf Constraints-Enabled Allocation helpers
Date: Mon, 13 Oct 2014 01:12:30 -0700	[thread overview]
Message-ID: <543B896E.4030600@codeaurora.org> (raw)
In-Reply-To: <1412971678-4457-1-git-send-email-sumit.semwal@linaro.org>

On 10/10/2014 1:07 PM, Sumit Semwal wrote:
> Hi,
>
> Why:
> ====
>   While sharing buffers using dma-buf, currently there's no mechanism to let
> devices share their memory access constraints with each other to allow for
> delayed allocation of backing storage.
>
> This RFC attempts to introduce the idea of memory constraints of a device,
> and how these constraints can be shared and used to help allocate buffers that
> can satisfy requirements of all devices attached to a particular dma-buf.
>
> How:
> ====
>   A constraints_mask is added to dma_parms of the device, and at the time of
> each device attachment to a dma-buf, the dma-buf uses this constraints_mask
> to calculate the access_mask for the dma-buf.
>
> Allocators can be defined for each of these constraints_masks, and then helper
> functions can be used to allocate the backing storage from the matching
> allocator satisfying the constraints of all devices interested.
>
> A new miscdevice, /dev/cenalloc [1] is created, which acts as the dma-buf
> exporter to make this transparent to the devices.
>
> More details in the patch description of "cenalloc: Constraint-Enabled
> Allocation helpers for dma-buf".
>
>
> At present, the constraint_mask is only a bitmask, but it should be possible to
> change it to a struct and adapt the constraint_mask calculation accordingly,
> based on discussion.
>
>
> Important requirement:
> ======================
>   Of course, delayed allocation can only work if all participating devices
> will wait for other devices to have 'attached' before mapping the buffer
> for the first time.
>
> As of now, users of dma-buf(drm prime, v4l2 etc) call the attach() and then
> map_attachment() almost immediately after it. This would need to be changed if
> they were to benefit from constraints.
>
>
> What 'cenalloc' is not:
> =======================
> - not 'general' allocator helpers - useful only for constraints-enabled
>    devices that share buffers with others using dma-buf.
> - not a replacement for existing allocation mechanisms inside various
>    subsystems; merely a possible alternative.
> - no page-migration - it would be very complementary to the delayed allocation
>     suggested here.
>
> TODOs:
> ======
> - demonstration test cases
> - vma helpers for allocators
> - more sample allocators
> - userspace ioctl (It should be a simple one, and we have one ready, but wanted
>     to agree on the kernel side of things first)
>
>

I'm interested to see the userspace ioctl. The mask based approach of
Ion does not scale well to a userspace ABI so I'm curious if cenalloc
does better.

Thanks,
Laura

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

  parent reply	other threads:[~2014-10-13  8:12 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-10 20:07 [RFC 0/4] dma-buf Constraints-Enabled Allocation helpers Sumit Semwal
2014-10-10 20:07 ` Sumit Semwal
2014-10-10 20:07 ` [RFC 1/4] dma-buf: Add constraints sharing information Sumit Semwal
2014-10-10 20:07   ` Sumit Semwal
2014-10-11 18:55   ` Daniel Vetter
2014-10-11 18:55     ` Daniel Vetter
2014-10-13  8:14     ` [Linaro-mm-sig] " Laura Abbott
2014-10-13  9:32       ` Daniel Vetter
2014-10-13  9:32         ` Daniel Vetter
2014-12-10 13:31     ` Sumit Semwal
2014-12-10 13:31       ` Sumit Semwal
2014-12-10 13:47       ` Daniel Vetter
2014-12-10 13:47         ` Daniel Vetter
2015-01-08 14:14         ` [Linaro-mm-sig] " Benjamin Gaignard
2014-10-10 20:07 ` [RFC 2/4] cenalloc: Constraint-Enabled Allocation helpers for dma-buf Sumit Semwal
2014-10-10 20:07   ` Sumit Semwal
2014-10-10 23:09   ` Greg Kroah-Hartman
2014-10-10 23:09     ` Greg Kroah-Hartman
2014-10-11 18:40     ` Daniel Vetter
2014-10-11 18:40       ` Daniel Vetter
2014-10-14 14:03       ` Sumit Semwal
2014-10-14 14:03         ` Sumit Semwal
2014-10-13  8:35   ` [Linaro-mm-sig] " Laura Abbott
2014-10-14 14:11     ` Sumit Semwal
2014-10-10 20:07 ` [RFC 3/4] cenalloc: Build files for constraint-enabled allocation helpers Sumit Semwal
2014-10-10 20:07 ` [RFC 4/4] cenalloc: a sample allocator for contiguous page allocation Sumit Semwal
2014-10-10 20:07   ` Sumit Semwal
2014-10-13  8:12 ` Laura Abbott [this message]
2014-10-14 14:00   ` [Linaro-mm-sig] [RFC 0/4] dma-buf Constraints-Enabled Allocation helpers Sumit Semwal
2014-10-14 14:00     ` Sumit Semwal

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=543B896E.4030600@codeaurora.org \
    --to=lauraa@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=sumit.semwal@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.