Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3176992pxm; Mon, 28 Feb 2022 13:48:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJySIlaIynuKOIUYLYtWnHDT7EMuSOc+6/ilqzyxiPAeeiOiK5BOKywONKj3VfEL7lB/e3QH X-Received: by 2002:a17:906:a40f:b0:6c9:e255:7926 with SMTP id l15-20020a170906a40f00b006c9e2557926mr16157988ejz.27.1646084904271; Mon, 28 Feb 2022 13:48:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646084904; cv=none; d=google.com; s=arc-20160816; b=oJVrbn6e9j9nC3ZvfXHMSw9LPst2IZHc3zaLRvczs+QNviwjJECwo3PhXlymS2cCr9 G91tiFzIlASgLPG1EtaJ9DGlRWsydf0rt1XMM7rioP5i1nHEIenArQt0QFESjMaN1b71 GCqoShM1wcDU9PfUIByNBOpLzYRBnUz57rPQU/aTIj09SplaDGqFV89FsSrJNzZqqXi2 UXi1jE60IvEl7pNxkbEnKmhusDAQxIPAFzL08ZqfIIKY9jBpnNRh/i72elCwe9y8Ew09 NjwMqNjYUWDJ65aoXyKh0haOsgIu7MJQ4dkGHaoqEsay/vQALgGTeHFmL13fh0y5l0oa HyaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ymRM/XewnB10EjgCBpG8nXwRcHKuJ5U+0UDHNINwQRE=; b=Nb7SZ+hpYbrv6jrs4U4cKMtewxpW0qYiMCkJlZhRvYK9cDkE/ngSsUBPXue2XUWrAW xELxCmeoYVZcgJOyuWmWzaxjILKe8y+ibX+tOP+JZFVuw3Dxd0C1Yd8hAg5x82L1cyj+ 8skb68szWKOSF59vCsTM7T37HR03Aqw2nYX4PJ9UpeLvij7pNeHcsIT//w6JtaosPiHj uPhUhROdLvotnwoBovjzV5dpyiETCk8PfY2n6hVTv5oW+2V1LnshGeAfPu7dRHOmdX0t Ey4oG8Qw2RXDMtjjo5KeVoa37r1UbJWLkn8Q4hWym1j4nKCsBk1K+gT1c+pG+BZc+vrG hKgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Oy9dc7j3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t19-20020a170906a11300b006b697a3d251si6807998ejy.1009.2022.02.28.13.48.01; Mon, 28 Feb 2022 13:48:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Oy9dc7j3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230272AbiB1Vdv (ORCPT + 99 others); Mon, 28 Feb 2022 16:33:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230216AbiB1Vdu (ORCPT ); Mon, 28 Feb 2022 16:33:50 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C03F34D9D9; Mon, 28 Feb 2022 13:33:10 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7D017B8123F; Mon, 28 Feb 2022 21:33:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28829C340F1; Mon, 28 Feb 2022 21:33:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646083988; bh=jTglwX0Y1klyRtQh80VCQNNTZid9lUYfXtgdkgv+LUY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Oy9dc7j3It/sFHWlQpGAIbf8fLmvavreGmNTqbD379LhklDMy5PsTAVBn3JrTGakO 8+CDnpCO3llwz9Rfe56qdl/kN0/Gqm3ZHrFQMSFYJd0pJnO85H1dmS/przxyWZwY8K nH/AQx94B6eR1FpnQ778/SioiqFSloGusfDNZa2w= Date: Mon, 28 Feb 2022 22:33:04 +0100 From: Greg Kroah-Hartman To: "Deucher, Alexander" Cc: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" , Paul Menzel , "Koenig, Christian" , "Yu, Qiang" Subject: Re: [PATCH 5.16 022/164] drm/amdgpu: check vm ready by amdgpu_vm->evicting flag Message-ID: References: <20220228172359.567256961@linuxfoundation.org> <20220228172402.072667800@linuxfoundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 28, 2022 at 06:24:53PM +0000, Deucher, Alexander wrote: > [Public] > > > -----Original Message----- > > From: Greg Kroah-Hartman > > Sent: Monday, February 28, 2022 12:23 PM > > To: linux-kernel@vger.kernel.org > > Cc: Greg Kroah-Hartman ; > > stable@vger.kernel.org; Paul Menzel ; Koenig, > > Christian ; Yu, Qiang ; > > Deucher, Alexander > > Subject: [PATCH 5.16 022/164] drm/amdgpu: check vm ready by > > amdgpu_vm->evicting flag > > > > From: Qiang Yu > > > > commit c1a66c3bc425ff93774fb2f6eefa67b83170dd7e upstream. > > > > Workstation application ANSA/META v21.1.4 get this error dmesg when > > running CI test suite provided by ANSA/META: > > [drm:amdgpu_gem_va_ioctl [amdgpu]] *ERROR* Couldn't update BO_VA (- > > 16) > > > > This is caused by: > > 1. create a 256MB buffer in invisible VRAM 2. CPU map the buffer and access > > it causes vm_fault and try to move > > it to visible VRAM > > 3. force visible VRAM space and traverse all VRAM bos to check if > > evicting this bo is valuable > > 4. when checking a VM bo (in invisible VRAM), amdgpu_vm_evictable() > > will set amdgpu_vm->evicting, but latter due to not in visible > > VRAM, won't really evict it so not add it to amdgpu_vm->evicted 5. before > > next CS to clear the amdgpu_vm->evicting, user VM ops > > ioctl will pass amdgpu_vm_ready() (check amdgpu_vm->evicted) > > but fail in amdgpu_vm_bo_update_mapping() (check > > amdgpu_vm->evicting) and get this error log > > > > This error won't affect functionality as next CS will finish the waiting VM ops. > > But we'd better clear the error log by checking the amdgpu_vm->evicting flag > > in amdgpu_vm_ready() to stop calling > > amdgpu_vm_bo_update_mapping() later. > > > > Another reason is amdgpu_vm->evicted list holds all BOs (both user buffer > > and page table), but only page table BOs' eviction prevent VM ops. > > amdgpu_vm->evicting flag is set only for page table BOs, so we should use > > evicting flag instead of evicted list in amdgpu_vm_ready(). > > > > The side effect of this change is: previously blocked VM op (user buffer in > > "evicted" list but no page table in it) gets done immediately. > > > > v2: update commit comments. > > > > Acked-by: Paul Menzel > > Reviewed-by: Christian K?nig > > Signed-off-by: Qiang Yu > > Signed-off-by: Alex Deucher > > Cc: stable@vger.kernel.org > > Signed-off-by: Greg Kroah-Hartman > > A regression was reported against this patch in 5.17. Please drop for now. Dropped from 5.10.y, 5.15.y, and 5.16.y. Please feel free to send it to stable@vger.kernel.org when it is now working correctly. thanks, greg k-h