From nobody Sat Apr 06 14:22:49 2024 X-Original-To: x11@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VBcyK6VjDz5Gk2H for ; Sat, 6 Apr 2024 14:22:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VBcyK4CbDz4kSX for ; Sat, 6 Apr 2024 14:22:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712413369; a=rsa-sha256; cv=none; b=nPGb8rWzb8aM5+6r0YKew7ybWAgCHEI5TzRb1S2o0DoeOS/WLVZzDVhBoIlyMuAQ9ctn6a JH5Ft6bbG95COba/z0kFpwsIbDM7EYlIhU+droJlpTi3xFiJlKBnuHoZZDTSQd+HD5AIyJ qZccjFqo9IAmLhTHwX6tt3MQLKWzvUhDb1Ux/j6lO2HDCxI1++xe7K0fiHlHnaaBa3CQzl snWn9H3CHhUQAgHFlK+kimVPOpYqhnihmD61VaCSdkhiYW5qiYZCQmC9n9l1WflymujTrv IRzXKvJhuzC/j/IbPabBG2vkxc4Y58p7JnCd+SV/JTKRIAhoMdUDYzAAnk48HA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712413369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gGyjgRNBDPoEh76jLHhY8PfmD3zZc5ZsoeyydZDC+ns=; b=WEdu0DYyoI53UT5h86TPTDR2C1Hfcjbd3S60XGCwiAcBiQqQpuiHjb5d7jcZ6FDfbCAXk5 /ClmJ6OgbR4CquSiiaO+fWIql/s0KYLAuJaqYWBU08KdZz2/UL9SjaylNactbWkoc8rPOe O6IO6NwX41Mi9rwFFJ+mcnVU1NPztge/ZsAtfj4nOoq1CqQ9yPgeUo7OXWiIU4JHdL5AsS TUmZBqareENrJ3QZAmsrJLhBNOSTui5eiZ9P0b7Zt8PwV+ObmD96Oatjqlrnz5PQY00udg Dum7vCEkOv9XJU666A2YrzOl8vr4L7i3qPvQxSmC8aQQVMKwE+0b/59KDNcgYQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VBcyK3q4LznNr for ; Sat, 6 Apr 2024 14:22:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 436EMnqk070863 for ; Sat, 6 Apr 2024 14:22:49 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 436EMnwV070861 for x11@FreeBSD.org; Sat, 6 Apr 2024 14:22:49 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: x11@FreeBSD.org Subject: [Bug 277476] graphics/drm-515-kmod: amdgpu periodic hangs due to phys contig allocations Date: Sat, 06 Apr 2024 14:22:49 +0000 X-Bugzilla-Reason: CC AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: jeffpc@josefsipek.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: x11@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: X11 List-Archive: https://lists.freebsd.org/archives/freebsd-x11 List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-x11@freebsd.org X-BeenThere: freebsd-x11@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277476 --- Comment #2 from Josef 'Jeff' Sipek --- I dug a bit more into this. It looks like the drm code has provisions for allocating memory via dma APIs. The FreeBSD port doesn't implement those. Specifically, looking at drm-kmod-drm_v5.15.25_5 source: drivers/gpu/drm/amd/amdgpu/gmc_v*.c sets adev->need_swiotlb to drm_need_swiotlb(...). drm_need_swiotlb is implemented in drivers/gpu/drm/drm_cache.c as a 'return false' on FreeBSD. Later on, amdgpu_ttm_init calls ttm_device_init with the use_dma_alloc argument equal to adev->need_swiotlb (IOW, false). Much later on, ttm_pool_alloc is called to allocate a buffer. That in turn calls ttm_pool_alloc_page which amounts to: if (!use_dma_alloc) return alloc_pages(...); panic("ttm_pool.c: use_dma_alloc not implemented"); So, because of the 'return false' during initialization, we always call alloc_pages (aka. linux_alloc_pages) which tries to allocate physically contiguous memory. As I said before, I don't know anything about the graphics stack, so it is possible that this dma API is completely irrelevant. Looking at ttm_pool_alloc some more, it immediately turns the physically contiguous allocation into an array of struct page pointers (tt->pagse). So, depending on how the rest of the module uses the buffer & pages, it may be relatively easy to switch to a virtually-contiguous allocation. --=20 You are receiving this mail because: You are on the CC list for the bug. You are the assignee for the bug.=