On Wed, May 04, 2016 at 02:16:11PM +0000, Vineet Gupta wrote: > > static inline void *kmap_atomic(struct page *page) > > { > > preempt_disable(); > > pagefault_disable(); > > if (!PageHighMem(page)) > > return page_address(page); > > > > return __kmap_atomic(page); > > } > > I actually want to return early for !PageHighMem and avoid the pointless 2 > LD-ADD-ST to memory for map and 2 LD-SUB-ST for unmap for regular pages for such > cases. So I'm fairly sure people rely on the fact you cannot have pagefault inside a kmap_atomic(). But you could potentially get away with leaving preemption enabled. Give it a try, see if something goes *bang* ;-) -- 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>