Search code examples
linux-kernelpreemptive

force linux kernel to run code without preempting


I'm writing a Linux kernel(android Linux kernel) module. I have a general question . is it possible to force kernel run a part of code in non-preemptive mode?


Solution

  • Yes, you can wrap the code in preempt_disable(); / preempt_enable();. Note that this does not block interrupts.