public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Andrzej Hajda <andrzej.hajda@intel.com>
To: Jonathan Cavitt <jonathan.cavitt@intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: andi.shyti@intel.com, matthew.d.roper@intel.com,
	tomasz.mistat@intel.com, rodrigo.vivi@intel.com,
	gregory.f.germano@intel.com, chris.p.wilson@linux.intel.com,
	nirmoy.das@intel.com
Subject: Re: [Intel-gfx] [PATCH v12 2/4] drm/i915: Reserve some kernel space per vm
Date: Wed, 18 Oct 2023 15:17:05 +0200	[thread overview]
Message-ID: <02d52c92-50d4-420d-959e-3a2447f49e28@intel.com> (raw)
In-Reply-To: <20230920210704.3624771-3-jonathan.cavitt@intel.com>

On 20.09.2023 23:07, Jonathan Cavitt wrote:
> Reserve two pages in each vm for kernel space to use for things
> such as workarounds.
> 
> Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> Suggested-by: Chris Wilson <chris.p.wilson@linux.intel.com>
> ---
>   drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 7 +++++++
>   drivers/gpu/drm/i915/gt/intel_gtt.h  | 1 +
>   2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
> index 84aa29715e0ac..6344d733fb2c4 100644
> --- a/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
> +++ b/drivers/gpu/drm/i915/gt/gen8_ppgtt.c
> @@ -230,6 +230,7 @@ static void gen8_ppgtt_cleanup(struct i915_address_space *vm)
>   				     gen8_pd_top_count(vm), vm->top);
>   
>   	free_scratch(vm);
> +	drm_mm_remove_node(&vm->rsvd);
>   }
>   
>   static u64 __gen8_ppgtt_clear(struct i915_address_space * const vm,
> @@ -1014,6 +1015,12 @@ struct i915_ppgtt *gen8_ppgtt_create(struct intel_gt *gt,
>   	ppgtt->vm.foreach = gen8_ppgtt_foreach;
>   	ppgtt->vm.cleanup = gen8_ppgtt_cleanup;
>   
> +	ppgtt->vm.rsvd.start = ppgtt->vm.total - (SZ_4K * 2);
> +	ppgtt->vm.rsvd.size = (SZ_4K * 2);
> +	ppgtt->vm.rsvd.color = I915_COLOR_UNEVICTABLE;
> +	GEM_BUG_ON(drm_mm_reserve_node(&ppgtt->vm.mm, &ppgtt->vm.rsvd));
> +	ppgtt->vm.total -= (SZ_4K * 2);

I suspect you shouldn't decrease vm.total, otherwise api_intel_bb CI 
tests will complain and I guess vm.total means total, ie it should 
include reserved nodes as well.
Btw why not use i915_gem_gtt_reserve instead of hardcoding, I do not 
know this helper but it looks like good fit.

Regards
Andrzej


> +
>   	err = gen8_init_scratch(&ppgtt->vm);
>   	if (err)
>   		goto err_put;
> diff --git a/drivers/gpu/drm/i915/gt/intel_gtt.h b/drivers/gpu/drm/i915/gt/intel_gtt.h
> index 153ddfca0ae18..680ce27dda40c 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gtt.h
> +++ b/drivers/gpu/drm/i915/gt/intel_gtt.h
> @@ -247,6 +247,7 @@ struct i915_address_space {
>   	struct work_struct release_work;
>   
>   	struct drm_mm mm;
> +	struct drm_mm_node rsvd;
>   	struct intel_gt *gt;
>   	struct drm_i915_private *i915;
>   	struct device *dma;


  reply	other threads:[~2023-10-18 13:17 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20 21:07 [Intel-gfx] [PATCH v12 0/4] Apply Wa_16018031267 / Wa_16018063123 Jonathan Cavitt
2023-09-20 21:07 ` [Intel-gfx] [PATCH v12 1/4] drm/i915: Enable NULL PTE support for vm scratch Jonathan Cavitt
2023-10-18 13:11   ` Andrzej Hajda
2023-09-20 21:07 ` [Intel-gfx] [PATCH v12 2/4] drm/i915: Reserve some kernel space per vm Jonathan Cavitt
2023-10-18 13:17   ` Andrzej Hajda [this message]
2023-09-20 21:07 ` [Intel-gfx] [PATCH v12 3/4] drm/i915: Add WABB blit for Wa_16018031267 / Wa_16018063123 Jonathan Cavitt
2023-10-18 13:24   ` Andrzej Hajda
2023-10-18 13:39     ` Nirmoy Das
2023-09-20 21:07 ` [Intel-gfx] [PATCH v12 4/4] drm/i915: Set copy engine arbitration " Jonathan Cavitt
2023-10-18 13:26   ` Andrzej Hajda
2023-09-21  2:12 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Apply " Patchwork
2023-09-21  2:12 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-09-21  2:24 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-09-21  9:54 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-09-22  2:51 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Apply Wa_16018031267 / Wa_16018063123 (rev2) Patchwork
2023-09-22  2:51 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-09-22  3:12 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-09-23  4:25 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Apply Wa_16018031267 / Wa_16018063123 (rev3) Patchwork
2023-09-23  4:25 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-09-23  4:39 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-09-24  8:56 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-10-17 13:33 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Apply Wa_16018031267 / Wa_16018063123 (rev5) Patchwork
2023-10-17 13:33 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-10-17 13:46 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-10-17 18:12 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

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=02d52c92-50d4-420d-959e-3a2447f49e28@intel.com \
    --to=andrzej.hajda@intel.com \
    --cc=andi.shyti@intel.com \
    --cc=chris.p.wilson@linux.intel.com \
    --cc=gregory.f.germano@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jonathan.cavitt@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=nirmoy.das@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=tomasz.mistat@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox