From patchwork Fri Mar 24 10:03:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Michel_D=C3=A4nzer?= X-Patchwork-Id: 9642529 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 9350A6020B for ; Fri, 24 Mar 2017 10:03:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B44F26E4E for ; Fri, 24 Mar 2017 10:03:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4EB7927B81; Fri, 24 Mar 2017 10:03:54 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 DE12D26E4E for ; Fri, 24 Mar 2017 10:03:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 337C26E3E0; Fri, 24 Mar 2017 10:03:52 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from netline-mail3.netline.ch (mail.netline.ch [148.251.143.178]) by gabe.freedesktop.org (Postfix) with ESMTP id B81916E3E0; Fri, 24 Mar 2017 10:03:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by netline-mail3.netline.ch (Postfix) with ESMTP id 3072A2E2004; Fri, 24 Mar 2017 11:03:50 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at netline-mail3.netline.ch Received: from netline-mail3.netline.ch ([127.0.0.1]) by localhost (netline-mail3.netline.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Ze8rghcJP6Nm; Fri, 24 Mar 2017 11:03:48 +0100 (CET) Received: from thor (42-144-27-164.rev.home.ne.jp [42.144.27.164]) by netline-mail3.netline.ch (Postfix) with ESMTPSA id 07D8B2E2002; Fri, 24 Mar 2017 11:03:48 +0100 (CET) Received: from localhost ([::1]) by thor with esmtp (Exim 4.89) (envelope-from ) id 1crM4O-0007BD-Qx; Fri, 24 Mar 2017 19:03:45 +0900 Subject: Re: [PATCH] Revert "drm/radeon: Try evicting from CPU accessible to inaccessible VRAM first" To: Zachary Michaels References: <1490206797-15653-1-git-send-email-zmichaels@oblong.com> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Message-ID: <5f26f8a1-e5bd-ca7a-c7ee-08c8f04f2110@daenzer.net> Date: Fri, 24 Mar 2017 19:03:44 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Julien Isorce 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 On 24/03/17 12:31 AM, Zachary Michaels wrote: > > I should also note that we are experiencing another issue where the > kernel locks up in similar circumstances. As Julien noted, we get no > output, and the watchdogs don't seem to work. It may be the case that > Xorg and our process are calling ttm_bo_mem_force_space concurrently, > but I don't think we have enough information yet to say for > sure. Reverting this commit does not fix that issue. I have some small > amount of evidence indicating that bos flagged for CPU access are > getting placed in CPU inaccessible memory. Could that cause this sort of > kernel lockup? Possibly, does this help? diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 37d68cd1f272..40d1bb467a71 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -198,7 +198,8 @@ static void radeon_evict_flags(struct ttm_buffer_object *bo, case TTM_PL_VRAM: if (rbo->rdev->ring[radeon_copy_ring_index(rbo->rdev)].ready == false) radeon_ttm_placement_from_domain(rbo, RADEON_GEM_DOMAIN_CPU); - else if (rbo->rdev->mc.visible_vram_size < rbo->rdev->mc.real_vram_size && + else if (!(rbo->flags & RADEON_GEM_CPU_ACCESS) && + rbo->rdev->mc.visible_vram_size < rbo->rdev->mc.real_vram_size && bo->mem.start < (rbo->rdev->mc.visible_vram_size >> PAGE_SHIFT)) { unsigned fpfn = rbo->rdev->mc.visible_vram_size >> PAGE_SHIFT; int i;