Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3841431pxb; Mon, 21 Feb 2022 06:49:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJya7O5KS3cwf1BaShr2z025L/2vzAXTNZ5v6CR1lDo9/RzK68Q3FfFZW2vwrRnlSIp6gtW0 X-Received: by 2002:a17:90a:342:b0:1b9:eb69:7b41 with SMTP id 2-20020a17090a034200b001b9eb697b41mr25922988pjf.41.1645454942776; Mon, 21 Feb 2022 06:49:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645454942; cv=none; d=google.com; s=arc-20160816; b=sAb8zewmXPwQhGlgfP7va372tYG9n51aWXx5NZcUx6cPTncZoN7wtxce10pXYlW30/ W5tYpGV/58feOb6xB42Rm3ffJK2nlHGPT8WG3yx+nUagvNS1ez283V74WwNV+K8DaNqq +pcqT2E+r+Y9NzYXlDBwJF4Quv8Mun94xWF68zSVXMRnyBYUQyKGJbeSV3xtqzlRxomc TVcm41XIgurgkAcFHIpMiJkG64tp/wWD5hVNkjupwButoBff3RcchXCfonsQ0qZInDBW 9Vejl/n/XStIVlGskWFOIdXDMynNh427cCxpOZlzO/oqmJk2mcIEqTREdU739YgSDRnm rF6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8q9yz6amwD8RrlHdJMe6LgpF0DOHtyPMQib0+5TQB6Y=; b=0G1A6VlrXx56qOJk/zCVqUei8Li4LMsPoozu7/mh9nZDrhVexLgA1UPahMD4INbSSG 3eOgr0HoYxO+eTnPIzEwT9LEKQs+rctgvsWnH1AAXV8HjK/YMQQqj/+1zd2eTgm1VwTp oBxd4VOBwJvCFWNKx+y7hjzxxdJmX0FsznzxKZdaxcD0hnOqH2ucz1oGkkg8COmpb38P mvqizefteBbsmUC3PqLoVw4L1YiqSmpvTLPgt0jcrLZrgWQxd7pBYepSwfya0uJYakAt RS3+WvdLMafxYXovJ+1BL9Q/ycX6uqCv+5WPnkSfb7XSfg3fMhh5zfhkvnXV+v3v1hRK bUFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wrGjg0Zz; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fw17si5266832pjb.75.2022.02.21.06.48.47; Mon, 21 Feb 2022 06:49:02 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=wrGjg0Zz; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353131AbiBUJ5N (ORCPT + 99 others); Mon, 21 Feb 2022 04:57:13 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352799AbiBUJrz (ORCPT ); Mon, 21 Feb 2022 04:47:55 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83ACC43EFC; Mon, 21 Feb 2022 01:20:30 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 19AD160B1E; Mon, 21 Feb 2022 09:20:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 057C5C340E9; Mon, 21 Feb 2022 09:20:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645435229; bh=RJrbhiB+QqFTSX2dxz9U5PNVkSWtc67m/JMmEgb5Ax4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wrGjg0ZzNfK7USS3lpOMqUu53uivj7qHRDGs91WNO/HyAquvDm3axypyG7F0VuEIw GoC4UhUgmHg0Be15vXiJdmIs+4GEBbdpRtPJmicFrXfN1KsC/4/CNzlEbjUd4RqYlw E0lmWqQWUJeZ8uNKJUPTuE0ThKDEJK6lxUEcd/og= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matthew Auld , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Tvrtko Ursulin Subject: [PATCH 5.16 091/227] drm/i915/ttm: tweak priority hint selection Date: Mon, 21 Feb 2022 09:48:30 +0100 Message-Id: <20220221084937.897987684@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084934.836145070@linuxfoundation.org> References: <20220221084934.836145070@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 From: Matthew Auld commit 0bdc0a0699929c814a8aecd55d2accb8c11beae2 upstream. For some reason we are selecting PRIO_HAS_PAGES when we don't have mm.pages, and vice versa. v2(Thomas): - Add missing fixes tag Fixes: 213d50927763 ("drm/i915/ttm: Introduce a TTM i915 gem object backend") Signed-off-by: Matthew Auld Cc: Thomas Hellström Reviewed-by: Thomas Hellström Link: https://patchwork.freedesktop.org/patch/msgid/20220209111652.468762-1-matthew.auld@intel.com (cherry picked from commit ba2c5d15022a565da187d90e2fe44768e33e5034) Signed-off-by: Tvrtko Ursulin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c @@ -787,11 +787,9 @@ static void i915_ttm_adjust_lru(struct d if (obj->mm.madv != I915_MADV_WILLNEED) { bo->priority = I915_TTM_PRIO_PURGE; } else if (!i915_gem_object_has_pages(obj)) { - if (bo->priority < I915_TTM_PRIO_HAS_PAGES) - bo->priority = I915_TTM_PRIO_HAS_PAGES; + bo->priority = I915_TTM_PRIO_NO_PAGES; } else { - if (bo->priority > I915_TTM_PRIO_NO_PAGES) - bo->priority = I915_TTM_PRIO_NO_PAGES; + bo->priority = I915_TTM_PRIO_HAS_PAGES; } ttm_bo_move_to_lru_tail(bo, bo->resource, NULL);