lkml.org 
[lkml]   [2000]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: lock_kernel() & kmalloc - evil together?
    On Thu, Aug 10, 2000 at 04:57:07PM -0500, Sam Watters wrote:
    > 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)

    > 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

    the BKL is no ordinary spinlock. if the kernel wishes to schedule, it will
    drop the BKL on behalf of the process and reacquire it again before returning
    to your code. Don't panic, you haven't done anything bad. the snippet of
    text above refers only to spin_lock() locks.

    --
    Revolutions do not require corporate support.

    -
    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/

    \
     
     \ /
      Last update: 2005-03-22 13:58    [W:0.033 / U:60.312 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site