From patchwork Tue Dec 12 09:33:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "He, Hongbo" X-Patchwork-Id: 10106563 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A358A602C2 for ; Tue, 12 Dec 2017 09:35:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9984A29B64 for ; Tue, 12 Dec 2017 09:35:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D9EB29B44; Tue, 12 Dec 2017 09:35:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1D35929B44 for ; Tue, 12 Dec 2017 09:35:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 785AF6E337; Tue, 12 Dec 2017 09:35:47 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0047.outbound.protection.outlook.com [104.47.34.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id F00F06E337; Tue, 12 Dec 2017 09:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=PLa+0rOJa0h0iTI8hwYjcE8Y+xoF1i0s65PNhLbTV4g=; b=iVUjV80Yk+fA01BQkVnT6xDHSu5JGuLUHPndF9hbB4ap3ClN71YopxayokyVxUkBEBejrndWMwxGrhJuknABUn2vKQpYscCjyisUXds6Hy0BKX3IbqTIoZwHqzsT7B+MNTwo4JjjDIbUKvO4hHvcpZJYRUwop2n5nuJR8og1m54= Received: from CY1PR1201CA0041.namprd12.prod.outlook.com (10.169.17.179) by BN6PR1201MB0051.namprd12.prod.outlook.com (10.174.114.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 09:35:38 +0000 Received: from CO1NAM03FT013.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::205) by CY1PR1201CA0041.outlook.office365.com (2a01:111:e400:5b9a::51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Tue, 12 Dec 2017 09:35:38 +0000 Authentication-Results: spf=none (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=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT013.mail.protection.outlook.com (10.152.80.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.302.6 via Frontend Transport; Tue, 12 Dec 2017 09:35:37 +0000 Received: from roger-build-server.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.361.1; Tue, 12 Dec 2017 03:35:36 -0600 From: Roger He To: , Subject: [PATCH 5/6] drm/ttm: enable eviction for Per-VM-BO Date: Tue, 12 Dec 2017 17:33:47 +0800 Message-ID: <1513071228-29551-5-git-send-email-Hongbo.He@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513071228-29551-1-git-send-email-Hongbo.He@amd.com> References: <1513071228-29551-1-git-send-email-Hongbo.He@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(376002)(39860400002)(346002)(2980300002)(428003)(199004)(189003)(50226002)(50466002)(53936002)(8936002)(48376002)(97736004)(53416004)(7696005)(76176011)(51416003)(106466001)(110136005)(16586007)(47776003)(68736007)(316002)(36756003)(105586002)(2950100002)(6666003)(4326008)(5660300001)(77096006)(450100002)(575784001)(86362001)(508600001)(2906002)(230783001)(104016004)(8676002)(356003)(72206003)(81156014)(81166006)(59450400001)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1201MB0051; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT013; 1:zMatpR9eAiKAiYiaRqthytcIuvM0uVNi88I2R4Zjcf27gG2puE9ZcYZu1+61VLYKi12OjFnVtEak42IBdNgz4FBO1ryOhff7QT+0SUGDJ4mA2Ohzyr3q/uSeAKE+1ikH X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ccc2f1fd-f564-4aef-c720-08d54143b401 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307); SRVR:BN6PR1201MB0051; X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0051; 3:npf9vYMQY2NX8V/M2NQporh0kNWNxzC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HVfTVnfnsuE85GS9u157IlPwZR4UHLax03Hbkdbey/PlbVb4gGfA7YL+QuDYU09UeFrX9cRgC+CuI10Z9AB0LiE3ogjLT/H+y5BUo+RwQRCFLMqg4TPnLZYP1hG7+ifX1CxmBj1AJwhjDuIG87j/T77f8RfuUn1IAlmSmSH23zsUwq0u/t7Jkl1A+MTv0MVOoXzwbezJA8Az9qMQcH8Bj/myr0zHnM7oOr5WUIl1cve177HOKaCue67GAu0QOt++YRlx6yrFJ1yujG7IqkbiB4aLlgpbc1l2aKfluKOz7qhgAgbGW6wzHagjTo16opRxeYVsgj1szNXnJSuqqJGNV0igOJXQ8kjXk2XsQDU4c6xR27QNEVVStS8AJCxJQc6RFAD3kavgutvXV/uCeDD2Dk0OS/4UrDUma4FTjumyaIU/93TZkOa X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(93003095)(3002001)(3231023)(10201501046)(6055026)(6041248)(20161123558100)(20161123560025)(201703131423075)(201703011903075)(201702281528075)(201703061421075)(20161123562025)(20161123555025)(20161123564025)(6072148)(201708071742011); SRVR:BN6PR1201MB0051; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BN6PR1201MB0051; X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0051; 4:5O6Tm1OE0icHlpdbBP5m4I+dlf3+knxpz7K5DHq4PhY2YgyL7EXGqSlhWThyS315NPxdJMpjsSdBxk/9GP687+S0uMPq9uVwiIoQosn0k9npDOBMuvsQsVa2wsv9sptVbcy2SFcjc5NUC44rfJI9LqTFcI8mp278tuwU88IRsNJ+u4mKIkRiK+Dbko9MfjnpHja/j7riReOveBQfefeOhYdZ02eRGmsj8884XA/W8/GZhNG6jtPCI9tG26jOU0eso3Oskcb5ZpDATnSOWUwFIxv4TSsgTXRjxVgemHK0XoWQHlY3FmSJgGgKSe9t6XMt X-Forefront-PRVS: 051900244E X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR1201MB0051; 23:gTGyGs0U0xBBBYzmdId2C+zoTHSj/iHDlND+1wt?= =?us-ascii?Q?NDwTIhaeCFaJgQZPLW2ShfURDlyw7swgVHx6hclUp6CphgcpJpx3cq8cxC8D?= =?us-ascii?Q?uU4aZH6CFd0JXCAvzMjhEH8n+AmkVcYWfVg9cE34vQjuNlJtWroV6yHdUiOv?= =?us-ascii?Q?WO3bM3XgN57qGmjf7GPLMA5HiQMd58anLYZGl5hsypa5e53o1/zjfCHwMQyf?= =?us-ascii?Q?nKMUD3w9lqHs6oQI7GNKEO5P8NSuqJ3/8BSBj71yzxebti+AooRccG9NcKdq?= =?us-ascii?Q?Ef/jw8gcZ2HwjdBnTsViFVTTUndhIkpWX2BQ3h3o7zxfGwsGwHu6h0ic6qWI?= =?us-ascii?Q?EhXeyoKuVcH1TuxssYAKhrMizMk1RmJqX+pRstg3YV8t83tPkDGxK3vBKS+u?= =?us-ascii?Q?WoIKsdYmV3Q+nPZXnp6VdXtLymPpRV9/W3M7trIDuVKO4pEO0El+2GVJulrC?= =?us-ascii?Q?zVe2dTA5zUbSHiP9AI6JJLlnGfEEW0kz8JhjAufS7QRjlPntNqMza5V0gCPD?= =?us-ascii?Q?wbrRboak5O7K1vDjB/qzphkcr6cBvYRBXrBUw1QH9rvWtqSTMI1FlEDaJ5vQ?= =?us-ascii?Q?/7+H7n6RLh2yhHFmJskidN49BVE/pdqvPjePO/yjo1/OAFEhonhnlbwsdbBs?= =?us-ascii?Q?6gONYG+akJNznhop7qPFzjZ5Zrp5+tMi8gF1RVEUMttnyUBVGxw8cq8WoeBY?= =?us-ascii?Q?zE9WejJ3xH1ORK7nMNgpYSfD8XTchg4bi+wAIO3phYtl8yJG/EQ/OUpvmHbd?= =?us-ascii?Q?eeX50WM1r7Q1iUILlIDSSmged9r4v1XaonddL8NQfOQqSJFPcPcy8mwGz1eJ?= =?us-ascii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Kf1yQNrk9F/6uZOANPs5uSR+IEd76w7KgDTitrGozhNIdTeZcTJcC2GLnYLtw+BmG87KvT6Do8G3Ku57oeO48FZDgssXlezMAmfGVZ2Wl9uJJ130OLYeS5fruFB1VpMogVX+4+Ur8tWdKVGFa4MRZRem5sM1aTEW6pq7IPmasZOl0IlZ99i/6zEQaML00vIStBnQn/auE0a SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0051; 20:g3ms9cuD+dXgQF3Lf8iwRnovxmXY+rEQpG/mj79R/X17elFUqd5qlhiJpB0hHBJqLEjaA17LMH935oT0+pLOIs9XNUDCGZJGFGF2XzXx1hRZ2KJNJPSHfnIposqkSRFXZVic033fk3XtsUsN2gzHPq27eS4HoczM+jz7Ifh2g01Ukc1Z2Zw41ZAcQynJ4MA4NPclZSBdu8wNrCDf3VGaEG3WnvLxzfidJOip4kSrOnySBegfaNpcte7Svj3zAUMF X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 09:35:37.9547 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ccc2f1fd-f564-4aef-c720-08d54143b401 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB0051 Cc: Roger He X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Change-Id: I491d4ceb8c98bb3d8e6e0ddef2330284ce2fe5f6 Signed-off-by: Roger He --- drivers/gpu/drm/ttm/ttm_bo.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index eb8c568..22b6ca5 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -722,10 +722,9 @@ static int ttm_mem_evict_first(struct ttm_bo_device *bdev, spin_lock(&glob->lru_lock); for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) { list_for_each_entry(bo, &man->lru[i], lru) { - if (bo->resv == resv) { - if (list_empty(&bo->ddestroy)) - continue; - } else { + if (!ctx || + !(ctx->on_alloc_stage && + bo->resv == ctx->resv)) { locked = reservation_object_trylock(bo->resv); if (!locked) continue;