From 63470ed69874a33c6f661724b7c6d3c93ee6fe06 Mon Sep 17 00:00:00 2001 From: "Milczarek, Slawomir" Date: Wed, 19 Apr 2023 00:25:30 +0000 Subject: [PATCH] [fix] zeCommandListAppendMemAdvise to clear preferred location correctly The memadvise with preferred location for kmd-migrated shared allocation is set to device associated with cmd list by default to migrate data to lmem on non-atomic gpu page fault too (for performance reasons). Related-To: NEO-7252 Signed-off-by: Milczarek, Slawomir --- shared/source/memory_manager/memadvise_flags.h | 3 ++- .../unit_test/os_interface/linux/drm_with_prelim_tests.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/shared/source/memory_manager/memadvise_flags.h b/shared/source/memory_manager/memadvise_flags.h index 524bdf9c9f..5a8ede0e0e 100644 --- a/shared/source/memory_manager/memadvise_flags.h +++ b/shared/source/memory_manager/memadvise_flags.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Intel Corporation + * Copyright (C) 2021-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -28,6 +28,7 @@ struct MemAdviseFlags { }; MemAdviseFlags() { allFlags = 0; + devicePreferredLocation = 1; cachedMemory = 1; } }; diff --git a/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp b/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp index 7394147f79..7a500d79d7 100644 --- a/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp +++ b/shared/test/unit_test/os_interface/linux/drm_with_prelim_tests.cpp @@ -276,7 +276,7 @@ TEST_F(IoctlHelperPrelimFixture, givenDrmAllocationWhenSetMemAdviseWithDevicePre MemAdviseFlags memAdviseFlags{}; - for (auto devicePreferredLocation : {true, false}) { + for (auto devicePreferredLocation : {false, true}) { memAdviseFlags.devicePreferredLocation = devicePreferredLocation; EXPECT_TRUE(allocation.setMemAdvise(drm.get(), memAdviseFlags));