From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AE70C433FE for ; Wed, 3 Nov 2021 21:26:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 048FB6052B for ; Wed, 3 Nov 2021 21:26:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230363AbhKCV2v (ORCPT ); Wed, 3 Nov 2021 17:28:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38404 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230070AbhKCV2s (ORCPT ); Wed, 3 Nov 2021 17:28:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635974771; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Znlql06AhhI7EaphpwppCQqpnxjsVHdYSJklJrdqL1M=; b=EOJbcZovDDx+a2qFSS/xOYnGWXdmec8ETRP5qSd15DlZt3K3SftULTM33dhLU5PJ2Fnv/S DC5WH4hjzl0MWkEwNkuZhjxJmHomZN/lh/IRWmzyCXtanvl6wGb5OaqwTM01KOaU+bUjpr 0VwGNwf+3ifiYFUoHmyzml/Z//N61Sw= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-299-P4bTqH89P6KRnRkbfaVTMQ-1; Wed, 03 Nov 2021 17:26:10 -0400 X-MC-Unique: P4bTqH89P6KRnRkbfaVTMQ-1 Received: by mail-wm1-f70.google.com with SMTP id o22-20020a1c7516000000b0030d6f9c7f5fso1643639wmc.1 for ; Wed, 03 Nov 2021 14:26:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Znlql06AhhI7EaphpwppCQqpnxjsVHdYSJklJrdqL1M=; b=lB3XPnUCxL3PkV9UiJJAcDtj3CvNzUu/KdSKYJGP2bb1hcPccy7ptu2cquzPPmIy1M QkuPs9PabLMeXHq3/PXli5DVWJUCnn5GbR+v6eZo5EhcJeXcauUhDQf7L8HPIAhdRFwk kgGdYzIpEEalZlFQFhj6YHh+fuMybPJjvA18LH8JWqWMycRLOvEfpk8RUnN+27vhawDl y+KH7jZ2affHuPE3IiUsJAcngN8uKequT4F4WZuSqPyVSLHSuywkC9vDIVaV0KsOnf/d 8POshklIty8F64XGiG56bbzoGps8gpcTbQ7GP6A3WbTgGlSpEFa4gBFgweg+SLGc/PwW E+og== X-Gm-Message-State: AOAM530FpG8htLXZw8Tkc/3MPEMdlScEfjJkAwoDQTzn+FYeVgPN5E0r JYAf7JiWA4CHUhZ3GCOHSzgnqbeR/r0Q30Yq9muqFCEAmAoB8R15rDZxtNSMGhKPiSFRNtU+k0r 59RKqx/JmN82ssj+JorZxq3ghDEa6DGXTGPPPPj0D X-Received: by 2002:a05:6000:2ae:: with SMTP id l14mr5061533wry.142.1635974768720; Wed, 03 Nov 2021 14:26:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwEJRXkYNzDroD2U2ofyOYD+EctMvHrMm2ahndQNqZj0d+LO2dkGqQ/YFDy55GG7GxIjNBx/OX2kxn9iLDPiU= X-Received: by 2002:a05:6000:2ae:: with SMTP id l14mr5061507wry.142.1635974768434; Wed, 03 Nov 2021 14:26:08 -0700 (PDT) MIME-Version: 1.0 References: <20211101082511.254155853@linuxfoundation.org> <20211101082518.624936309@linuxfoundation.org> <871r3x2f0y.fsf@turtle.gmx.de> <87tugt0xx6.fsf@turtle.gmx.de> In-Reply-To: <87tugt0xx6.fsf@turtle.gmx.de> From: Karol Herbst Date: Wed, 3 Nov 2021 22:25:57 +0100 Message-ID: Subject: Re: [Nouveau] [PATCH 5.10 32/77] drm/ttm: fix memleak in ttm_transfered_destroy To: Sven Joachim Cc: Greg Kroah-Hartman , "Erhard F." , nouveau , LKML , stable@vger.kernel.org, Huang Rui , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 3, 2021 at 9:47 PM Sven Joachim wrote: > > On 2021-11-03 21:32 +0100, Karol Herbst wrote: > > > On Wed, Nov 3, 2021 at 9:29 PM Karol Herbst wrote: > >> > >> On Wed, Nov 3, 2021 at 8:52 PM Sven Joachim wrote: > >> > > >> > On 2021-11-01 10:17 +0100, Greg Kroah-Hartman wrote: > >> > > >> > > From: Christian K=C3=B6nig > >> > > > >> > > commit 0db55f9a1bafbe3dac750ea669de9134922389b5 upstream. > >> > > > >> > > We need to cleanup the fences for ghost objects as well. > >> > > > >> > > Signed-off-by: Christian K=C3=B6nig > >> > > Reported-by: Erhard F. > >> > > Tested-by: Erhard F. > >> > > Reviewed-by: Huang Rui > >> > > Bug: https://bugzilla.kernel.org/show_bug.cgi?id=3D214029 > >> > > Bug: https://bugzilla.kernel.org/show_bug.cgi?id=3D214447 > >> > > CC: > >> > > Link: https://patchwork.freedesktop.org/patch/msgid/20211020173211= .2247-1-christian.koenig@amd.com > >> > > Signed-off-by: Greg Kroah-Hartman > >> > > --- > >> > > drivers/gpu/drm/ttm/ttm_bo_util.c | 1 + > >> > > 1 file changed, 1 insertion(+) > >> > > > >> > > --- a/drivers/gpu/drm/ttm/ttm_bo_util.c > >> > > +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c > >> > > @@ -322,6 +322,7 @@ static void ttm_transfered_destroy(struc > >> > > struct ttm_transfer_obj *fbo; > >> > > > >> > > fbo =3D container_of(bo, struct ttm_transfer_obj, base); > >> > > + dma_resv_fini(&fbo->base.base._resv); > >> > > ttm_bo_put(fbo->bo); > >> > > kfree(fbo); > >> > > } > >> > > >> > Alas, this innocuous looking commit causes one of my systems to lock= up > >> > as soon as run startx. This happens with the nouveau driver, two ot= her > >> > systems with radeon and intel graphics are not affected. Also I onl= y > >> > noticed it in 5.10.77. Kernels 5.15 and 5.14.16 are not affected, a= nd I > >> > do not use 5.4 anymore. > >> > > >> > I am not familiar with nouveau's ttm management and what has changed > >> > there between 5.10 and 5.14, but maybe one of their developers can s= hed > >> > a light on this. > >> > > >> > Cheers, > >> > Sven > >> > > >> > >> could be related to 265ec0dd1a0d18f4114f62c0d4a794bb4e729bc1 > > > > maybe not.. but I did remember there being a few tmm related patches > > which only hurt nouveau :/ I guess one could do a git bisect to > > figure out what change "fixes" it. > > Maybe, but since the memory leaks reported by Erhard only started to > show up in 5.14 (if I read the bugzilla reports correctly), perhaps the > patch should simply be reverted on earlier kernels? > Yeah, I think this is probably the right approach. > > On which GPU do you see this problem? > > On an old GeForce 8500 GT, the whole PC is rather ancient. > > Cheers, > Sven > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33EB8C433EF for ; Wed, 3 Nov 2021 21:26:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA8AF60F58 for ; Wed, 3 Nov 2021 21:26:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EA8AF60F58 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 499307A455; Wed, 3 Nov 2021 21:26:15 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 24B8F7A454 for ; Wed, 3 Nov 2021 21:26:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635974772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Znlql06AhhI7EaphpwppCQqpnxjsVHdYSJklJrdqL1M=; b=UgVstBDzG83/TybO/9nPQ/MxjO4Id1P789/KSDVLRmHqUW+JrK9VB0MGq19YByifiAg946 vey3FmFw0qyiTaf4IekHZvzGBGPLhkgZEJFUPkRKZ+kpSzXWdk1C9pvfBN7dUZL3gGCJTL +TSNkofyBaSR/l7uZbNvQqVIt+J2qnw= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-263-8XnpODIwNeC1fmks7scIpA-1; Wed, 03 Nov 2021 17:26:10 -0400 X-MC-Unique: 8XnpODIwNeC1fmks7scIpA-1 Received: by mail-wm1-f70.google.com with SMTP id 69-20020a1c0148000000b0033214e5b021so1638049wmb.3 for ; Wed, 03 Nov 2021 14:26:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Znlql06AhhI7EaphpwppCQqpnxjsVHdYSJklJrdqL1M=; b=LdVS03wjjXCyIzXMzM3OHEy8JEenFl+AnWaQ0IEymxV9uY6xRzLl3ovFVnDsmCKyJQ F+4yZh3YeE2m05NVm/ELnC66gAUJK1PxKNrwAAyJ5Yx9emfVaQLvd0MCt1wrCx+9NuXP mKRLuZnEld/qoUfIjnYloT50f+AvbGDmJWeHzLkSUbdSQW5zLTfQ2zZ57fkxdIGhtnYR DrI0K107V7PHr2uGwscP8fXGGM8/Fc5WCx2JEyUOs/Eq1oqf3tCd1/vDiZNV+YE8rWCP A+HeienP/gQRYAszVyreyT/Ixk19Pt8v+T+1Rn3MdgyUp0n5UuW6Je0QmaBxEMWs0TJ3 Rptw== X-Gm-Message-State: AOAM530arv18kUXIG0d06ij9hXZ+Cu32nGMLUjGma4eurQr8cMqi77rI S9K8X4hTLjRR+ZvKGW7Tpwhlv/yTP/GVGn63HanaDH/xUBWQA5cWW6M+4dwSRO+4jV2+E5lPStc UBIxeiUfP0fkKbbymKcte5GyQJyL+nC+SUpc4se3C9Q== X-Received: by 2002:a05:6000:2ae:: with SMTP id l14mr5061527wry.142.1635974768671; Wed, 03 Nov 2021 14:26:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwEJRXkYNzDroD2U2ofyOYD+EctMvHrMm2ahndQNqZj0d+LO2dkGqQ/YFDy55GG7GxIjNBx/OX2kxn9iLDPiU= X-Received: by 2002:a05:6000:2ae:: with SMTP id l14mr5061507wry.142.1635974768434; Wed, 03 Nov 2021 14:26:08 -0700 (PDT) MIME-Version: 1.0 References: <20211101082511.254155853@linuxfoundation.org> <20211101082518.624936309@linuxfoundation.org> <871r3x2f0y.fsf@turtle.gmx.de> <87tugt0xx6.fsf@turtle.gmx.de> In-Reply-To: <87tugt0xx6.fsf@turtle.gmx.de> From: Karol Herbst Date: Wed, 3 Nov 2021 22:25:57 +0100 Message-ID: To: Sven Joachim Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kherbst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Nouveau] [PATCH 5.10 32/77] drm/ttm: fix memleak in ttm_transfered_destroy X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Erhard F." , nouveau , LKML , stable@vger.kernel.org, Huang Rui , Greg Kroah-Hartman , =?UTF-8?Q?Christian_K=C3=B6nig?= Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" On Wed, Nov 3, 2021 at 9:47 PM Sven Joachim wrote: > > On 2021-11-03 21:32 +0100, Karol Herbst wrote: > > > On Wed, Nov 3, 2021 at 9:29 PM Karol Herbst wrote: > >> > >> On Wed, Nov 3, 2021 at 8:52 PM Sven Joachim wrote: > >> > > >> > On 2021-11-01 10:17 +0100, Greg Kroah-Hartman wrote: > >> > > >> > > From: Christian K=C3=B6nig > >> > > > >> > > commit 0db55f9a1bafbe3dac750ea669de9134922389b5 upstream. > >> > > > >> > > We need to cleanup the fences for ghost objects as well. > >> > > > >> > > Signed-off-by: Christian K=C3=B6nig > >> > > Reported-by: Erhard F. > >> > > Tested-by: Erhard F. > >> > > Reviewed-by: Huang Rui > >> > > Bug: https://bugzilla.kernel.org/show_bug.cgi?id=3D214029 > >> > > Bug: https://bugzilla.kernel.org/show_bug.cgi?id=3D214447 > >> > > CC: > >> > > Link: https://patchwork.freedesktop.org/patch/msgid/20211020173211= .2247-1-christian.koenig@amd.com > >> > > Signed-off-by: Greg Kroah-Hartman > >> > > --- > >> > > drivers/gpu/drm/ttm/ttm_bo_util.c | 1 + > >> > > 1 file changed, 1 insertion(+) > >> > > > >> > > --- a/drivers/gpu/drm/ttm/ttm_bo_util.c > >> > > +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c > >> > > @@ -322,6 +322,7 @@ static void ttm_transfered_destroy(struc > >> > > struct ttm_transfer_obj *fbo; > >> > > > >> > > fbo =3D container_of(bo, struct ttm_transfer_obj, base); > >> > > + dma_resv_fini(&fbo->base.base._resv); > >> > > ttm_bo_put(fbo->bo); > >> > > kfree(fbo); > >> > > } > >> > > >> > Alas, this innocuous looking commit causes one of my systems to lock= up > >> > as soon as run startx. This happens with the nouveau driver, two ot= her > >> > systems with radeon and intel graphics are not affected. Also I onl= y > >> > noticed it in 5.10.77. Kernels 5.15 and 5.14.16 are not affected, a= nd I > >> > do not use 5.4 anymore. > >> > > >> > I am not familiar with nouveau's ttm management and what has changed > >> > there between 5.10 and 5.14, but maybe one of their developers can s= hed > >> > a light on this. > >> > > >> > Cheers, > >> > Sven > >> > > >> > >> could be related to 265ec0dd1a0d18f4114f62c0d4a794bb4e729bc1 > > > > maybe not.. but I did remember there being a few tmm related patches > > which only hurt nouveau :/ I guess one could do a git bisect to > > figure out what change "fixes" it. > > Maybe, but since the memory leaks reported by Erhard only started to > show up in 5.14 (if I read the bugzilla reports correctly), perhaps the > patch should simply be reverted on earlier kernels? > Yeah, I think this is probably the right approach. > > On which GPU do you see this problem? > > On an old GeForce 8500 GT, the whole PC is rather ancient. > > Cheers, > Sven >