From 5a4ac43509137bdcffdd9c61df7686e6e20517a3 Mon Sep 17 00:00:00 2001 From: Andrea Bastoni Date: Wed, 3 Feb 2010 14:47:15 -0500 Subject: TRACE: fix GFP_KERNEL in rb_alloc_buf with interrupt disabled kfifo_alloc is called from rb_alloc_buf with interrupt disabled. Use GFP_ATOMIC instead of GFP_KERNEL. Fixes following warning: [ 33.596013] WARNING: at kernel/lockdep.c:2465 lockdep_trace_alloc+0xa7/0xe0() [ 33.596013] Hardware name: [ 33.596013] Modules linked in: [ 33.596013] Pid: 1454, comm: cat Not tainted 2.6.32-litmus2010 #38 [ 33.596013] Call Trace: [ 33.596013] [] ? save_trace+0x3f/0xd0 [ 33.596013] [] ? lockdep_trace_alloc+0xa7/0xe0 [ 33.596013] [] warn_slowpath_common+0x80/0xd0 [ 33.596013] [] warn_slowpath_null+0x14/0x20 [ 33.596013] [] lockdep_trace_alloc+0xa7/0xe0 [ 33.596013] [] __alloc_pages_nodemask+0xa3/0x710 [ 33.596013] [] ? mark_held_locks+0x6c/0x90 [ 33.596013] [] ? mutex_lock_nested+0x315/0x3a0 [ 33.596013] [] ? trace_hardirqs_on_caller+0x145/0x190 [ 33.596013] [] __get_free_pages+0x1d/0x60 [ 33.596013] [] __kmalloc+0x1af/0x240 [ 33.596013] [] kfifo_alloc+0x66/0xe0 [ 33.596013] [] rb_alloc_buf+0x34/0x80 [ 33.596013] [] log_open+0x50/0xb0 [ 33.596013] [] chrdev_open+0x1ba/0x2d0 [ 33.596013] [] ? _spin_unlock+0x35/0x60 [ 33.596013] [] __dentry_open+0x1b1/0x3f0 [ 33.596013] [] ? chrdev_open+0x0/0x2d0 [ 33.596013] [] nameidata_to_filp+0x57/0x70 [ 33.596013] [] do_filp_open+0x73a/0xb20 [ 33.596013] [] ? alloc_fd+0x131/0x160 [ 33.596013] [] do_sys_open+0x83/0x110 [ 33.596013] [] sys_open+0x20/0x30 [ 33.596013] [] system_call_fastpath+0x16/0x1b [ 33.596013] ---[ end trace dbd83780c3496912 ]--- Signed-off-by: Andrea Bastoni --- litmus/sched_trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litmus/sched_trace.c b/litmus/sched_trace.c index fcf6f44b0899..55c3dc23b3ef 100644 --- a/litmus/sched_trace.c +++ b/litmus/sched_trace.c @@ -64,7 +64,7 @@ int rb_alloc_buf(ring_buffer_t* buf, unsigned int size) write_lock_irqsave(&buf->del_lock, flags); - buf->kfifo = kfifo_alloc(size, GFP_KERNEL, NULL); + buf->kfifo = kfifo_alloc(size, GFP_ATOMIC, NULL); write_unlock_irqrestore(&buf->del_lock, flags); -- cgit v1.2.2