All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Gordon <david.s.gordon@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
Cc: intel-gfx@lists.freedesktop.org, akash.goel@intel.com,
	shashidhar.hiremath@intel.com
Subject: Re: [PATCH 2/6] drm/i915: Support for creating Stolen memory backed objects
Date: Fri, 11 Dec 2015 12:49:37 +0000	[thread overview]
Message-ID: <566AC661.2070901@intel.com> (raw)
In-Reply-To: <566ABF61.70703@linux.intel.com>

On 11/12/15 12:19, Tvrtko Ursulin wrote:
>
> On 11/12/15 11:22, Ankitprasad Sharma wrote:
>> On Wed, 2015-12-09 at 14:06 +0000, Tvrtko Ursulin wrote:
>>> Hi,
>>>
>>> On 09/12/15 12:46, ankitprasad.r.sharma@intel.com wrote:
>>>> From: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
>>>>
[snip!]
>>>> +    /**
>>>> +     * Requested flags (currently used for placement
>>>> +     * (which memory domain))
>>>> +     *
>>>> +     * You can request that the object be created from special memory
>>>> +     * rather than regular system pages using this parameter. Such
>>>> +     * irregular objects may have certain restrictions (such as CPU
>>>> +     * access to a stolen object is verboten).
>>>> +     *
>>>> +     * This can be used in the future for other purposes too
>>>> +     * e.g. specifying tiling/caching/madvise
>>>> +     */
>>>> +    __u32 flags;
>>>> +#define I915_CREATE_PLACEMENT_STOLEN     (1<<0) /* Cannot use CPU
>>>> mmaps */
>>>> +#define __I915_CREATE_UNKNOWN_FLAGS
>>>> -(I915_CREATE_PLACEMENT_STOLEN << 1)
>>>
>>> I've asked in another reply, now that userspace can create a stolen
>>> object, what happens if it tries to use it for a batch buffer?
>>>
>>> Can it end up in the relocate_entry_cpu with a batch buffer allocated
>>> from stolen, which would then call i915_gem_object_get_page and crash?
>> Thanks for pointing it out.
>> Yes, this is definitely a possibility, if we allocate batchbuffers from
>> the stolen region. I have started working on that, to do
>> relocate_entry_stolen() if the object is allocated from stolen.
>
> Or perhaps it would be OK to just fail the execbuf?
>
> Just thinking to simplify things. Is it required (or expected) that
> users will need or want to create batch buffers from stolen?
>
> Regards,
> Tvrtko

Let's NOT have batchbuffers in stolen. Or anywhere else exotic, just in 
regular shmfs-backed GEM objects (no phys, userptr, or dma_buf either).
And I'd rather contexts and ringbuffers weren't placed there either, 
because the CPU needs to write those all the time. All special-purpose 
GEM objects should be usable ONLY as data buffers for the GPU, or for 
CPU access with pread/pwrite. The objects that the kernel needs to 
understand and manipulate (contexts, ringbuffers, and batches) should 
always be default (shmfs-backed) GEM objects, so that we don't have to 
propagate the understanding of all the exceptional cases into a 
multitude of different kernel functions.

Oh, and I'd suggest that once we have more than two GEM object types, 
the pread/pwrite operations should be extracted and turned into vfuncs 
rather than adding complexity to the common ioctl/shmfs path.

.Dave.

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-12-11 12:49 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-09 12:46 [PATCH v10 0/6] Support for creating/using Stolen memory backed objects ankitprasad.r.sharma
2015-12-09 12:46 ` [PATCH 1/6] drm/i915: Clearing buffer objects via CPU/GTT ankitprasad.r.sharma
2015-12-09 13:26   ` Dave Gordon
2015-12-10 10:02     ` Ankitprasad Sharma
2015-12-09 13:30   ` Tvrtko Ursulin
2015-12-09 13:57   ` Tvrtko Ursulin
2015-12-10 10:23     ` Ankitprasad Sharma
2015-12-09 13:57   ` Chris Wilson
2015-12-10 10:27     ` Ankitprasad Sharma
2015-12-09 12:46 ` [PATCH 2/6] drm/i915: Support for creating Stolen memory backed objects ankitprasad.r.sharma
2015-12-09 14:06   ` Tvrtko Ursulin
2015-12-11 11:22     ` Ankitprasad Sharma
2015-12-11 12:19       ` Tvrtko Ursulin
2015-12-11 12:49         ` Dave Gordon [this message]
2015-12-11 18:13           ` Daniel Vetter
2015-12-09 12:46 ` [PATCH 3/6] drm/i915: Propagating correct error codes to the userspace ankitprasad.r.sharma
2015-12-09 15:10   ` Tvrtko Ursulin
2015-12-09 12:46 ` [PATCH 4/6] drm/i915: Add support for stealing purgable stolen pages ankitprasad.r.sharma
2015-12-09 15:40   ` Tvrtko Ursulin
2015-12-09 12:46 ` [PATCH 5/6] drm/i915: Support for pread/pwrite from/to non shmem backed objects ankitprasad.r.sharma
2015-12-09 16:15   ` Tvrtko Ursulin
2015-12-09 19:39     ` Dave Gordon
2015-12-10 11:12       ` Ankitprasad Sharma
2015-12-10 18:18         ` Dave Gordon
2015-12-11  5:22           ` Ankitprasad Sharma
2015-12-11 18:15       ` Daniel Vetter
2015-12-15 16:22         ` Dave Gordon
2015-12-10 10:54     ` Ankitprasad Sharma
2015-12-10 11:00       ` Ankitprasad Sharma
2015-12-09 12:46 ` [PATCH 6/6] drm/i915: Migrate stolen objects before hibernation ankitprasad.r.sharma
2015-12-09 17:25   ` Tvrtko Ursulin
2015-12-09 19:24     ` Ville Syrjälä
2015-12-10 13:17     ` Ankitprasad Sharma
2015-12-09 19:35   ` Dave Gordon
2015-12-10  9:43   ` Tvrtko Ursulin
2015-12-10 13:17     ` Ankitprasad Sharma
2015-12-10 14:15       ` Tvrtko Ursulin
2015-12-10 18:00         ` Dave Gordon
2015-12-11  5:19           ` Ankitprasad Sharma
2015-12-11  5:16         ` Ankitprasad Sharma
2015-12-11 12:33           ` Tvrtko Ursulin
  -- strict thread matches above, loose matches on Subject: below --
2015-11-11 10:36 [PATCH v9 0/6] Support for creating/using Stolen memory backed objects ankitprasad.r.sharma
2015-11-11 10:36 ` [PATCH 2/6] drm/i915: Support for creating " ankitprasad.r.sharma
2015-11-11 11:41   ` Chris Wilson
2015-12-07 13:43   ` Tvrtko Ursulin
2015-12-10  8:40     ` Daniel Vetter
2015-10-08  6:24 [PATCH v8 0/6] Support for creating/using " ankitprasad.r.sharma
2015-10-08  6:24 ` [PATCH 2/6] drm/i915: Support for creating " ankitprasad.r.sharma

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=566AC661.2070901@intel.com \
    --to=david.s.gordon@intel.com \
    --cc=akash.goel@intel.com \
    --cc=ankitprasad.r.sharma@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=shashidhar.hiremath@intel.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    /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.