Skip to contentSkip to conversation

drm/ttm: Fix accounting error when fail to get pages for pool

PATCH In review Xiangliang.Yu 6 participants 9 messages Aug 16, 2017 – Aug 17, 2017 5 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/ttm: Fix accounting error when fail to get pages for pool

When fail to get needed page for pool, need to put allocated pages into pool. But current code has a miscalculation of allocated pages, correct it.

---
 drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_page_alloc.c +1 -1
index eeddc1e..8715998 100644
@@ -615,7 +615,7 @@ static void ttm_page_pool_fill_locked(struct ttm_page_pool *pool,
 		} else {
 			pr_err("Failed to fill pool (%p)\n", pool);
 			/* If we have any pages left put them to the pool. */
-			list_for_each_entry(p, &pool->list, lru) {
+			list_for_each_entry(p, &new_pages, lru) {
 				++cpages;
 			}
 			list_splice(&new_pages, &pool->list);
Signature · 6 lines
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): 1502868046-32511-1-git-send-email-Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Xiangliang.Yu <[email protected]>
Sent: Wednesday, August 16, 2017 3:20:46 PM
To: akpm-de/[email protected]; [email protected]; dri-devel-PD4FTy7X32lzq7FAFJ/[email protected]; [email protected]
Cc: Yu, Xiangliang
Subject: [PATCH 1/1] drm/ttm: Fix accounting error when fail to get pages for pool

When fail to get needed page for pool, need to put allocated pages into pool. But current code has a miscalculation of allocated pages, correct it.

---
 drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_page_alloc.c +1 -1
index eeddc1e..8715998 100644
@@ -615,7 +615,7 @@ static void ttm_page_pool_fill_locked(struct ttm_page_pool *pool,
                 } else {
                         pr_err("Failed to fill pool (%p)\n", pool);
                         /* If we have any pages left put them to the pool. */
-                       list_for_each_entry(p, &pool->list, lru) {
+                       list_for_each_entry(p, &new_pages, lru) {
                                 ++cpages;
                         }
                         list_splice(&new_pages, &pool->list);

--
2.7.4

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

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

Reviewed-by
#3 lore raw

CC stable?

Am 16.08.2017 um 09:25 schrieb Liu, Monk:

Quoted 46 lines

------------------------------------------------------------------------
*From:* amd-gfx <[email protected]> on behalf of Xiangliang.Yu <[email protected]> *Sent:* Wednesday, August 16, 2017 3:20:46 PM
*To:* [email protected]; [email protected]; [email protected]; [email protected] *Cc:* Yu, Xiangliang
*Subject:* [PATCH 1/1] drm/ttm: Fix accounting error when fail to get pages for pool
When fail to get needed page for pool, need to put allocated pages
into pool. But current code has a miscalculation of allocated pages,
correct it.

---
 drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_page_alloc.c +0 -0
index eeddc1e..8715998 100644
@@ -615,7 +615,7 @@ static void ttm_page_pool_fill_locked(struct 
 ttm_page_pool *pool,
                 } else {
                         pr_err("Failed to fill pool (%p)\n", pool);
                         /* If we have any pages left put them to the 

pool. */

drivers/gpu/drm/ttm/ttm_page_alloc.c +1 -1
-                       list_for_each_entry(p, &pool->list, lru) {
+                       list_for_each_entry(p, &new_pages, lru) {
                                 ++cpages;
                         }
                         list_splice(&new_pages, &pool->list);
Signature · 12 lines
2.7.4

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


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

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

A message that is not in the archive (sent off-list or not yet received): 8f64cef6-e7f7-e245-93b9-a0d1bbc411aa-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

author Reviewed-by Christian König Reviewed-by Monk Liu
#5 lore raw

Ok, CC stable.

From: Christian König [mailto:[email protected]]
Sent: Wednesday, August 16, 2017 3:55 PM
To: Liu, Monk <[email protected]>; Yu, Xiangliang <[email protected]>; akpm-de/[email protected]; [email protected]; [email protected]; [email protected]
Subject: Re: [PATCH 1/1] drm/ttm: Fix accounting error when fail to get pages for pool

CC stable?

Am 16.08.2017 um 09:25 schrieb Liu, Monk:

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org><mailto:[email protected]> on behalf of Xiangliang.Yu <[email protected]><mailto:[email protected]>
Sent: Wednesday, August 16, 2017 3:20:46 PM
To: akpm-de/[email protected]<mailto:akpm-de/[email protected]>; [email protected]<mailto:[email protected]>; [email protected]<mailto:[email protected]>; [email protected]<mailto:[email protected]>
Cc: Yu, Xiangliang
Subject: [PATCH 1/1] drm/ttm: Fix accounting error when fail to get pages for pool

When fail to get needed page for pool, need to put allocated pages into pool. But current code has a miscalculation of allocated pages, correct it.

---
 drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_page_alloc.c +1 -1
index eeddc1e..8715998 100644
@@ -615,7 +615,7 @@ static void ttm_page_pool_fill_locked(struct ttm_page_pool *pool,
                 } else {
                         pr_err("Failed to fill pool (%p)\n", pool);
                         /* If we have any pages left put them to the pool. */
-                       list_for_each_entry(p, &pool->list, lru) {
+                       list_for_each_entry(p, &new_pages, lru) {
                                 ++cpages;
                         }
                         list_splice(&new_pages, &pool->list);

--
2.7.4

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

_______________________________________________

amd-gfx mailing list

[email protected]<mailto:[email protected]>

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

#6 lore raw
In reply to a message not in the archive

Fix memory leak of ttm kernel issue?

Quoted 47 lines · Christian König

CC stable?

Am 16.08.2017 um 09:25 schrieb Liu, Monk:

Quoted 42 lines

------------------------------------------------------------------------
*From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Xiangliang.Yu <[email protected]>
*Sent:* Wednesday, August 16, 2017 3:20:46 PM
*To:* akpm-de/[email protected]; [email protected]; [email protected]; [email protected] *Cc:* Yu, Xiangliang
*Subject:* [PATCH 1/1] drm/ttm: Fix accounting error when fail to get pages for pool
When fail to get needed page for pool, need to put allocated pages
into pool. But current code has a miscalculation of allocated pages,
correct it.

---
 drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_page_alloc.c +0 -0
index eeddc1e..8715998 100644
@@ -615,7 +615,7 @@ static void ttm_page_pool_fill_locked(struct 
 ttm_page_pool *pool,
                 } else {
                         pr_err("Failed to fill pool (%p)\n", pool);
                         /* If we have any pages left put them to the 

pool. */

drivers/gpu/drm/ttm/ttm_page_alloc.c +1 -1
-                       list_for_each_entry(p, &pool->list, lru) {
+                       list_for_each_entry(p, &new_pages, lru) {
                                 ++cpages;
                         }
                         list_splice(&new_pages, &pool->list);
Signature · 6 lines
2.7.4

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

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

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

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

A message that is not in the archive (sent off-list or not yet received): 140f09b5-32de-eb00-c2b1-8a660182344d-5C7GfCeVMHo@public.gmane.org

#8 lore raw

Minor TTM kernel issue, but probably present since forever.

I would add a CC: stable@vger.... tag to it so that it gets pulled into older kernels as well.

Christian.

Am 16.08.2017 um 11:10 schrieb zhoucm1:

Quoted 67 lines

Fix memory leak of ttm kernel issue?

Quoted 47 lines · Christian König

CC stable?

Am 16.08.2017 um 09:25 schrieb Liu, Monk:

Quoted 42 lines

------------------------------------------------------------------------
*From:* amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Xiangliang.Yu <[email protected]>
*Sent:* Wednesday, August 16, 2017 3:20:46 PM
*To:* akpm-de/[email protected]; [email protected]; [email protected]; [email protected] *Cc:* Yu, Xiangliang
*Subject:* [PATCH 1/1] drm/ttm: Fix accounting error when fail to get pages for pool
When fail to get needed page for pool, need to put allocated pages
into pool. But current code has a miscalculation of allocated pages,
correct it.

---
 drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_page_alloc.c +0 -0
index eeddc1e..8715998 100644
@@ -615,7 +615,7 @@ static void ttm_page_pool_fill_locked(struct 
 ttm_page_pool *pool,
                 } else {
                         pr_err("Failed to fill pool (%p)\n", pool);
                         /* If we have any pages left put them to 

the pool. */

drivers/gpu/drm/ttm/ttm_page_alloc.c +1 -1
-                       list_for_each_entry(p, &pool->list, lru) {
+                       list_for_each_entry(p, &new_pages, lru) {
                                 ++cpages;
                         }
                         list_splice(&new_pages, &pool->list);
Signature · 6 lines
2.7.4

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

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

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

Quoted 4 lines

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

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

author Reviewed-by Christian König Reviewed-by Monk Liu
#9 lore raw
In reply to a message not in the archive

I don’t know, but it is obvious issue. Later I’ll run test with the patch.

From: amd-gfx [mailto:[email protected]] On Behalf Of zhoucm1
Sent: Wednesday, August 16, 2017 5:10 PM
To: [email protected]
Subject: Re: [PATCH 1/1] drm/ttm: Fix accounting error when fail to get pages for pool

Fix memory leak of ttm kernel issue?

On 2017年08月16日 15:55, Christian König wrote:
CC stable?

Am 16.08.2017 um 09:25 schrieb Liu, Monk:

________________________________
From: amd-gfx <[email protected]><mailto:[email protected]> on behalf of Xiangliang.Yu <[email protected]><mailto:[email protected]>
Sent: Wednesday, August 16, 2017 3:20:46 PM
To: [email protected]<mailto:[email protected]>; [email protected]<mailto:[email protected]>; [email protected]<mailto:[email protected]>; [email protected]<mailto:[email protected]>
Cc: Yu, Xiangliang
Subject: [PATCH 1/1] drm/ttm: Fix accounting error when fail to get pages for pool

When fail to get needed page for pool, need to put allocated pages into pool. But current code has a miscalculation of allocated pages, correct it.

---
 drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_page_alloc.c +1 -1
index eeddc1e..8715998 100644
@@ -615,7 +615,7 @@ static void ttm_page_pool_fill_locked(struct ttm_page_pool *pool,
                 } else {
                         pr_err("Failed to fill pool (%p)\n", pool);
                         /* If we have any pages left put them to the pool. */
-                       list_for_each_entry(p, &pool->list, lru) {
+                       list_for_each_entry(p, &new_pages, lru) {
                                 ++cpages;
                         }
                         list_splice(&new_pages, &pool->list);

--
2.7.4

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

_______________________________________________

amd-gfx mailing list

[email protected]<mailto:[email protected]>

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________

amd-gfx mailing list

[email protected]<mailto:[email protected]>

https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

A message that is not in the archive (sent off-list or not yet received): BY2PR1201MB0935AC81E9620D14D382CFF8EB820-O28G1zQ8oGkaqtME6NEo1mrFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/[email protected]

#11 lore raw
Quoted 1 line · Xiangliang

I don’t know, but it is obvious issue. Later I’ll run test with the patch.

In the future, please test patches before submitting them for review. :)

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 177a0567-733d-8b72-5051-fe8d2b9dbafb-otUistvHUpPR7s880joybQ@public.gmane.org

#13 lore raw

I mean I don't know if the patch can fix mem leak issue.

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel D?nzer
Sent: Wednesday, August 16, 2017 6:03 PM
To: Yu, Xiangliang <[email protected]>; Zhou, David(ChunMing) <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 1/1] drm/ttm: Fix accounting error when fail to get pages for pool

Quoted 1 line · Xiangliang

I don’t know, but it is obvious issue. Later I’ll run test with the patch.

In the future, please test patches before submitting them for review. :)

Signature · 10 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx