From patchwork Wed Nov 10 04:31:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Pan, Xinhui" X-Patchwork-Id: 12611349 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 0C2D0C433FE for ; Wed, 10 Nov 2021 04:34:19 +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 C61226117A for ; Wed, 10 Nov 2021 04:34:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C61226117A Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.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 807E96FD0D; Wed, 10 Nov 2021 04:34:11 +0000 (UTC) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2053.outbound.protection.outlook.com [40.107.96.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id E4A1B6FCC8; Wed, 10 Nov 2021 04:34:09 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WAZeAJgWryGjRCZtiw1grEEumt+8siHCTBBTsi2lOyqWg96N6NERgNedTyeEWUDHms6j7divzjZ+CmthfHHGvABvFoX4sGnYKOX9sAW5ItlOookaDhqy9KyouVwG3/wOawHICQWq0PAV7UiL7w+8GDqHganPEmqNEYj7qD6nW/u3FoIRq5KjockT3Q5nL895+1Dc2NUdModZ7Bx/oNsmQAl5HQTSS/sqHjlZ5Bwhk/VTBPYV57bNVC4VOpCwnbdHW6jn1tCLrUUG82/69FljPFeayCTBvSCvltvQs0YdOOVdDOrVGrL7nR4ZnpJ6OqUjmFahmPoEcf+74ubYvV0Xvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pUWwWOdv2rUQI0P8OO1qfJ7hH45ytnsQ97K9I0GusXw=; b=GsgydpBme9J0FZuEjqsVQ/pfWIP6TyHQPMVNe9jJ8+ljpcKZISzMrP4WrOjfejfyD1CfsEEHyMSuQfBZMckP8zDXiniaYzQTf57jA+dtH2SfTVmI0YLUDZkOJGU1PIbYoEcCq+3gt5HPUT6dVzjQwboimWBsfI415Z5kbiP5ZEuSHwvB23OizN6p5qJoJnLJUqFHmuj4X7Ah6lqw3v/G0KPMBmTk3mAOPq+FrRiMttnepe+2TN8GpjpbaPICftwottVOt5eJhfKyYGj2LQoS6ZgPSYUFk/MIOqhi7thAgzo5S0lr+fyVRbwHOrJQQS/ZAnJtZ3EiXhZwTN51+AGB8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pUWwWOdv2rUQI0P8OO1qfJ7hH45ytnsQ97K9I0GusXw=; b=orceaipSB6F7UulumgNETQham+kD2CnTSu1aHIBmr+oArV0Wyw2jxrp3tp1kR6r4+gu6uqwxy9FmkpcE9uH2o6a279NGAtyepPQkFBA8Pf8fy8nxNYPUbLLCqiKb2MG7Gu5KnSAPQSa7iihME2PaSjDvAIVpy5jwrn5np7HoDDU= Received: from MW4PR03CA0314.namprd03.prod.outlook.com (2603:10b6:303:dd::19) by BYAPR12MB3286.namprd12.prod.outlook.com (2603:10b6:a03:139::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.15; Wed, 10 Nov 2021 04:34:04 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:303:dd:cafe::1b) by MW4PR03CA0314.outlook.office365.com (2603:10b6:303:dd::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16 via Frontend Transport; Wed, 10 Nov 2021 04:34:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 04:34:04 +0000 Received: from pp-server-two.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Tue, 9 Nov 2021 22:33:59 -0600 From: xinhui pan To: Subject: [PATCH 1/2] drm/ttm: Put BO in its memory manager's lru list Date: Wed, 10 Nov 2021 12:31:48 +0800 Message-ID: <20211110043149.57554-1-xinhui.pan@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2e8285e8-9229-4453-4997-08d9a4035390 X-MS-TrafficTypeDiagnostic: BYAPR12MB3286: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2733; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pnBj7yKhY75O1DAjQpZ4o7JZLQs+Ct+9VNGY1z1afCO9dXLYSO6zvj3FhVVQ1lYzpOpbmr70C1OLfCU473hrhZ258AeO7aWIPgkc7/DZ4AUdjaT/JwcjxFQKRSTnelfdZrANo7WR56YLcy57lWB9z8lwGCnNDyAv9a23iPfnRv5MfqCDY9EkSPOX8GrOdd/K1h5NQjw2QWV28BHj03WpqSc3RXTKN7nSOuvKOPMhbYxvmySNS1LjnY3sDYYah+DJypacyhzm9lWh2xUnASWnsGFBWP5IfxScQtvF8ANTAVH0KoEoZx3OXi3XNb62vlX1bdB9gq0+2JS5IdbGXVMl1lzNjjyr7FB5usVXP8DyCwhpsJ33Yt18hjRKMeeXT/AEfAy/YB6/Go3GrX3bbZscSkXfr6zRW3mhTV+heni1st2jobHoTR0j+wsYUQUUMbZB9cabODEfOv5I5QkVjQL8MlCi1PgznxwYEkzivRnI84prgQgQqq1EWvY6iJSx+sdOOIylZt9+KCXHgC2NK0PH7ik23xDHoWG1FbEkO9axpSfIgazZepyWuf4eqBZdD7JVeOXaYv+MrroALOWSppZFNOPwWMrS2dmHeURBhPIuYrFvF1DgtIiiUWL6NBmb+zxzcDuvQ+g8r6+Fzr3S366uG0KLD65TpdQlF7TluJeGv6zsNlyi5K2/rbq/k57aFqcIxzWhjY9F4yGx/Zw6I3TIXyCZ+bPKLNT6nCrY/xtnX6Y= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(46966006)(36840700001)(5660300002)(4744005)(336012)(70206006)(508600001)(6916009)(81166007)(7696005)(356005)(4326008)(83380400001)(70586007)(36756003)(2906002)(426003)(36860700001)(8936002)(8676002)(86362001)(186003)(316002)(47076005)(6666004)(82310400003)(54906003)(16526019)(1076003)(66574015)(2616005)(26005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 04:34:04.1618 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e8285e8-9229-4453-4997-08d9a4035390 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3286 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stable@vger.kernel.org, xinhui pan , christian.koenig@amd.com, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" After we move BO to a new memory region, we should put it to the new memory manager's lru list regardless we unlock the resv or not. Cc: stable@vger.kernel.org Reviewed-by: Christian König Signed-off-by: xinhui pan --- drivers/gpu/drm/ttm/ttm_bo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index f1367107925b..e307004f0b28 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -701,6 +701,8 @@ int ttm_mem_evict_first(struct ttm_device *bdev, ret = ttm_bo_evict(bo, ctx); if (locked) ttm_bo_unreserve(bo); + else + ttm_bo_move_to_lru_tail_unlocked(bo); ttm_bo_put(bo); return ret; From patchwork Wed Nov 10 04:31:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Pan, Xinhui" X-Patchwork-Id: 12611347 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 E1711C433F5 for ; Wed, 10 Nov 2021 04:34:13 +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 9E19961053 for ; Wed, 10 Nov 2021 04:34:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9E19961053 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.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 894166FD0A; Wed, 10 Nov 2021 04:34:10 +0000 (UTC) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2082.outbound.protection.outlook.com [40.107.92.82]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6694A6FCC8; Wed, 10 Nov 2021 04:34:09 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WmBdwpDB2pYD+Ew+2d8xxhHoRQxz8V76i3J/Ejd95TURqPwRQLwgu38PwT/Hpf+/ue0wnroUqOTz2efHKqJwzBPsdN8hEtTz3e0T13BdsPxM/QZs7qFn1Q5wNWP55m1OUJTVLkblpG56WUF8EqPEL3yWHnIFt5dkwQbfwiLPEkA4z4M+uKd9OlUyflj8waPfg7px55F5KoU+fGtj1FdFYprhT3dV+InBOgsJLg5NNVSG+EoocJfJBhiob/th35TRbYESIdGsd75bm+SDYcj84BaXtnFb6rJ+ELVBy7cfigjo7kTXJtAIhiDdMiFxwoBImybgat3A2uB8B5QRbKCjmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pYO3c4VkCJkbruJQtg4Rxyya8fbeq6Fr7b7l1BNtOBA=; b=Usb6w8z0k71+p4+wqXJw40KQNb7Ewq4B96eIvZ8imyaAknoEhrVXJGwqu5iJvr+Jw7lyVLNtOzUwMMPROnz55/MMjdHR/GdXfQiGhnvdZSIQT62GMlQJ+Jl9XnDP0OTeopC+4ltv+3BH/fw086fQRRLSG/Sn9j7FdTsH1onTtetmlWyzomAQO+e1ShLUW4Y7boHdAEbm3h4gtWhhfsz35By+I5vxk85zRUtKRC+PiA8ADE9HG7/bUdpRvg0/SxwkblbtrG6tuR3iyZ1tkWV2CV29VFsNVYSGHMBCX5CLeEcM+ehFoKTnrA3JLeKfq2u5u9SC7QW2DL13AyJ0Yc9arA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pYO3c4VkCJkbruJQtg4Rxyya8fbeq6Fr7b7l1BNtOBA=; b=S/yWv/MltWBdsNDUpyHh0gB5oRccjUOTar6c1nDTE8OTl/XzpE+DChsldSOdJFAQKPoR0MwWK3+5A/IYyIYzFldw4TNtk3yLoLO/H3sMJPvL9EkLAdiIu+ABwBCATG5ux7tRGUNe1NezXC6bjH1DWC0hAnJj23+5RF1Elq0UP9I= Received: from MW4PR03CA0316.namprd03.prod.outlook.com (2603:10b6:303:dd::21) by BN6PR12MB1555.namprd12.prod.outlook.com (2603:10b6:405:5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 10 Nov 2021 04:34:06 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:303:dd:cafe::af) by MW4PR03CA0316.outlook.office365.com (2603:10b6:303:dd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.16 via Frontend Transport; Wed, 10 Nov 2021 04:34:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 04:34:06 +0000 Received: from pp-server-two.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Tue, 9 Nov 2021 22:34:01 -0600 From: xinhui pan To: Subject: [PATCH 2/2] drm/ttm: Double check mem_type of BO while eviction Date: Wed, 10 Nov 2021 12:31:49 +0800 Message-ID: <20211110043149.57554-2-xinhui.pan@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211110043149.57554-1-xinhui.pan@amd.com> References: <20211110043149.57554-1-xinhui.pan@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 56b2e24d-10ef-47e9-191a-08d9a40354e0 X-MS-TrafficTypeDiagnostic: BN6PR12MB1555: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2512; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 56hkFLO8cN+4iTXY4DAA01lA/Lzww2dHRCMtGHP7XIdChFJX0v1k/IDbKI/URTiuBgegi1/oJVOJAcmkRvLTuZqCyYrWdI2ZEG14et3CoPIHkLWImBOJMfExMzzYyrZFmENFuTUguOwUBADh7Gg3pB2WVjV1/Fs5M3rRNFU/nkkgaYttx5rnzWOIddeFwKggLZMd4Qp95WZVf36U5PfTbGaUHuuUMTwA48i1ZeL9hbA/OYvPcOGNXQFzkv+Lc6r65I9vc6SL5soyfbzGfC6KtfRzh8egKrwNgMjq3R9fjPU9uRJD/ibQXYP4MHD5g8Gr8hi4kRTb+7DaamQNog53Q6cOGEWxCgkgzH9zl3SCaEsNxqYJrgJVCTktStje2GPPxCWiY0nJDVQ9/n4aZ9R8LSXi6ZPpgqCXze5Ve7BUgmwYCHAtEi93/Ay6i07EhF8piizVLgjR/WyvgNgfxbp2VWlyfFIIy1q13OAebgMU3KqUG8KfJ0gFrEGw5etprzTsaBXuNN8fsDLEwFVEPuwUunFWLgS0erJaKvwgVKnJrtcRmHRp1aewFqm3gl/AkfhFaW3hJTralBt14a7k9AruWxqO+vrZbvXKkVut4b0o4Kqz9KSBwZjEoD1jkgMzU/gUHBhGKJHIaw3li+HamELDPdPsTNKjLlskYGGaOgYORgSZkFa4k8YNwpAZS2OkIchPE19rzfDlV+Nz3Lfd/TWWVvhZt2JsUl7r+vwlbORBbF4= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(83380400001)(4326008)(86362001)(7696005)(5660300002)(450100002)(36860700001)(81166007)(16526019)(26005)(66574015)(1076003)(47076005)(356005)(6666004)(82310400003)(36756003)(6916009)(186003)(70206006)(70586007)(8936002)(508600001)(2616005)(54906003)(316002)(2906002)(426003)(4744005)(336012)(8676002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 04:34:06.3126 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 56b2e24d-10ef-47e9-191a-08d9a40354e0 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1555 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: xinhui pan , christian.koenig@amd.com, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" BO might sit in a wrong lru list as there is a small period of memory moving and lru list updating. Lets skip eviction if we hit such mismatch. Suggested-by: Christian König Signed-off-by: xinhui pan Reviewed-by: Christian König for the series. --- drivers/gpu/drm/ttm/ttm_bo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index e307004f0b28..0137a302f261 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -594,7 +594,8 @@ static bool ttm_bo_evict_swapout_allowable(struct ttm_buffer_object *bo, *busy = !ret; } - if (ret && place && !bo->bdev->funcs->eviction_valuable(bo, place)) { + if (ret && place && (bo->resource->mem_type != place->mem_type || + !bo->bdev->funcs->eviction_valuable(bo, place))) { ret = false; if (*locked) { dma_resv_unlock(bo->base.resv);