Added a spinlock to protect page allocation.