Things Which Sleep

You can never call the following routines while holding a spinlock, as they may sleep:

  • Accesses to userspace:

    • copy_from_user()

    • copy_to_user()

    • get_user()

    • put_user()

  • kmalloc(GFP_KERNEL)

  • printk(), which can be called from user context, interestingly enough.