Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16022172rwd; Mon, 26 Jun 2023 04:53:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5xdPLECV2dhuTjTjVSGDspqSXSwSj+zczWNWSmx9li4DPB6akWfFoGS0KKgAbupVPsifbj X-Received: by 2002:aa7:d48b:0:b0:51d:9905:6f60 with SMTP id b11-20020aa7d48b000000b0051d99056f60mr1674167edr.41.1687780386946; Mon, 26 Jun 2023 04:53:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687780386; cv=none; d=google.com; s=arc-20160816; b=smbEX796l6P7is1GCzKB7qTn01lshE5276dkZ9qprx9h0oefpkAXpMLyEG+TRnFOxB sB1bhWWEbx7hcS2zgnzym5s0EM/3NSSVr0D0fgLRUahjVQVzJ+ZHcasw/blU5BmxtMFe c7vl4tLgLlOKUjhxJboXzvw8w6jPh4pScHlBThRAaEog+RI2nNzG0sydhv5AlR+Ji37l uPqWEvcZkx19yGqZV9OTM9aaaUM8GOF4TT+2k98QSigsJPa9PzVb0Xvz+x2XupnZE+kT cSuI/jJVnX/cp13TIeR0yZGwJ7opmQBdbffyU/6uIKtlLs/ntCGwgvBNlaT6Q5KJxVn8 lRWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=uWJ2m6hM9/UPQKvpX2tpk6Qe1joTg2sFo9t5IZ8C27Y=; fh=IkOFWjArr4xLQSKgB8MhqewGgg8jwj7E50axSgbOf5o=; b=VqAypHoMObe8qdgNu/QyYEJ8jQ/puAkM9f3e4CI8vjrTosYUy7viB3cOytiI/Il/Be DJJMyvEk9SxSFCaxgJEpqu99gtAqqOOtoJYmcReRLMdmyy0ZJWMKKqONdUPk42TWuzmI Nj6IwLV1UZHb3Lq3Zb4+OxeKbRuAiT4gzkrT4qYM3a9qEFNFKBYUV2WxIZOt67FsQSop WUGS3RH3fEN0chJFXRo7yELHBDO6Qx1wa3QImxEa+sC/1a2r4OSDwO9ZM0RQSZYWp7hE DOJAblpE3islW7SF+mbnpi4XGxe//wyIMPRmsLt6jYbAyeZR/oNLPiLS3NyjwT3ZmWmE DQmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Ql+QylvB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v14-20020a056402184e00b0051a42ad4e14si2627119edy.517.2023.06.26.04.52.42; Mon, 26 Jun 2023 04:53:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Ql+QylvB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229728AbjFZLeo (ORCPT + 99 others); Mon, 26 Jun 2023 07:34:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230242AbjFZLeD (ORCPT ); Mon, 26 Jun 2023 07:34:03 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80DA0E4E; Mon, 26 Jun 2023 04:33:48 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-313f1085ac2so760521f8f.1; Mon, 26 Jun 2023 04:33:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687779227; x=1690371227; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=uWJ2m6hM9/UPQKvpX2tpk6Qe1joTg2sFo9t5IZ8C27Y=; b=Ql+QylvB8BF3n6GaTFakt0E4R1symVCHCxKDdOET0ikCKPKIj1sM99/pElSs9o4Xac 7fmS52uahIUk3AhQqELcArmqkluj4ZdAkE4PSfTbkrdRBehN3NVNog3rRzjkwlSIxuty XZSmuMaQq7YWHm5C9w2KjDDkgaG2fFgQsjsRtSxqgqs11IkOu5oaUEQFxAwtO6/gLNL3 7QdUXieZM76VQOVRDLSDhDVazpPogTKowWfw+++vKkL8vUkHIXja4x3PWNkVwvD+R/Xh g3cdNLtmJ/jlZmHpg2asTkQ/cHe+nzlvNAMtYsyhX6V146lfsXrT1rYfeI3YlJcVGzxf VzRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687779227; x=1690371227; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uWJ2m6hM9/UPQKvpX2tpk6Qe1joTg2sFo9t5IZ8C27Y=; b=GdALX3x16AIWMkswHqsHfoSC8O60CA1I5Ti4rlZDuVuFUl/4K7VH69y5fJ4vtSOA7t MC5P/uMrx2qXrpazJNtS+05xtRX1RMgOuYBe9l69W7fkdsSr3y3fdQ9RYxGaiT/3NuDr xSpt5OqAC++89LEKW0lbLZa+eaAULKAT2b/m7CJWEB8yq5O16XYPQc5BlkSqbvxhTuUP cuyuZ1pBVfCJQzGVUcv8TDnmg8DP58T1YMH8lgx/ADztpPfC2k8B3D4ky2Z2zvkzndfx D+5RXA+Q8WahTHbiOgYTDxPRtq0WUkRHLysdC/AumudyzHijeSlUS/Kk0g1pFhzFQxi8 7uzg== X-Gm-Message-State: AC+VfDwjJuG1mlmsqkpeNzTflTKF3AvjAMx/8f7dFbZkVk95qJ9RUjjZ mkmO+pL/Xt8Ag/r7d5eOfXM= X-Received: by 2002:a5d:4242:0:b0:311:de0:8975 with SMTP id s2-20020a5d4242000000b003110de08975mr19166661wrr.55.1687779226846; Mon, 26 Jun 2023 04:33:46 -0700 (PDT) Received: from ?IPV6:2a00:e180:158d:7600:d62f:c4fb:6eee:7b87? ([2a00:e180:158d:7600:d62f:c4fb:6eee:7b87]) by smtp.gmail.com with ESMTPSA id u18-20020a5d6ad2000000b00313e90d1d0dsm5186467wrw.112.2023.06.26.04.33.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Jun 2023 04:33:46 -0700 (PDT) Message-ID: Date: Mon, 26 Jun 2023 13:33:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v2 4/4] drm/ttm: Don't leak a resource on swapout move error Content-Language: en-US To: =?UTF-8?Q?Thomas_Hellstr=c3=b6m?= , intel-xe@lists.freedesktop.org Cc: =?UTF-8?Q?Christian_K=c3=b6nig?= , dri-devel@lists.freedesktop.org, stable@vger.kernel.org, Nirmoy Das , Andi Shyti , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20230626091450.14757-1-thomas.hellstrom@linux.intel.com> <20230626091450.14757-5-thomas.hellstrom@linux.intel.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: <20230626091450.14757-5-thomas.hellstrom@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 26.06.23 um 11:14 schrieb Thomas Hellström: > If moving the bo to system for swapout failed, we were leaking > a resource. Fix. > > Fixes: bfa3357ef9ab ("drm/ttm: allocate resource object instead of embedding it v2") > Cc: Christian König > Cc: "Christian König" > Cc: dri-devel@lists.freedesktop.org > Cc: # v5.14+ > Signed-off-by: Thomas Hellström > Reviewed-by: Nirmoy Das > Reviewed-by: Andi Shyti Reviewed-by: Christian König > --- > drivers/gpu/drm/ttm/ttm_bo.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c > index c0e3bbd21d3d..d9a8f227f310 100644 > --- a/drivers/gpu/drm/ttm/ttm_bo.c > +++ b/drivers/gpu/drm/ttm/ttm_bo.c > @@ -1166,6 +1166,7 @@ int ttm_bo_swapout(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx, > ret = ttm_bo_handle_move_mem(bo, evict_mem, true, ctx, &hop); > if (unlikely(ret != 0)) { > WARN(ret == -EMULTIHOP, "Unexpected multihop in swaput - likely driver bug.\n"); > + ttm_resource_free(bo, &evict_mem); > goto out; > } > }