Re: swapping with MMU Notifiers V2

Andrea Arcangeli
2008-01-31T10:15:19Z

On Thu, Jan 31, 2008 at 08:50:01AM +0200, Avi Kivity wrote:
> This is surprising. pagefault_disable() is really a preempt_disable(), and
> kvm_read_guest_atomic() should only be called from atomic contexts (with
> preemption already disabled), no?

_spin_lock calls preempt_disable() and that's the result with PREEMPT=n:

#define preempt_disable() do { } while (0)

pagefault_disable always calls into inc_preempt_count() which is why
kmap_atomic uses it instead of preempt_disable().