Dor Laor wrote:
+ if (atomic_read(&pt->pending) > 1)
+        atomic_set(&pt->pending, 1);
+

Replace the atomic_inc() with atomic_set(, 1) instead? One less test, and more important, the logic is scattered less around the source.
But having only a pending bit instead of a counter will cause kvm to drop pit irqs on rare high load situations.
The disable reinjection option is better.

Both variants disable reinjection. Forcing a counter to 1 every time it exceeds 1 is equivalent to maintaining a bit.

In both variants, there is a missing 'if (disable_reinjection)' (Marcelo mentioned this in the original message).

Except for these 'tsc compensate' guest, what are the occasions where the guest writes his tsc? If this is the only case we can disable reinjection once we trap tsc writes.

I don't think these guests write to the tsc. Rather, they read the tsc and the pit counters and try to correlate. And fail.

--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to