All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@kernel.org>
To: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Cc: intel-xe@lists.freedesktop.org,
	 Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	 Matthew Brost <matthew.brost@intel.com>,
	Matthew Auld <matthew.auld@intel.com>
Subject: Re: [PATCH v3] drm/xe: Add a per-client debugfs file reporting bo NUMA node distribution
Date: Thu, 19 Nov 2026 21:39:40 +0100	[thread overview]
Message-ID: <av9eZhLsRaYPHeis@zenone.zhora.eu> (raw)
In-Reply-To: <20261118134203.646500-1-thomas.hellstrom@linux.intel.com>

Hi Thomas,

On Wed, Nov 18, 2026 at 02:42:03PM +0100, Thomas Hellström wrote:
> When debugging NUMA placement of bo system memory, there is currently
> no way to tell on which nodes the pages backing a bo reside. The
> /proc/<pid>/numa_maps interface doesn't help since bo CPU mappings are
> VM_PFNMAP, and clients may have thousands of bos, so a dump of all bos
> is undesirable.
> 
> Add a "bo_numa" file to the drm core per-client debugfs directory,
> client-<id>/. The file implements a request-response protocol per open
> file: Writing a GEM handle valid for the client takes a snapshot, under
> the bo's dma_resv lock, of the bo size, placement, and the number of
> pages on each NUMA node. A bo whose pages are swapped out, backed up
> or purged is reported as swapped/purged, and one whose pages are not
> populated as not populated. Subsequent reads return that snapshot. Once the
> snapshot has been completely read it is discarded, and a new handle
> may be written. Until then writes fail with -EBUSY, so that a pending
> snapshot can't be replaced before it is consumed. This allows querying
> many bos using a single open file.
> 
> The write-request / read-response protocol per open file follows the
> simple_transaction helpers in fs/libfs.c, used by e.g. nfsd and
> selinuxfs, and amdgpu already populates the per-client debugfs
> directory with its vm_pagetable_info file.
> 
> For sg bos, typically imported dma-bufs, the backing pages are owned
> by the exporter and can't be inspected, so only size and placement are
> reported.
> 
> Example:
>   exec 3<>/sys/kernel/debug/dri/client-<id>/bo_numa
>   echo <handle1> >&3
>   cat <&3
>   echo <handle2> >&3
>   cat <&3
>   exec 3>&-
> 
> The client id can be obtained from the drm-client-id fdinfo key.
> 
> v2:
> - Use drm_coredump_printer_is_full() (Andi Shyti)
> - Drop the Assisted-by tag and add a Signed-off-by (Andi Shyti)
> 
> v3:
> - Report swapped or purged bos as swapped/purged (Sashiko)
> 
> v4:
> - Also report bos purged via xe_ttm_bo_purge() as swapped/purged (Sashiko)
> 
> Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Matthew Auld <matthew.auld@intel.com>
> Cc: Andi Shyti <andi.shyti@kernel.org>
> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
> Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> # v3

Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>

Andi

  parent reply	other threads:[~2026-11-19 20:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 13:42 [PATCH v3] drm/xe: Add a per-client debugfs file reporting bo NUMA node distribution Thomas Hellström
2026-11-18 15:01 ` Thomas Hellström
2026-11-18 17:39 ` ✓ CI.KUnit: success for drm/xe: Add a per-client debugfs file reporting bo NUMA node distribution (rev5) Patchwork
2026-11-18 18:33 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-11-19 13:17   ` Thomas Hellström
2026-11-19 12:44 ` ✓ Xe.CI.FULL: success " Patchwork
2026-11-19 20:39 ` Andi Shyti [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-11-04 15:13 [PATCH v3] drm/xe: Add a per-client debugfs file reporting bo NUMA node distribution Thomas Hellström
2026-11-04 15:36 ` sashiko-bot
2026-11-12 13:58 ` Himal prasad Ghimiray

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=av9eZhLsRaYPHeis@zenone.zhora.eu \
    --to=andi.shyti@kernel.org \
    --cc=himal.prasad.ghimiray@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=thomas.hellstrom@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.