From patchwork Sun Jan 13 11:38:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 1969751 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id ABF223FCDE for ; Sun, 13 Jan 2013 11:38:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 96EC8E63C2 for ; Sun, 13 Jan 2013 03:38:55 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com [74.125.83.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 10E53E5D27 for ; Sun, 13 Jan 2013 03:38:42 -0800 (PST) Received: by mail-ee0-f41.google.com with SMTP id d41so1493450eek.14 for ; Sun, 13 Jan 2013 03:38:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=o9nBNay369Kpt1y98IWr/3ds6G82JQAk5zrRru8E9+U=; b=oaNpI0E+GMazJmiBD7+DnNA4DaqFz3WH8bUN0kasx0YLZ0ZZMJfZIsvsXJ97i3ek0n QaKFSRZS/26Vgf3Dni1MstPoyM/hMqApmuVOirAPwPGcVUoypT9xdjDztmKvAu3gvUOT rPMfWn8bBTG8omTWRgpJ0pFO1EESx4oUOCv2ymSkMnEP9Gb9YaFv65PVeuQZaF4C6UJl tDCRi4ziKICNRFyvSwmFo8aknUrsJdmRd8fQ9eSnpo0QTmbKmVFXkO2h1XSyVex6Hd1+ ob4ieVA5M9IeqqnONgYG3qQsmlf/GlO0D7hWTqvJjvVz7VZ2Y3pa32pE6ugJrxR2W5v7 8hLw== X-Received: by 10.14.215.194 with SMTP id e42mr220596039eep.32.1358077122073; Sun, 13 Jan 2013 03:38:42 -0800 (PST) Received: from localhost ([212.98.184.69]) by mx.google.com with ESMTPS id q44sm16971060eep.5.2013.01.13.03.38.40 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 13 Jan 2013 03:38:41 -0800 (PST) Date: Sun, 13 Jan 2013 14:38:20 +0300 From: Sergey Senozhatsky To: Dave Airlie Subject: Re: radeon causing sleeping function called from invalid context Message-ID: <20130113113820.GA2503@swordfish> References: <20130113012717.GA2673@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130113012717.GA2673@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Dave Jones , Linux Kernel , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org On (01/12/13 20:27), Dave Jones wrote: > BUG: sleeping function called from invalid context at mm/slub.c:925 > in_atomic(): 1, irqs_disabled(): 0, pid: 566, name: Xorg > INFO: lockdep is turned off. > Pid: 566, comm: Xorg Not tainted 3.8.0-rc3+ #49 > Call Trace: > [] __might_sleep+0x141/0x200 > [] kmem_cache_alloc_trace+0x4b/0x2a0 > [] ttm_bo_move_accel_cleanup+0x1d3/0x330 [ttm] > [] radeon_move_blit.isra.4+0xf8/0x160 [radeon] > [] radeon_bo_move+0xb0/0x1f0 [radeon] > [] ttm_bo_handle_move_mem+0x27d/0x5d0 [ttm] > [] ? get_parent_ip+0x11/0x50 > [] ttm_bo_move_buffer+0x127/0x140 [ttm] > [] ? ttm_eu_list_ref_sub+0x3d/0x60 [ttm] > [] ttm_bo_validate+0xa2/0x120 [ttm] > [] radeon_bo_list_validate+0x75/0x90 [radeon] > [] radeon_cs_ioctl+0x582/0x950 [radeon] > [] drm_ioctl+0x4d3/0x580 [drm] > [] ? radeon_cs_finish_pages+0xf0/0xf0 [radeon] > [] do_vfs_ioctl+0x99/0x5a0 > [] ? file_has_perm+0x97/0xb0 > [] ? rcu_eqs_exit+0x65/0xb0 > [] sys_ioctl+0x91/0xb0 > [] tracesys+0xdd/0xe2 > I see lots of these [mostly from page fault], the following one (quick and dirty) works for me. ---- Forbid ttm_buffer_object_transfer() sleeping in ISR context, do not pass __GFP_WAIT flag to kzalloc(): BUG: sleeping function called from invalid context at mm/slub.c:925 in_atomic(): 1, irqs_disabled(): 0, pid: 2179, name: X 3 locks held by X/2179: #0: (&mm->mmap_sem){++++++}, at: [] __do_page_fault+0xf3/0x590 #1: (&rdev->pm.mclk_lock){++++.+}, at: [] radeon_ttm_fault+0x40/0x70 #2: (&(&bdev->fence_lock)->rlock){+.+.+.}, at: [] ttm_bo_move_accel_cleanup+0x57/0x330 Pid: 2179, comm: X Not tainted 3.8.0-rc3-dbg-01259-gbdac2d4-dirty #1500 Call Trace: [] __might_sleep+0x14a/0x200 [] kmem_cache_alloc_trace+0x153/0x240 [] ttm_bo_move_accel_cleanup+0x1d3/0x330 [] radeon_move_blit.isra.6+0xf8/0x160 [] radeon_bo_move+0xb0/0x1f0 [] ttm_bo_handle_move_mem+0x275/0x5c0 [] ttm_bo_move_buffer+0x127/0x140 [] ttm_bo_validate+0xa2/0x130 [] radeon_bo_fault_reserve_notify+0xad/0xe0 [] ttm_bo_vm_fault+0x60/0x370 [] radeon_ttm_fault+0x51/0x70 [] __do_fault+0x6a/0x540 [] handle_pte_fault+0x91/0x810 [] ? __do_page_fault+0xf3/0x590 [] handle_mm_fault+0x231/0x330 [] __do_page_fault+0x15c/0x590 [] ? do_vfs_ioctl+0x99/0x580 [] ? sysret_check+0x22/0x5d [] do_page_fault+0x2b/0x50 [] page_fault+0x28/0x30 Signed-off-by: Sergey Senozhatsky --- drivers/gpu/drm/ttm/ttm_bo_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index d73d6e3..92e0dea 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -422,7 +422,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, struct ttm_bo_device *bdev = bo->bdev; struct ttm_bo_driver *driver = bdev->driver; - fbo = kzalloc(sizeof(*fbo), GFP_KERNEL); + fbo = kzalloc(sizeof(*fbo), __GFP_IO | __GFP_FS); if (!fbo) return -ENOMEM;