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

Submitted by Yu, Xiangliang on Aug. 16, 2017, 9:43 a.m.

Details

Message ID BY2PR1201MB0935AC81E9620D14D382CFF8EB820@BY2PR1201MB0935.namprd12.prod.outlook.com
State New
Headers show
Series "Series without cover letter" ( rev: 4 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Yu, Xiangliang Aug. 16, 2017, 9:43 a.m.
I don’t know, but it is obvious issue. Later I’ll run test with the patch.

From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of zhoucm1

Sent: Wednesday, August 16, 2017 5:10 PM
To: amd-gfx@lists.freedesktop.org
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?

Reviewed-by: Christian König <christian.koenig@amd.com><mailto:christian.koenig@amd.com>


Am 16.08.2017 um 09:25 schrieb Liu, Monk:

Reviewed-by: Monk Liu <monk.liu@amd.com><mailto:monk.liu@amd.com>


________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org><mailto:amd-gfx-bounces@lists.freedesktop.org> on behalf of Xiangliang.Yu <Xiangliang.Yu@amd.com><mailto:Xiangliang.Yu@amd.com>

Sent: Wednesday, August 16, 2017 3:20:46 PM
To: akpm@linux-foundation.org<mailto:akpm@linux-foundation.org>; labbott@redhat.com<mailto:labbott@redhat.com>; dri-devel@lists.freedesktop.org<mailto:dri-devel@lists.freedesktop.org>; amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>
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.

Signed-off-by: Xiangliang.Yu <Xiangliang.Yu@amd.com><mailto:Xiangliang.Yu@amd.com>

---
 drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




_______________________________________________

amd-gfx mailing list

amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>

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






_______________________________________________

amd-gfx mailing list

amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>

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

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
index eeddc1e..8715998 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -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);

Comments

On 16/08/17 06:43 PM, Yu, Xiangliang wrote:
> 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. :)
I mean I don't know if the patch can fix mem leak issue.

-----Original Message-----
From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of Michel D?nzer

Sent: Wednesday, August 16, 2017 6:03 PM
To: Yu, Xiangliang <Xiangliang.Yu@amd.com>; Zhou, David(ChunMing) <David1.Zhou@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/1] drm/ttm: Fix accounting error when fail to get pages for pool

On 16/08/17 06:43 PM, Yu, Xiangliang wrote:
> 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. :)


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx