From patchwork Mon Dec 25 06:07:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "He, Hongbo" X-Patchwork-Id: 10132311 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 B4BE26037D for ; Mon, 25 Dec 2017 06:08:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A51F928531 for ; Mon, 25 Dec 2017 06:08:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 986DB28B88; Mon, 25 Dec 2017 06:08:46 +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 13C9728531 for ; Mon, 25 Dec 2017 06:08:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A53D76E00E; Mon, 25 Dec 2017 06:08:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0079.outbound.protection.outlook.com [104.47.40.79]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4DD6E6E00E for ; Mon, 25 Dec 2017 06:08:44 +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=vd/4fzyBrxOsujSHfE3+0mFpXbcXsXPp1WKA/pfF+JA=; b=vQDa+H+S9Vspj4ohBUf+p7nqLkNbUONbN/dYKVP77zJjoVPlm9G7hY75GTI7YmU1jlWXmcFAziEgaQT0wSVV1tSsuAGAmOzKnEtjCi29eCI+j5AazlWgpeTEGj1C7wgXB+hBhLd94KjUPvPWpnLhHVoQmDxRMbAbdgMp1w6X+ng= Received: from DM3PR12CA0100.namprd12.prod.outlook.com (10.161.150.148) by CY4PR12MB1446.namprd12.prod.outlook.com (10.172.71.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Mon, 25 Dec 2017 06:08:42 +0000 Received: from DM3NAM03FT011.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::201) by DM3PR12CA0100.outlook.office365.com (2603:10b6:0:55::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.345.14 via Frontend Transport; Mon, 25 Dec 2017 06:08:42 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; shipmail.org; dkim=none (message not signed) header.d=none; shipmail.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 DM3NAM03FT011.mail.protection.outlook.com (10.152.82.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.345.12 via Frontend Transport; Mon, 25 Dec 2017 06:08:41 +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; Mon, 25 Dec 2017 00:08:39 -0600 From: Roger He To: Subject: [PATCH 3/3] drm/ttm: enable swapout for reserved BOs during allocation Date: Mon, 25 Dec 2017 14:07:32 +0800 Message-ID: <1514182052-20798-3-git-send-email-Hongbo.He@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1514182052-20798-1-git-send-email-Hongbo.He@amd.com> References: <1514182052-20798-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)(39860400002)(39380400002)(396003)(346002)(376002)(2980300002)(428003)(189003)(199004)(104016004)(81166006)(48376002)(2351001)(76176011)(50466002)(77096006)(59450400001)(51416003)(7696005)(8676002)(47776003)(8936002)(50226002)(4326008)(68736007)(97736004)(53416004)(5660300001)(575784001)(86362001)(36756003)(16586007)(106466001)(105586002)(305945005)(2950100002)(316002)(54906003)(6916009)(6666003)(53936002)(2906002)(81156014)(72206003)(356003)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1446; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT011; 1:Zc4e1WzU94osi/Od6HRfdv1WJ/Smu83g+p21ZGmQfbv+/qxyKsD3v5K8UC3Bwvu3Lu98peGAkPk+flGULTf6+zRRXz/mRGtTuuGZYNp+S2WWWcr9Q24jmjOh8+/JWKov X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 34593718-26d9-40b7-0a2e-08d54b5df2d7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:CY4PR12MB1446; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1446; 3:IuXT/G7wUOaGRcLkLmn4t7EBkEitsH5rCRLFnp/ORyyYk12kQ8CYRFbKxZT4/DJHN3dAtS53pI63ptDzQmHvY2pfvASCeE8xyevMEbhQtFu1ysjW+XN0g286OK42KAqBJJ0sy9vZZj5ZmiSTfOGdf6gYVdivj33mJbOQQgtN4jR97jqGeNnN6b+iA2L38cCvKUNq09s77nW/wain/l/XqzJlejK3pc7qe+7s924VwRBsz3nkdUDh7945HC+tSeKjWbvqfbwY1DVibOADHmTIxVREWvt2xivNACPzfUGCzwYGzZiUH0DyZetlf5qO+sLSzd8v5p2d/0BfpJHEn4LWU4AhzWtJp3BnUYKbqavIX6E=; 25:KOvUf8XaWHDS1WfMStR8KuqmIiSTlwczlkjHIJeGzXxd7i//xSpf+BdnOn2k9KSIm90k1id7cTUoG1kCC5VqE68jAb9HKsu6D7XStAOVK+twGTYrEramggg5P7oum4wfDVpP0zgXPOWLLairoQSaq08T9CUrB40c6fTaCQlDGtk/TSEQxaCn3RkY4cK3Xyg3W/CDIXBtxN/vqRXmiDZzC6Db4arws1cxYoLvk3+5hmORMKtS5MPhpuZkusWoJg6RZmmUKte7FxQ3v88N0v4yIFXMvxssSFtfHJDf3eXHmh0O21rqzImBWuCEB+CZPWFdSiCQso9UpEGcErYT0Ikk6w== X-MS-TrafficTypeDiagnostic: CY4PR12MB1446: X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1446; 31:jLJ9A+gVSysOdtYWCf8Qph6HrZ0Za6VMrbhljF/fCGGhGb9KlOTlHL+MfEsTe/C1Lnb6PApxBNVyGmxzyZuE+TnGQBMj/dM88ahsrEiUwwpJIkvImSwa6V9Dj3wOpIenejDVMVuD5gp/52N5Fa4AnrGx3hH7e/USMj+DXzbUe4CRfY3N5rJkQveh/BAxhVpWXZjmPc37Rvk67tTXHusPRYtffo20FY4Ze1IUR99Wyag=; 20:2SLCkVPI0zhBwTk4DU2KEX7UyzrOQZb3eaDe6F2xydy1j4assABSZvuPw7frarrxyJuiQDWQb50dIhXUBINuovBN9gKzdsWEZ/4hvS08m0Y8T8FXSA+ipOer+6fxRmy4vcChaEs0/pYmSmmrIs0Gw/O+CBUHwCiyeHYW8LlvdFWC+Km/ZeTkql73pP6sgJo1yRE/7JlBGTU0gHV/i4n8If00r/x3VnMFuAfehF5Igm0vqiuGeTngcbH4kaSxFKqudMN3Gs2H/EoqJYjZfTtCGQUCrK2PzNuP8n7XNj1TTYktQIatKjnhAm08sk86A7KiALqA57tUMKW5fjYmyEx0PA7b80WdFTuGue+bLSuExDI9seKO7UItjv6V0xAzHOrNQoW+8W48hrzK19VcwkZO5Tw+yWkQ8KHtMPrJ5aRsX/Jxyf0cyEHrhzz1/9zudiJWmH/hSzDpVBm3Fo4kYYuiMc0sFBRudBygHiMVfGmTBn0NNQyGsrprZX0wYVlEWgXn X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(93006095)(93003095)(3231023)(944501075)(3002001)(10201501046)(6055026)(6041268)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(6072148)(201708071742011); SRVR:CY4PR12MB1446; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR12MB1446; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1446; 4:XYr5Zjn9gMDmtQmV1AFVctu+kT5aoPfneMRkSpG1vcB+5AToeigK0biwQo+ZTXC74wcLIPaxUMKs3zT0r7fvi2+MjNd5Nyr51mCB524olcztsLN2zfsWDecT4CA/nA6XseZU7RD4PB3lIndAacACDJIQLTwZKiaetfOr+f5hBWBJthGURpltoQFNFJNrn2bmh79EDBJdD87XGmQlhQvXQ+1k4Ytgoz8gFd6BiV/ZjBwDfQv+EhZLHwEMCCUgP1nkw112xIB+fHJdrgGFBsmuyi1NSZ9vnkPgzRD5FtB+gseGoiZFvDHxL1evjLkSJm7M X-Forefront-PRVS: 0532BF6DC2 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1446; 23:YWDvyIIz1wGh1PGuIu9uXVuNcY1MU2a4HVD2qpgEp?= =?us-ascii?Q?TtqjXHg5U4AF/Q/GdFBFcRu2aYFApQ/Y74cL4jG8qvfmvJMYJGnSI9n7PFab?= =?us-ascii?Q?ERmrGsbPZov9BQjvAtk2fQtGVULuGAPqEwMrzH6mCVutSim73HfXHN5XJgMI?= =?us-ascii?Q?7ip9SgOIq5NqCNArpkNUBcha3V40OIUUGgeJ699l14xkKAyH7SebqnmEn9t0?= =?us-ascii?Q?1ORY/WnH1N43aWBGMZU8FH2t/uNJWYStWDx0+ab9vQTLuhQ6I4FEchYrhDOO?= =?us-ascii?Q?kkRdpIv7gg/6VBKJ7bfzslDc1EGTALb9f8d9QFomveWZ6SY7oQXSSnRwoROU?= =?us-ascii?Q?oODht5oZ/aFtPN7LkZpBrutwrUkYQuKjSltVp9Vji4U0xsVXXZCpnbEubOWv?= =?us-ascii?Q?2+j/UrMQwFARAedJ5V5jblVNbNwX3Iqg0z+g/3utMUBlQOhXvXTD/+rjvfhL?= =?us-ascii?Q?4aXwgql+CbbKufDGuRjbcu2yERbvSv8DFz30aDdiMoVEkLWGFe+pz9A8vmoa?= =?us-ascii?Q?/rnaT30DGCuteIMABimqK76ZPojJVBwguKnhXYnXhrQbKHQTJVh7bM3BCHO/?= =?us-ascii?Q?1sgl3Zty8f2c6xIwOP0lk3FUZK8Do2qxZUn1cAXlS3XtJ77MLGWp6Z46gHOZ?= =?us-ascii?Q?N9OXlda22ML5ZzNYfzPux0Kf/K2wkpAUclZmPVqGWtvG1/UFYY8Hc0AG78k9?= =?us-ascii?Q?FXD7fMcLjR13ZOBBzTKarOEXJkS0up3RO6ctQUVZbWQ5tG23/t83r44NHCiQ?= =?us-ascii?Q?pYnQFTtuF31dAVFRIebHMEoTuHZfIn2pbE03bbwzd6asKjbIO/cmjwZ51jPC?= =?us-ascii?Q?dTFkJEJ6ymKTHY39blEKjnTArNdj1RK/X7Hg92mKy7EWD9jOCbWYSZPb+41h?= =?us-ascii?Q?BfALYkSY7pMCG1FKAAvXFAY3lRkIpGYN81QIWk12IGGhw2mXacQihKmOdRHu?= =?us-ascii?Q?aX7pC0L5w/HbbsAGziKetFQsce9Bp5dNxzrgLfoG4ZwCP6PN0XyMtz9iCJN8?= =?us-ascii?Q?9Ee980MM9oP9NbswJ+1uCRlG9mYpkjK+Ihk/CjzVX2jf4HSmIdygQWHj9rLh?= =?us-ascii?Q?6wWPRlr5fx991/RRS9dar3kMva9LoDxXf59nCqh5GZJjy9xaw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1446; 6:aYrmCQzREdwChmRbl+r1H8SD/ju+M1tbeO5jSLuD/3tF6hJaJT1/fWPYuVfVz7y2T5Ml/YJgLZwRSm0JrzAmylxbJ0jiyZ7qfcVlQNj55TSbOtJql74iJV8SpsvmGhHHOGDxF3ETU1LP1XZJdaqfyHpWl86jpwU9OUD9ZaLD40zTvIccDjsI8NF4m9SVPk+2td2IBg2fUoadYeBlM6bSjBlR1GVCCn3J7A3fJJAKOYrf8MzX7QbDbMSnjP+ThzLLcw4CoEjV1OI53P5vU8AtnxSPIljjYcnIWsdVeoI/IXyeFcBIEcSxa1wIECrHWiDlxoFMqduj31D1mj7Js1dV2t51xN1NZs1ObhGEUswDEZc=; 5:lAq2DpgRIAaliD2o2pgXf7DmWW1Oz0zq5ZVserWUtT/YAlW4+5Stu7Pf/R9HMpbGwD3ZPIHP/ucitSndqEfRJ88JGH+XqnvoTWi0kgWZ07EfyAWLTzDHqcNl3VludLUnxfn81QpFXajHP9sAXE6mMgVCU8ImKlhvOBsQha7tR7E=; 24:yH95qKqJYeIqEm93ze1tegJkuSbgJnCO6s8iTgW/FoSb8DazBgCjx1NbTjl43Lgv7wKLBv9rlXEgIdcn21WWvoCYaGUHQIK5l1nZxPyvnCM=; 7:U7i30qUf2ykwrjstOprxXxHbfYog6dSsEiDuBBkFcb12kwLA149c3jWejgQ4RwUTfbUxSnm1GyelG4fGcVSb13nzrEzHisRN5v/QSZRU7tjxUUJfvpbmbL66dO3t/j9YeqVuyipBg6x1YA//cnAKQ3dPN2hz+AE7pT6toqjZHGj4S2fPHt8jIr4rdEXVSEjLcAgN4mNcJjImpD1VUB4sPRHVCtskKXbkupTyLmKubRQ8cg0vo330nlv81cGwRHJ1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1446; 20:Z6/TFJ30Tj69F0D8Dz3M9M93oYN70JmYaCJXWcvdL0BHCBhDOL27oAdPEfnwwVEosy+vXQRfXtiOM1SineFjd01zGXO3jKEpJ00kKOQz1pyEiJRBhHZW5qFTVAQRgpSgUxZXJSKe+p8nQJnM8hkRCBl2G/bmfG0FXoMDXelSPYh4y0wfczfNlkMacPA1ohr63u4a1Jh+p13ofzK0v9qWvX/dFIJa9C0fWeZg1NXyi8C/hxKvSlr/4oroFxTZWJ7M X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Dec 2017 06:08:41.3514 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34593718-26d9-40b7-0a2e-08d54b5df2d7 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: CY4PR12MB1446 Cc: Roger He , Christian.Koenig@amd.com 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 if the bo shares same reservation object then not lock it again at swapout time to make it possible to swap out. v2: refine the commmit message Change-Id: I1e87954564f38ad298bf6e4ff88c9f26f291a62d Signed-off-by: Roger He Reviewed-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 15 +++++++++++---- drivers/gpu/drm/ttm/ttm_memory.c | 12 ++++++++---- include/drm/ttm/ttm_bo_api.h | 3 ++- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 5e64091..ec42bb3 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1697,18 +1697,20 @@ EXPORT_SYMBOL(ttm_bo_synccpu_write_release); * A buffer object shrink method that tries to swap out the first * buffer object on the bo_global::swap_lru list. */ -int ttm_bo_swapout(struct ttm_bo_global *glob) +int ttm_bo_swapout(struct ttm_bo_global *glob, struct ttm_operation_ctx *ctx) { struct ttm_buffer_object *bo; int ret = -EBUSY; + bool locked; unsigned i; spin_lock(&glob->lru_lock); for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) { list_for_each_entry(bo, &glob->swap_lru[i], swap) { - ret = reservation_object_trylock(bo->resv) ? 0 : -EBUSY; - if (!ret) + if (ttm_bo_evict_swapout_allowable(bo, ctx, &locked)) { + ret = 0; break; + } } if (!ret) break; @@ -1784,7 +1786,12 @@ EXPORT_SYMBOL(ttm_bo_swapout); void ttm_bo_swapout_all(struct ttm_bo_device *bdev) { - while (ttm_bo_swapout(bdev->glob) == 0) + struct ttm_operation_ctx ctx = { + .interruptible = false, + .no_wait_gpu = false + }; + + while (ttm_bo_swapout(bdev->glob, &ctx) == 0) ; } EXPORT_SYMBOL(ttm_bo_swapout_all); diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c index 102b326..aa0c381 100644 --- a/drivers/gpu/drm/ttm/ttm_memory.c +++ b/drivers/gpu/drm/ttm/ttm_memory.c @@ -211,7 +211,7 @@ static bool ttm_zones_above_swap_target(struct ttm_mem_global *glob, */ static void ttm_shrink(struct ttm_mem_global *glob, bool from_wq, - uint64_t extra) + uint64_t extra, struct ttm_operation_ctx *ctx) { int ret; @@ -219,7 +219,7 @@ static void ttm_shrink(struct ttm_mem_global *glob, bool from_wq, while (ttm_zones_above_swap_target(glob, from_wq, extra)) { spin_unlock(&glob->lock); - ret = ttm_bo_swapout(glob->bo_glob); + ret = ttm_bo_swapout(glob->bo_glob, ctx); spin_lock(&glob->lock); if (unlikely(ret != 0)) break; @@ -230,10 +230,14 @@ static void ttm_shrink(struct ttm_mem_global *glob, bool from_wq, static void ttm_shrink_work(struct work_struct *work) { + struct ttm_operation_ctx ctx = { + .interruptible = false, + .no_wait_gpu = false + }; struct ttm_mem_global *glob = container_of(work, struct ttm_mem_global, work); - ttm_shrink(glob, true, 0ULL); + ttm_shrink(glob, true, 0ULL, &ctx); } static int ttm_mem_init_kernel_zone(struct ttm_mem_global *glob, @@ -520,7 +524,7 @@ static int ttm_mem_global_alloc_zone(struct ttm_mem_global *glob, return -ENOMEM; if (unlikely(count-- == 0)) return -ENOMEM; - ttm_shrink(glob, false, memory + (memory >> 2) + 16); + ttm_shrink(glob, false, memory + (memory >> 2) + 16, ctx); } return 0; diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 24a8db7..f1c74c2 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -752,7 +752,8 @@ ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp, const char __user *wbuf, char __user *rbuf, size_t count, loff_t *f_pos, bool write); -int ttm_bo_swapout(struct ttm_bo_global *glob); +int ttm_bo_swapout(struct ttm_bo_global *glob, + struct ttm_operation_ctx *ctx); void ttm_bo_swapout_all(struct ttm_bo_device *bdev); int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo); #endif