Skip to contentSkip to conversation

drm/ttm: Do not add non-system domain BO into swap list

PATCH In review xinhui pan 4 participants 4 messages Feb 24, 2021

Subsystems (3)
lore
Share & tools
lore

xinhui pan

author
#0 lore raw

PATCH 1/1 drm/ttm: Do not add non-system domain BO into swap list

BO would be added into swap list if it is validated into system domain. If BO is validated again into non-system domain, say, VRAM domain. It actually should not be in the swap list.

---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/ttm/ttm_bo.c +2 -0
index a97d41f4ce3c..3a10bebb75d6 100644
@@ -111,6 +111,8 @@ void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo,
 
 		swap = &ttm_glob.swap_lru[bo->priority];
 		list_move_tail(&bo->swap, swap);
+	} else {
+		list_del_init(&bo->swap);
 	}
 
 	if (bdev->funcs->del_from_lru_notify)
Signature · 6 lines
2.25.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · xinhui pan

BO would be added into swap list if it is validated into system domain. If BO is validated again into non-system domain, say, VRAM domain. It actually should not be in the swap list.

Quoted 20 lines
---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
index a97d41f4ce3c..3a10bebb75d6 100644
@@ -111,6 +111,8 @@ void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo,
 
                swap = &ttm_glob.swap_lru[bo->priority];
                list_move_tail(&bo->swap, swap);
+       } else {
+               list_del_init(&bo->swap);
        }
 
        if (bdev->funcs->del_from_lru_notify)
--

2.25.1

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Acked-by Acked-by Alex Deucher
#2 lore raw

[AMD Public Use]

Regards,
Guchun

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Wednesday, February 24, 2021 11:35 AM
To: Pan, Xinhui <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Maling list - DRI developers <[email protected]>; Koenig, Christian <[email protected]>; amd-gfx list <[email protected]>
Subject: Re: [PATCH] drm/ttm: Do not add non-system domain BO into swap list

Quoted 6 lines · xinhui pan

BO would be added into swap list if it is validated into system domain. If BO is validated again into non-system domain, say, VRAM domain. It actually should not be in the swap list.

Quoted 21 lines
---
 drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
 1 file changed, 2 insertions(+)
(quoted diff) +0 -0

b/drivers/gpu/drm/ttm/ttm_bo.c index a97d41f4ce3c..3a10bebb75d6 100644

drivers/gpu/drm/ttm/ttm_bo.c +2 -0
@@ -111,6 +111,8 @@ void ttm_bo_move_to_lru_tail(struct 
 ttm_buffer_object *bo,
 
                swap = &ttm_glob.swap_lru[bo->priority];
                list_move_tail(&bo->swap, swap);
+       } else {
+               list_del_init(&bo->swap);
        }
 
        if (bdev->funcs->del_from_lru_notify)

--
2.25.1

Quoted 10 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Fdri-devel&amp;data=04%7C01%7C guchun.chen%40amd.com%7C554dbc7fd1fe4438268508d8d87529da%7C3dd8961fe48 84e608e11a82d994e183d%7C0%7C0%7C637497345043233977%7CUnknown%7CTWFpbGZ sb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3 D%7C1000&amp;sdata=2sWpQGXSETm6t%2FKwHXeuLjmcwHHMFKlIplpcL9T3VF8%3D&am p;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Cguchun.chen%40amd.com%7C554dbc7fd1fe4438268508d8d87529da%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637497345043233977%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=7sfyxSHzKhpYeh6GzlzhjkBDDsNlxMhz3Ydcs6AHnPw%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by on v1 1/1
#3 lore raw
In reply to xinhui pan

Am 24.02.21 um 04:28 schrieb xinhui pan:

Quoted 5 lines

BO would be added into swap list if it is validated into system domain. If BO is validated again into non-system domain, say, VRAM domain. It actually should not be in the swap list.

Going to push that to drm-misc-fixes tomorrow.

Thanks,
Christian.

Quoted 9 lines
---
  drivers/gpu/drm/ttm/ttm_bo.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/ttm/ttm_bo.c +0 -0
index a97d41f4ce3c..3a10bebb75d6 100644

drivers/gpu/drm/ttm/ttm_bo.c void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo, · line 118

Quoted 8 lines
drivers/gpu/drm/ttm/ttm_bo.c +2 -0
@@ -111,6 +111,8 @@ void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo,
 
  		swap = &ttm_glob.swap_lru[bo->priority];
  		list_move_tail(&bo->swap, swap);
+	} else {
+		list_del_init(&bo->swap);
  	}
 
  	if (bdev->funcs->del_from_lru_notify)

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx