From owner-freebsd-current@FreeBSD.ORG Mon Dec 22 08:45:11 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10F8E1065674 for ; Mon, 22 Dec 2008 08:45:11 +0000 (UTC) (envelope-from rmtodd@ichotolot.servalan.com) Received: from mx1.synetsystems.com (mx1.synetsystems.com [76.10.206.14]) by mx1.freebsd.org (Postfix) with ESMTP id DC2908FC12 for ; Mon, 22 Dec 2008 08:45:10 +0000 (UTC) (envelope-from rmtodd@ichotolot.servalan.com) Received: by mx1.synetsystems.com (Postfix, from userid 66) id C692FC7F; Mon, 22 Dec 2008 03:45:09 -0500 (EST) Received: from rmtodd by servalan.servalan.com with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1LEgGe-0001Uc-Pd; Mon, 22 Dec 2008 02:36:00 -0600 To: freebsd-current@freebsd.org From: Richard Todd Date: Mon, 22 Dec 2008 02:36:00 -0600 Message-ID: User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.21 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailman-Approved-At: Mon, 22 Dec 2008 14:21:26 +0000 Cc: rnoland@freebsd.org Subject: Getting 'vm_thread_new: kstack allocation failed' errors after latest drm updates. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Dec 2008 08:45:11 -0000 I recently updated my system to the latest -CURRENT, and noticed that shortly after the system booted off the new kernel and went multiuser, lots of attempts by programs to create new threads or fork() failed with the kernel giving the error message "vm_thread_new: kstack allocation failed". After spending the weekend doing binary searches to try and isolate which recent kernel change was responsible, I finally discovered that the culprit appears to be the following change: -------------------------------------------------------- Author: rnoland Date: Thu Dec 18 21:04:50 2008 New Revision: 186295 URL: http://svn.freebsd.org/changeset/base/186295 Log: rework drm_scatter.c which allocates scatter / gather pages for use by ati pci gart to use bus_dma to handle the allocations. This fixes a garbled screen issue on at least some radeons (X1400 tested). It is also likely that this is the correct fix for PR# 119324, though that is not confirmed yet. Reviewed by: jhb@ (mentor, prior version) Approved by: kib@ MFC after: 2 weeks Modified: head/sys/dev/drm/drmP.h head/sys/dev/drm/drm_scatter.c ------------------------------------------------ Yeah, it's not immediately clear to me either why this change should have this effect, but on my system, testing gave the following results consistently: 1) Kernels built from source from just before this commit boot and run without problems. 2) Kernels built from source from just *after* this commit show the "vm_thread_new: kstack allocation failed" problem. 3) If I disable xdm so the X server doesn't start, kernels including the aforementioned commit do not show the problem, so the problem does seem connected to the drm module. It's not clear what exactly this commit is doing that causes the problem; it doesn't seem to be a simple kernel memory leak, as vmstat -m from the suspect kernels doesn't seem to show anything obviously leaking. Any suggestions? Other information on my system that might be relevant: it's a Core 2 Duo system with 4G of memory, running FreeBSD-CURRENT in i386 mode. The video card is an ATI X300. vm.kmem_size is set fairly high, 1536M, so there should be plenty of kernel memory space available, even with ZFS wanting 600M of that for its ARC.