1

Is it possible to freeze all processors from executing code while my code is executed in kernel space?

I need to dump a large amount of data and I need the guarantee that data stays consistent during execution of my code.

local_irq_save and friends disables only for local cpu...

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
zim32
  • 2,561
  • 1
  • 24
  • 31

1 Answers1

0

I guess you were looking for something like big kernel lock (BKL). But this is not available since kernel version 2.6.39. So you need to use finer grained locking version like spin_lock_irqsave() & spin_unlock_irqrestore() which both disables interrupts on local cpu and preemption until the lock is held.

However it is not recommended to hold spin locks for longer duration.

Vikram N
  • 41
  • 3