summaryrefslogtreecommitdiff
path: root/tests/i915/gem_lmem_swapping.c
AgeCommit message (Collapse)Author
2022-07-09lib/vm_bind: Add interface to support VM_BINDAdam Miszczak
Add required library interfaces to support VM_BIND functionality. Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
2022-06-30lib/i915: add gem_create_with_cpu_access_in_memory_regionsMatthew Auld
Most users shouldn't care about such an interface, but where required, this should be useful to aid in setting NEEDS_CPU_ACCESS for a given BO. Underneath we try to smooth over needing to provide an explicit SMEM region, or if this is SMEM-only, we don't want the kernel to throw an error. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
2022-05-31igt: Promote/rename OS helpersRob Clark
Promote intel_os.c helpers to igt_os.c, so that I can re-use them for some additional msm tests. Just big churny rename, no functional change. Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2022-04-21tests/i915/gem_lmem_swapping: Add parallel-random-verify-ccs subtestZbigniew Kempczyński
For this subtest we need to use allocator thread so parallel subtests need to be executed in allocator multi-process aware environment. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Ramalingam C <ramalingam.c@intel.com>
2022-04-20gem_lmem_swapping: Check requirements before module unloadPetri Latvala
To prevent a needless unload-load cycle, check for lmem before the unload if i915 is already loaded. Also check that the device is there at all so we get a better error message than EBADFD from require_gem. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Matthew Auld <matthew.auld@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Acked-by: Matthew Auld <matthew.auld@intel.com>
2022-04-19tests/i915/gem_lmem_swapping: Add ccs subtestsRamalingam C
Add subtests for covering the compressed object's eviction. v2: gem_sync after the block_copy blit for init v3: ahnd is passed in as a param [Zbigniew] cmd is bb [Zbigniew] blt src and dst sizes supposed to be same [Zbigniew] v4: Use gem_create_from_pool [Zbigniew] v5: Mark only blt_ctx as non-persistence [Ashutosh] v6: Move the intel_allocator_open/clsoe is moved under TEST-CCS [Arjun] blt_ctx through intel_ctx_0 [Arjun] v7: Get the blt engine for init and verify of ccs obj [Zbigniew] v8: Newline for assert msg [Petri] v9: free obj->blt_obj [Zbigniew] use intel_get_uc_mocs() [Zbigniew] Free tmp. v10: New ctx creation for blt. [Zbigniew] dynamic alloc result check [Zbigniew] parallel-random-verify-ccs is dropped. Signed-off-by: Chris Wilson <chris.p.wilson@intel.com> Signed-off-by: Ayaz A Siddiqui <ayaz.siddiqui@intel.com> Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
2022-04-18tests/i915/gem_lmem_swapping: create batch buffer from obj poolRamalingam C
Use the gem_create_from_pool() for creating the batch buffers. Signed-off-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com>
2022-04-01tests/i915/gem_lmem_swapping: Fix bug in test_smem_oomArjun Melkaveri
ctx was not initialized with all physical engines, after device reopening. This change would resolve assert issue seen in __do_evict. v2: Added missing intel_ctx_destroy. Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Cc: Ramalingam C <ramalingam.c@intel.com> Signed-off-by: Arjun Melkaveri <arjun.melkaveri@intel.com> Reviewed-by: Ramalingam C <ramalingam.c@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
2022-03-28tests/gem_lmem_swapping: limit lmem to 4GCQ Tang
On some systems lmem can be as large as 16G, which seems to trigger various CI timeouts, and in the best case just takes a long time. For the purposes of the test we should be able to limit to 4G, without any big loss in coverage. v2: - No need to try again without the modparam; if it's not supported it will still load the driver just fine. v3(Petri): - Add a helpful debug print in case the kernel is missing support for the lmem_size modparam. Signed-off-by: CQ Tang <cq.tang@intel.com> Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: Nirmoy Das <nirmoy.das@linux.intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2022-03-28test/gem_lmem_swapping: fix physical engine usageMatthew Auld
During execbuf DG2 currently just hits: "execbuf with unknown ring: 5" It looks like the fix is to convert the test over to using the non-legacy API where we instead fill the ctx with all the physical engines and then engine/ring becomes the index into this. v2: - Make sure we destroy our newly created contexts(Ashutosh) - Tweak the commit message so that we are talking less nonsense(Tvrtko) - s/i915/fd/ when calling set_persistence Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5192 Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Cc: Nirmoy Das <nirmoy.das@linux.intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
2022-03-28tests/gem_lmem_swapping: reduce the timeoutMatthew Auld
300s is way too much for some BAT test. Drop it down to 45s. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: Nirmoy Das <nirmoy.das@linux.intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
2022-03-28test/gem_lmem_swapping: account for object roundingMatthew Auld
On DG2 the object size might be rounded when allocating lmem. Make sure we account for any rounding up. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: Nirmoy Das <nirmoy.das@linux.intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2022-03-14tests/i915/gem_lmem_swapping: move the obj to lmem before initRamalingam C
When lmem obj is created through ttm, by default pages resides at smem. So before start initializing through mmap, lets move the pages into lmem. Else this will overload smem and OOM-killer will be triggered [10163.886990] containerd invoked oom-killer: gfp_mask=0x1140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), order=0, oom_score_adj=-999 [10163.956048] CPU: 1 PID: 1707 Comm: containerd Not tainted 5.17.0-rc6-4425-ram+ #2 [10163.963536] Hardware name: Intel Corporation CoffeeLake Client Platform/CoffeeLake S UDIMM RVP, BIOS CNLSFWR1.R00.X220.B00.2103302221 03/30/2021 [10163.976467] Call Trace: [10163.978925] <TASK> [10163.981039] dump_stack_lvl+0x57/0x7d [10163.984708] dump_header+0x45/0x2f4 [10163.988206] oom_kill_process.cold+0xb/0x10 [10163.992395] out_of_memory+0x104/0x3a0 [10163.996152] __alloc_pages_slowpath.constprop.0+0xbe6/0xd30 [10164.001734] __alloc_pages+0x316/0x350 [10164.005492] __folio_alloc+0x12/0x40 [10164.009071] __filemap_get_folio+0x1de/0x730 [10164.013356] filemap_fault+0x55a/0x1100 [10164.017202] ? filemap_map_pages+0x167/0x690 [10164.021482] __do_fault+0x2f/0xa0 [10164.024810] __handle_mm_fault+0xd2f/0x1490 [10164.029009] handle_mm_fault+0x146/0x410 [10164.032943] do_user_addr_fault+0x1e5/0x670 [10164.037133] exc_page_fault+0x65/0x250 [10164.040889] ? asm_exc_page_fault+0x8/0x30 [10164.044995] asm_exc_page_fault+0x1e/0x30 [10164.049014] RIP: 0033:0x55c0c67174f0 [10164.052597] Code: Unable to access opcode bytes at RIP 0x55c0c67174c6. [10164.059120] RSP: 002b:000000c00024d9c8 EFLAGS: 00010206 [10164.064345] RAX: 0000000000002000 RBX: 0000000000000004 RCX: 000055c0c8dfc1a0 [10164.071474] RDX: 000055c0c8e68f38 RSI: 00000000000000af RDI: 00000000000000aa [10164.078607] RBP: 000000c00024da20 R08: 000055c0c80b9ca0 R09: 0000000000203000 [10164.085738] R10: 0000000000000008 R11: 000000000fffffc0 R12: 0000000000000006 [10164.092868] R13: 00000000000000a4 R14: 00000000000000aa R15: 00000000000000aa [10164.100009] </TASK> [10164.169081] Mem-Info: [10164.185134] active_anon:811 inactive_anon:74186 isolated_anon:0 active_file:285 inactive_file:321 isolated_file:0 unevictable:3794624 dirty:0 writeback:0 slab_reclaimable:34539 slab_unreclaimable:106743 mapped:482 shmem:3795382 pagetables:1707 bounce:0 kernel_misc_reclaimable:0 free:37283 free_pcp:51 free_cma:0 Signed-off-by: Ramalingam C <ramalingam.c@intel.com> cc: Thomas Hellstrom <thomas.hellstrom@intel.com> Reviewed-by: Thomas Hellstrom <thomas.hellstrom@intel.com>
2021-11-23tests/i915/gem_lmem_swapping: run only for discrete platformTejas Upadhyay
Testsuit only meant to be run on discrete platforms and skip with right reason on other platforms. changes since V1: - Change position of gem_has_lmem(i915) check - Zbigniew Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Signed-off-by: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com>
2021-11-17tests/i915/gem_lmem_swapping: Add the gem_lmem_swapping testCQ Tang
This test exercises the lmem eviction functionality with one dynamic subtest per lmem region. In essence the various subtests create lmem buffers objects consuming more lmem memory than available and check that they are successful submitting workload subsets whose lmem size requirements are smaller than the total amount of lmem available, forcing eviction of buffer objects under various conditions. v2: - addressing review comments (handling seed, minor cleanups) (Zbigniew) - add dynamic_lmem_subtest() macro (Maarten) v3: - make seed unique for each process (Zbigniew) - add simple igt_describe() (Petri) v4: - remove -ENXIO from create bo path (Matt) Signed-off-by: CQ Tang <cq.tang@intel.com> Co-developed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Co-developed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Co-developed-by: Ayaz A Siddiqui <ayaz.siddiqui@intel.com> Signed-off-by: Ayaz A Siddiqui <ayaz.siddiqui@intel.com> Co-developed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Co-developed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Co-developed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com>