Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ghimiray, Himal Prasad" <himal.prasad.ghimiray@intel.com>
To: Tejas Upadhyay <tejas.upadhyay@intel.com>,
	<intel-xe@lists.freedesktop.org>
Subject: Re: [Intel-xe] [PATCH 5/7] drm/xe: Track page table memory usage for client
Date: Wed, 6 Sep 2023 15:24:58 +0530	[thread overview]
Message-ID: <f42a5b92-63b1-4adb-bbc6-4d479dbb0d37@intel.com> (raw)
In-Reply-To: <20230831090536.2949934-6-tejas.upadhyay@intel.com>


On 31-08-2023 14:35, Tejas Upadhyay wrote:
> Account page table memory usage in the owning client
> memory usage stats.
>
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
> ---
>   drivers/gpu/drm/xe/xe_pt.c | 4 +++-
>   drivers/gpu/drm/xe/xe_vm.c | 9 ++++++++-
>   2 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c
> index 5709518e314b..8df83241c5fe 100644
> --- a/drivers/gpu/drm/xe/xe_pt.c
> +++ b/drivers/gpu/drm/xe/xe_pt.c
> @@ -7,6 +7,7 @@
>   
>   #include "xe_bo.h"
>   #include "xe_device.h"
> +#include "xe_drm_client.h"
>   #include "xe_gt.h"
>   #include "xe_gt_tlb_invalidation.h"
>   #include "xe_migrate.h"
> @@ -195,7 +196,8 @@ struct xe_pt *xe_pt_create(struct xe_vm *vm, struct xe_tile *tile,
>   	pt->bo = bo;
>   	pt->level = level;
>   	pt->base.dir = level ? &as_xe_pt_dir(pt)->dir : NULL;
> -
> +	if (vm->xef)
> +		xe_drm_client_add_bo(vm->xef->client, pt->bo);
>   	XE_WARN_ON(level > XE_VM_MAX_LEVEL);
>   
>   	return pt;
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index f5f832c8ed42..84fb1069fdbb 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -18,6 +18,7 @@
>   
>   #include "xe_bo.h"
>   #include "xe_device.h"
> +#include "xe_drm_client.h"
>   #include "xe_exec_queue.h"
>   #include "xe_gt.h"
>   #include "xe_gt_pagefault.h"
> @@ -1980,6 +1981,7 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,
>   	struct xe_device *xe = to_xe_device(dev);
>   	struct xe_file *xef = to_xe_file(file);
>   	struct drm_xe_vm_create *args = data;
> +	struct xe_tile *tile;
>   	struct xe_vm *vm;
>   	u32 id, asid;
>   	int err;
> @@ -2058,7 +2060,12 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,
>   
>   	args->vm_id = id;
>   	vm->xef = xef;
> -
> +	/* Record BO memory for VM pagetable create aginst client */
> +	for_each_tile(tile, xe, id) {
> +		if (!vm->pt_root[id])
> +			continue;
> +		xe_drm_client_add_bo(vm->xef->client, vm->pt_root[id]->bo);

can be changed to

if (vm->pt_root[id])
	xe_drm_client_add_bo(vm->xef->client, vm->pt_root[id]->bo);

BR
Himal

> +	}
>   #if IS_ENABLED(CONFIG_DRM_XE_DEBUG_MEM)
>   	/* Warning: Security issue - never enable by default */
>   	args->reserved[0] = xe_bo_main_addr(vm->pt_root[0]->bo, XE_PAGE_SIZE);

  reply	other threads:[~2023-09-06  9:55 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31  9:05 [Intel-xe] [PATCH 0/7] drm/xe: fdinfo memory stats Tejas Upadhyay
2023-08-31  9:05 ` [Intel-xe] [PATCH 1/7] drm/xe: Add drm-client infrastructure Tejas Upadhyay
2023-09-06  4:14   ` Ghimiray, Himal Prasad
2023-09-07  8:57     ` Upadhyay, Tejas
2023-09-12  8:24       ` Ghimiray, Himal Prasad
2023-08-31  9:05 ` [Intel-xe] [PATCH 2/7] drm/xe: Interface xe drm client with fdinfo interface Tejas Upadhyay
2023-09-06  4:21   ` Ghimiray, Himal Prasad
2023-08-31  9:05 ` [Intel-xe] [PATCH 3/7] drm/xe: Add tracking support for bos per client Tejas Upadhyay
2023-09-06  9:38   ` Ghimiray, Himal Prasad
2023-09-07  8:52     ` Upadhyay, Tejas
2023-08-31  9:05 ` [Intel-xe] [PATCH 4/7] drm/xe: Record each drm client with its VM Tejas Upadhyay
2023-09-06  9:47   ` Ghimiray, Himal Prasad
2023-09-07  8:49     ` Upadhyay, Tejas
2023-09-07  9:28       ` Ghimiray, Himal Prasad
2023-09-07  9:44         ` Upadhyay, Tejas
2023-08-31  9:05 ` [Intel-xe] [PATCH 5/7] drm/xe: Track page table memory usage for client Tejas Upadhyay
2023-09-06  9:54   ` Ghimiray, Himal Prasad [this message]
2023-09-07  8:40     ` Upadhyay, Tejas
2023-08-31  9:05 ` [Intel-xe] [PATCH 6/7] drm/xe: Account ring buffer and context state storage Tejas Upadhyay
2023-09-06 11:19   ` Ghimiray, Himal Prasad
2023-08-31  9:05 ` [Intel-xe] [PATCH 7/7] drm/xe: Implement fdinfo memory stats printing Tejas Upadhyay
2023-08-31 12:19   ` Upadhyay, Tejas
2023-09-12  6:22   ` Ghimiray, Himal Prasad
2023-09-12 11:14     ` Jani Nikula
2023-08-31  9:21 ` [Intel-xe] ✓ CI.Patch_applied: success for drm/xe: fdinfo memory stats Patchwork
2023-08-31  9:21 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-08-31  9:22 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-08-31  9:29 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-08-31  9:30 ` [Intel-xe] ✗ CI.Hooks: failure " Patchwork
2023-08-31  9:30 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork
2023-08-31 10:04 ` [Intel-xe] ✓ CI.BAT: success " Patchwork
2023-08-31 11:23 ` Patchwork
2023-09-07  9:22 ` [Intel-xe] [PATCH 0/7] " Ghimiray, Himal Prasad
2023-09-07  9:35   ` Upadhyay, Tejas

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=f42a5b92-63b1-4adb-bbc6-4d479dbb0d37@intel.com \
    --to=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=tejas.upadhyay@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