Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16089469rwd; Mon, 26 Jun 2023 05:44:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4+YpNoTJZAT/dyLLfAv2mzIXp7Fgs0eE0o+FQ71Q0RJuJeXVySrGtR0uPRaEUr0g6Fpwvx X-Received: by 2002:a17:906:6a0f:b0:98e:3fb1:6445 with SMTP id qw15-20020a1709066a0f00b0098e3fb16445mr3747656ejc.24.1687783498097; Mon, 26 Jun 2023 05:44:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687783498; cv=none; d=google.com; s=arc-20160816; b=n21ZWR8d3rJyZdc84l4faiqJsa9H9TEaWWS3rQkfxFk5Y1zbPcNqZZ/9x1h9Ch6e9P q6tCPDvp9BKD1PdZJQ61bWoY5SC0BmQFjGXHYgIQNGTNFBxjMRDBLOLlHzShqSzaH1hZ NJbsM1QzEovKigs3XZDDneAvAv0jLV3F3xdt+QQubBT4RV4Ju3Bo9qta2krTz9ox8EJp EWt4vtZrq8fd1eMMZQ8R9wK7kgm5blsT9NeyX731Fp11Vuo/8Qs8Evu54GAMbGa7mF+G rmn9ocP2wtKPZnOH6R3v/o57ePckICi4MMBCBBTsf/glZBgnVgw8E4l10cp54zg7Tl1e hRew== 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=jYFau4ldCGwOVbhMsUhfiqpORxyr0TAU3v3/p2zvPtA=; fh=sMHiS4FCXJfK1GbtUSLQrFJmOwCeET0I02DMK7qYuEk=; b=RUYYL1AwOO6IWTonQ30MJjTxsdPG+CNWkHob1m25A0ls1ALN83isvIT1PEWcwex+Cz 4pdBWj/GfAaMty6L24/ql1kLuAV1dTBX3GFfHkpqly3PzXQENwKLCHTU1b7ddUJvHArt Rvy3deFN/U1CHRS2DxC1OtRiqCzoQdTKAZq5HeaIwTe02ZTFrhYNeBJRMpdC2Nxu4ZMx 7YSqhhxEKLYQr1Vx8ZqPg3glMAhVLbeLNTzlqz8LdBQxCjqsTZJB6Dx195fYroYN/ShB XAG3fRh94F6vY/3RhNOD1e/JqjXUrKs00h+f6cSqjM7DX1F7HwZlhRx6467eTlgB/mxJ tD2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="BCd/MaiD"; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k25-20020a17090666d900b009892044ecb7si2876966ejp.496.2023.06.26.05.44.32; Mon, 26 Jun 2023 05:44:58 -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=@intel.com header.s=Intel header.b="BCd/MaiD"; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230471AbjFZMZM (ORCPT + 99 others); Mon, 26 Jun 2023 08:25:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbjFZMYl (ORCPT ); Mon, 26 Jun 2023 08:24:41 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 654372D62; Mon, 26 Jun 2023 05:23:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687782192; x=1719318192; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=QAtvPIkccnlu6Ank7qJ23cw0df5MPmI943wyhruOK7I=; b=BCd/MaiDg+HtxceL576XQeC0hn9/ZvEeSfwoeuiOJZWGP+jJl6TYOdmK VQSoFh8FwlWt8ia506twE8fnK3jG9X0eIMj/MbMr676r57VDyS5kCLenV x3Qqvbq9ihYY8xUrr1fR7dWA71/aJO6dUsbXH+WmSv6ZTNT5RNzkOn3QX Y38HH2oq+NptrIP09t0lUSBfy2+zZYuVDIgLG62Oc7K0nHdXgTOF9sBJ1 LpHMVQe5+CsbA9m9HKSs9kdB1+y8PFtniNySzwfhAtXZ2YoGbbfSj26Jy oRxiJI5VDEea7PlDjXVz5Q5lJIXcN5uHz44YkFQNj6kYBojOlf2hrVSa/ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10752"; a="424921617" X-IronPort-AV: E=Sophos;i="6.01,159,1684825200"; d="scan'208";a="424921617" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2023 05:23:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10752"; a="1046490771" X-IronPort-AV: E=Sophos;i="6.01,159,1684825200"; d="scan'208";a="1046490771" Received: from ettammin-mobl1.ger.corp.intel.com (HELO [10.249.254.105]) ([10.249.254.105]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jun 2023 05:23:09 -0700 Message-ID: Date: Mon, 26 Jun 2023 14:23:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.1 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?Christian_K=c3=b6nig?= , 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?Thomas_Hellstr=c3=b6m?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,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 Hi, Christian, Will you take a look at 2/4 as well? Will you merge these? Thanks, Thomas On 6/26/23 13:33, Christian König wrote: > 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; >>           } >>       } >