Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3707664ybb; Mon, 6 Apr 2020 14:05:36 -0700 (PDT) X-Google-Smtp-Source: APiQypKT0691I+kspgWogeNnWuzfTP43aZOqkM+GZHDyeqhxeCoUd+7A5OW68C4h1JJ93eXZxILC X-Received: by 2002:a9d:748e:: with SMTP id t14mr20038259otk.334.1586207136571; Mon, 06 Apr 2020 14:05:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586207136; cv=none; d=google.com; s=arc-20160816; b=EiE0b36Hsf/DrPktlvVYdxua/8OIAV5VJdzy5rUvkddW/2DfJ25dnEcaUaCkq/c/ck L8jyvqGfInUN8Lkkh8FXE7g+4iBimzaUIDwRFWXIhaV0VRjPBFoTXuyKgooWpsutRS9k sYB/SWMMNE4Br2eRN+AXBnoeyAA28TxYOiMu/0TOdSpc6av+uslEnc+rNJtvTgtPbfx8 qCFY4F0PYs/9ww9sWqtqqPa4ovX5Gwj7ct4mW1gsCEGU9mHZDqsBdWOjNbYx9eIgZwHy bJ1YFWboCLdiL4uWzMgvmtDxIZ442luQwCaB0pi84yQs1mdDuBaIVRSLIRwrEQNqszJA TQtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:references:cc:to :subject:dkim-signature; bh=TCKtTblHtXao6TUIK2DiM+Vc9d3YDn8LW2clZuCPPew=; b=ydHOG9lUERzbuNf4svrnD71RVmmmTIaoSTUrPiqfLIVeQlfK3ZIzbjonN/8J98ohq1 iDXXur17DnLbwQbFQtcWFjkXiTWUNz3GVulBJbQMfWhlUdj6O3zOLbVW/6Jd7g+h4F0R UsVw+N+DsS+MnwRqM+gsmDNVL5Tq6RUDeqckGKEzVlU2rbs09f8Jf7ydbXFnSSD+NE0K cgAcf6A2P1bHCuWhsFnEjLgeSNXML4g425bU6+BLLjgOhoBw4/RBpgP0oZIrKw/JhMT/ QEj9/oyD04H8VdQ48JcRHMhTAWVbSlO1BjyM9Z4R6RNxv/i6i2xu24x6DGpUh2ndV87/ OnoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@shipmail.org header.s=mail header.b=DA9SonA7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a17si265439oie.2.2020.04.06.14.05.24; Mon, 06 Apr 2020 14:05:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@shipmail.org header.s=mail header.b=DA9SonA7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726230AbgDFVEv (ORCPT + 99 others); Mon, 6 Apr 2020 17:04:51 -0400 Received: from ste-pvt-msa2.bahnhof.se ([213.80.101.71]:5921 "EHLO ste-pvt-msa2.bahnhof.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbgDFVEu (ORCPT ); Mon, 6 Apr 2020 17:04:50 -0400 Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTP id 2194A44330; Mon, 6 Apr 2020 23:04:48 +0200 (CEST) Authentication-Results: ste-pvt-msa2.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=shipmail.org header.i=@shipmail.org header.b=DA9SonA7; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Flag: NO X-Spam-Score: -2.099 X-Spam-Level: X-Spam-Status: No, score=-2.099 tagged_above=-999 required=6.31 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no Authentication-Results: ste-ftg-msa2.bahnhof.se (amavisd-new); dkim=pass (1024-bit key) header.d=shipmail.org Received: from ste-pvt-msa2.bahnhof.se ([127.0.0.1]) by localhost (ste-ftg-msa2.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3PWkYw5PBWtE; Mon, 6 Apr 2020 23:04:47 +0200 (CEST) Received: from mail1.shipmail.org (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) (Authenticated sender: mb878879) by ste-pvt-msa2.bahnhof.se (Postfix) with ESMTPA id D45BB4432C; Mon, 6 Apr 2020 23:04:40 +0200 (CEST) Received: from localhost.localdomain (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) by mail1.shipmail.org (Postfix) with ESMTPSA id C75D7360153; Mon, 6 Apr 2020 23:04:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1586207080; bh=TpPLdQ9Xg4zg7yV7oqskrJHnh3QSBtbAFduG4J4rY2E=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=DA9SonA7mU0e7m2Mh1VCU7TjJzadAUBAbdizDTQ03zAX9xHtzLm+sUQNrzo4pbh/D hXXDR7/Auj4cuQsJ+NxrGJlDs6PbqdWfB0SrgPoyiDGOxD54N+lqOn0Yh35r8adjZY P9SDgxCoR578vPEyVAx9W22Sr2JG4aL2kivyX50k= Subject: Re: Bad rss-counter state from drm/ttm, drm/vmwgfx: Support huge TTM pagefaults To: "Alex Xu (Hello71)" , linux-mm@kvack.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: pv-drivers@vmware.com, linux-graphics-maintainer@vmware.com, Andrew Morton , Michal Hocko , "Matthew Wilcox (Oracle)" , "Kirill A. Shutemov" , Ralph Campbell , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , =?UTF-8?Q?Christian_K=c3=b6nig?= , Dan Williams , Roland Scheidegger References: <1586138158.v5u7myprlp.none.ref@localhost> <1586138158.v5u7myprlp.none@localhost> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28VMware=29?= Organization: VMware Inc. Message-ID: <0b12b28c-5f42-b56b-ea79-6e3d1052b332@shipmail.org> Date: Mon, 6 Apr 2020 23:04:37 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <1586138158.v5u7myprlp.none@localhost> Content-Type: multipart/mixed; boundary="------------F0ED14F7B8417927F8CA67C2" Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------F0ED14F7B8417927F8CA67C2 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 4/6/20 9:51 PM, Alex Xu (Hello71) wrote: > Using 314b658 with amdgpu, starting sway and firefox causes "BUG: Bad > rss-counter state" and "BUG: non-zero pgtables_bytes on freeing mm" to > start filling dmesg, and then closing programs causes more BUGs and > hangs, and then everything grinds to a halt (can't start more programs, > can't even reboot through systemd). > > Using master and reverting that branch up to that point fixes the > problem. > > I'm using a Ryzen 1600 and AMD Radeon RX 480 on an ASRock B450 Pro4 > board with IOMMU enabled. If you could try the attached patch, that'd be great! Thanks, Thomas --------------F0ED14F7B8417927F8CA67C2 Content-Type: text/x-patch; charset=UTF-8; name="0001-drm-ttm-Temporarily-disable-the-huge_fault-callback.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-drm-ttm-Temporarily-disable-the-huge_fault-callback.pat"; filename*1="ch" From b630b9b4dcc1d01514d97a84cbb7f0cb85333154 Mon Sep 17 00:00:00 2001 From: "Thomas Hellstrom (VMware)" Date: Mon, 6 Apr 2020 22:55:13 +0200 Subject: [PATCH] drm/ttm: Temporarily disable the huge_fault() callback Signed-off-by: Thomas Hellstrom (VMware) --- drivers/gpu/drm/ttm/ttm_bo_vm.c | 63 --------------------------------- 1 file changed, 63 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c index 6ee3b96f0d13..0ad30b112982 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_vm.c +++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c @@ -442,66 +442,6 @@ vm_fault_t ttm_bo_vm_fault(struct vm_fault *vmf) } EXPORT_SYMBOL(ttm_bo_vm_fault); -#ifdef CONFIG_TRANSPARENT_HUGEPAGE -/** - * ttm_pgprot_is_wrprotecting - Is a page protection value write-protecting? - * @prot: The page protection value - * - * Return: true if @prot is write-protecting. false otherwise. - */ -static bool ttm_pgprot_is_wrprotecting(pgprot_t prot) -{ - /* - * This is meant to say "pgprot_wrprotect(prot) == prot" in a generic - * way. Unfortunately there is no generic pgprot_wrprotect. - */ - return pte_val(pte_wrprotect(__pte(pgprot_val(prot)))) == - pgprot_val(prot); -} - -static vm_fault_t ttm_bo_vm_huge_fault(struct vm_fault *vmf, - enum page_entry_size pe_size) -{ - struct vm_area_struct *vma = vmf->vma; - pgprot_t prot; - struct ttm_buffer_object *bo = vma->vm_private_data; - vm_fault_t ret; - pgoff_t fault_page_size = 0; - bool write = vmf->flags & FAULT_FLAG_WRITE; - - switch (pe_size) { - case PE_SIZE_PMD: - fault_page_size = HPAGE_PMD_SIZE >> PAGE_SHIFT; - break; -#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD - case PE_SIZE_PUD: - fault_page_size = HPAGE_PUD_SIZE >> PAGE_SHIFT; - break; -#endif - default: - WARN_ON_ONCE(1); - return VM_FAULT_FALLBACK; - } - - /* Fallback on write dirty-tracking or COW */ - if (write && ttm_pgprot_is_wrprotecting(vma->vm_page_prot)) - return VM_FAULT_FALLBACK; - - ret = ttm_bo_vm_reserve(bo, vmf); - if (ret) - return ret; - - prot = vm_get_page_prot(vma->vm_flags); - ret = ttm_bo_vm_fault_reserved(vmf, prot, 1, fault_page_size); - if (ret == VM_FAULT_RETRY && !(vmf->flags & FAULT_FLAG_RETRY_NOWAIT)) - return ret; - - dma_resv_unlock(bo->base.resv); - - return ret; -} -#endif - void ttm_bo_vm_open(struct vm_area_struct *vma) { struct ttm_buffer_object *bo = vma->vm_private_data; @@ -604,9 +544,6 @@ static const struct vm_operations_struct ttm_bo_vm_ops = { .open = ttm_bo_vm_open, .close = ttm_bo_vm_close, .access = ttm_bo_vm_access, -#ifdef CONFIG_TRANSPARENT_HUGEPAGE - .huge_fault = ttm_bo_vm_huge_fault, -#endif }; static struct ttm_buffer_object *ttm_bo_vm_lookup(struct ttm_bo_device *bdev, -- 2.21.1 --------------F0ED14F7B8417927F8CA67C2--