lock_kernel() & kmalloc - evil together?

From: Sam Watters (watters@sgi.com)
Date: Thu Aug 10 2000 - 16:57:07 EST


I was reading through the "Linux Kernel Locking HOWTO" and came across the
following:

"9.7 Things Which Sleep

You can never call the following routines from an interrupt context, or while
holding a spinlock, as they may sleep:
   
        [snippet skipped]
        * kmalloc(GFP_KERNEL)

Interestingly, this may..."

Okay, I screwed up in a patch I am doing and I put slipped in some
kmalloc(GFP_KERNEL) calls in a segment of code that lies between a
lock_kernel()/unlock_kernel() - specifically in do_fork(). I did find some
other kmalloc(GFP_KERNEL) calls that occur in this same segment (in functions
that get called from do_fork()). So, am I truly evil for adding these new
kmalloc(GFP_KERNEL) calls? Any suggestions on how best to allocate memory while
holding a spinlock in 2.4.0?

Thanks!
  

-- 
----------------------------------------
Sam Watters
SGI
watters@sgi.com
(651) 683-5647
----------------------------------------

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Aug 15 2000 - 21:00:22 EST