On Thu, Mar 23, 2017 at 11:49:06PM +0900, Tetsuo Handa wrote: > [ 2.609598] [drm] Initialized vmwgfx 2.12.0 20170221 for 0000:00:0f.0 on minor 0 > [ 2.616064] BUG: sleeping function called from invalid context at mm/vmalloc.c:1480 [...] > [ 2.616289] __might_sleep+0x4a/0x80 > [ 2.616293] remove_vm_area+0x22/0x90 > [ 2.616296] __vunmap+0x2e/0x110 > [ 2.616299] vfree+0x42/0x90 > [ 2.616304] kvfree+0x2c/0x40 > [ 2.616312] drm_ht_remove+0x1a/0x30 [drm] > [ 2.616317] ttm_object_file_release+0x50/0x90 [ttm] ttm_object_file_release() takes a spinlock, calls drm_ht_remove() which calls kvfree(). Can somebody remind me what exactly might sleep in remove_vm_area()? Is it the cache flush on some architectures? It'd be really nice for vfree() to be callable from atomic context. Assuming we can't get rid of the thing which might sleep in remove_vm_area(), I think we should add a might_sleep() in kvfree(). We need that big warning there so we don't get hard to debug problems when kvmalloc had to fall back to vmalloc(). -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>