From owner-freebsd-x11@FreeBSD.ORG Mon Nov 8 14:44:17 2010 Return-Path: Delivered-To: freebsd-x11@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08D8C1065673; Mon, 8 Nov 2010 14:44:17 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id BC7F08FC12; Mon, 8 Nov 2010 14:44:16 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id E8F75582D5; Mon, 8 Nov 2010 08:22:11 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id jzHqV0Dsof-J; Mon, 8 Nov 2010 08:22:11 -0600 (CST) Received: from comporellon.tachypleus.net (unknown [76.210.66.181]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 7A70A582CD; Mon, 8 Nov 2010 08:22:11 -0600 (CST) Message-ID: <4CD80792.7070402@freebsd.org> Date: Mon, 08 Nov 2010 08:22:10 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.14) Gecko/20101021 Thunderbird/3.0.9 MIME-Version: 1.0 To: Kostik Belousov References: <4CD3B1D2.30003@icyb.net.ua> <4CD7E401.1010206@freebsd.org> <20101108120403.GC2392@deviant.kiev.zoral.com.ua> <4CD7F5B9.3010606@freebsd.org> <20101108131620.GG2392@deviant.kiev.zoral.com.ua> In-Reply-To: <20101108131620.GG2392@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-x11@freebsd.org, freebsd-current@freebsd.org, Andriy Gapon Subject: Re: radeon_cp_texture: page fault with non-sleepable locks held X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2010 14:44:17 -0000 On 11/08/10 07:16, Kostik Belousov wrote: > On Mon, Nov 08, 2010 at 03:06:01PM +0200, Andriy Gapon wrote: > >> on 08/11/2010 14:04 Kostik Belousov said the following: >> >>> On Mon, Nov 08, 2010 at 01:50:25PM +0200, Andriy Gapon wrote: >>> >>>> on 05/11/2010 09:27 Andriy Gapon said the following: >>>> >>>>> Kernel page fault with the following non-sleepable locks held: >>>>> exclusive sleep mutex drmdev (drmdev) r = 0 (0xffffff0001b968a0) locked @ >>>>> /usr/src/sys/dev/drm/drm_drv.c:791 >>>>> KDB: stack backtrace: >>>>> db_trace_self_wrapper() at 0xffffffff801b8afa = db_trace_self_wrapper+0x2a >>>>> kdb_backtrace() at 0xffffffff803a7afa = kdb_backtrace+0x3a >>>>> _witness_debugger() at 0xffffffff803bd49c = _witness_debugger+0x2c >>>>> witness_warn() at 0xffffffff803bed32 = witness_warn+0x322 >>>>> trap() at 0xffffffff8054639f = trap+0x39f >>>>> >> Kostik, >> >> a tangential question - do you think that it would make sense to put a check >> like the above (in trap) into copyin/copyout (but non-fatal), so that we can >> catch such situations pro-actively (without having to wait for a page fault to >> actually happen)? >> > uiomove() already contains > WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, > "Calling uiomove()"); > at the start. > > For the copyin/out routines, that are implemented in assembler for > most (all ?) architectures, this seems to be overkill, IMHO. > The other issue is that this can be a legal thing to do. If you have taken care to wire the userland buffers ahead of time, there is no problem copying copyin()/copyout() with sleepable locks held. The sysctl code does this. As such, you can't check for problems by panicing if sleepable locks are held. -Nathan