From patchwork Wed Nov 21 14:13:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 1781041 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 56EAC3FCA5 for ; Wed, 21 Nov 2012 14:13:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A0F2E648B for ; Wed, 21 Nov 2012 06:13:28 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by gabe.freedesktop.org (Postfix) with ESMTP id 30BE1E5BF4; Wed, 21 Nov 2012 06:13:14 -0800 (PST) Received: from 5ed48cef.cm-7-5c.dynamic.ziggo.nl ([94.212.140.239] helo=[192.168.1.128]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1TbB3B-0006VG-5c; Wed, 21 Nov 2012 14:13:13 +0000 Message-ID: <50ACE178.9090707@canonical.com> Date: Wed, 21 Nov 2012 15:13:12 +0100 From: Maarten Lankhorst User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 MIME-Version: 1.0 To: nouveau@lists.freedesktop.org Subject: Re: [PATCH] drm/nouveau: fix takedown in move_notify References: <50ACD3F5.6010007@canonical.com> In-Reply-To: <50ACD3F5.6010007@canonical.com> Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Op 21-11-12 14:15, Maarten Lankhorst schreef: > With this fix, nouveau_gem_object_close can be safely changed to a noop, > forcing the vm bindings to be removed when the original object is. This > is not done in this patch since it may lead to the object staying mapped > in the vm space until the gem object refcount drops to 0. This shouldn't > be a big issue however. > > If we choose to do so does allow us to use ttm's delayed destruction > mechanism to unmap vm after object is idle, resulting in ioread32 no > longer taking up 30% of cpu in Team Fortress 2 if I don't do the vma > unmap in nouveau_gem_object_close. And for those crazy enough to try, deliberately in the most hacky form possible: drm/nouveau: use ttm delayed destroy for unmapping vm According to perf top, drops ioread32 from taking 30% cpu to 3% cpu.. diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 5e2f521..bdb99ab 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -111,7 +111,7 @@ nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv) struct nouveau_vma *vma; int ret; - if (!cli->base.vm) +// if (!cli->base.vm) return; ret = ttm_bo_reserve(&nvbo->bo, false, false, false, 0);