Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Matthew Auld <matthew.auld@intel.com>, igt-dev@lists.freedesktop.org
Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	Matthew Brost <matthew.brost@intel.com>
Subject: Re: [PATCH i-g-t v3] tests/intel/xe_bo_shrink: Add a user-space shrinker test
Date: Fri, 06 Nov 2026 14:31:01 +0100	[thread overview]
Message-ID: <695cfd26228ceea04be8aca01e3bd271449c81f7.camel@linux.intel.com> (raw)
In-Reply-To: <13f44439-cf3c-4a14-a64a-a1710c40dd84@intel.com>

On Fri, 2026-11-06 at 13:27 +0000, Matthew Auld wrote:
> On 06/11/2026 13:12, Thomas Hellström wrote:
> > Add a user-space counterpart of the xe_bo_shrink kunit test, now
> > that
> > user-space can mark buffer objects purgeable using the madvise
> > IOCTL.
> > 
> > The test creates 64 MiB system buffer objects corresponding to
> > twice
> > the amount of free system memory, fills them with pseudo-random
> > data
> > through CPU mappings that are kept alive until readback, and
> > verifies
> > the contents after the overcommit has forced the shrinker to back
> > up
> > or purge them. As in the kunit test, the share of the memory that
> > doesn't fit in free RAM and swap is marked purgeable (DONTNEED) and
> > allocated first. Purgeable objects are only verified if found
> > retained
> > when marked WILLNEED again; purged objects are never accessed.
> > 
> > Subtests:
> > - shrink: The kunit test equivalent.
> > - purge: Ignore swap space when sizing the purgeable share, so that
> >    the shrinker needs to purge rather than swap.
> > - shrink-fault-inject: Enable TTM backup / restore fault injection
> >    through debugfs, if available, making the shrinker back up only
> > part
> >    of the objects and making backup and restore of individual pages
> >    fail. The number of injected faults is checked to be non-zero,
> >    unless there was less than 1 GiB of free swap space at test
> > start.
> > - *-blit: Never access the objects using the CPU. Instead fill them
> >    from, and read them back to, a CPU-mapped dummy object using
> > MEM_COPY
> >    blits in a separate VM, so that they are restored through the
> > GPU
> >    paths. On integrated devices with flat CCS, bind the objects
> > using a
> >    compressed PAT index to cover shrinking of compressed system
> > memory
> >    objects. On discrete devices, objects are created with system
> > and VRAM
> >    placements, prefetched to system memory before the fill and
> > prefetched
> >    to VRAM before the readback, so that they are restored by the
> >    migration to VRAM.
> > - *-private: Create the objects private to the test VM rather than
> > as
> >    external objects.
> > - *-fast: Allocate at most the free system memory, half of it
> >    purgeable, capped to 8 GiB purgeable and 8 GiB non-purgeable,
> > and
> >    shrink using drop_caches rather than memory overcommit.
> > 
> > The non-fast subtests are slow and require a substantial amount of
> > swap space for meaningful coverage, so block them in CI and run
> > only
> > the fast subtests.
> > 
> > v2:
> > - Don't fail the fault-inject subtests if no faults were injected
> > and
> >    there was less than XE_BO_SHRINK_FI_MIN_SWAP (1 GiB) free swap
> > space
> >    at test start, since nothing is then backed up or restored
> > - Never access the blit variant bos using the CPU, not even for the
> >    fill. Fill them by blitting from the dummy bo instead
> > - Bind the blit variant bos using a compressed PAT index on
> > integrated
> >    devices with flat CCS to test shrinking of compressed system
> > memory
> >    bos (Matthew Auld)
> > 
> > v3:
> > - Create bos that are not intended to be compressed with
> >    DRM_XE_GEM_CREATE_FLAG_NO_COMPRESSION, if supported, for
> > consistent
> >    behaviour across platforms (Matthew Auld)
> > - Use cached MOCS for the blitter copies (Matthew Auld)
> > 
> > Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> > Cc: Matthew Auld <matthew.auld@intel.com>
> > Cc: Matthew Brost <matthew.brost@intel.com>
> > Assisted-by: GitHub_Copilot:claude-opus-5.5
> > Reviewed-by: Matthew Auld <matthew.auld@intel.com> #v2
> 
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>

Thanks for the review and all the good suggestions!

/Thomas

  reply	other threads:[~2026-11-06 13:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-06 13:12 [PATCH i-g-t v3] tests/intel/xe_bo_shrink: Add a user-space shrinker test Thomas Hellström
2026-11-06 13:27 ` Matthew Auld
2026-11-06 13:31   ` Thomas Hellström [this message]
2026-11-06 16:58 ` ✓ i915.CI.BAT: success for tests/intel/xe_bo_shrink: Add a user-space shrinker test (rev4) Patchwork
2026-11-06 17:03 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-07  2:04 ` ✗ i915.CI.Full: failure " Patchwork
2026-11-07 19:54 ` ✓ Xe.CI.FULL: success " Patchwork
2026-11-09 11:39 ` [PATCH i-g-t v3] tests/intel/xe_bo_shrink: Add a user-space shrinker test Kamil Konieczny

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=695cfd26228ceea04be8aca01e3bd271449c81f7.camel@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@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