On 23/04/2019 11:50, George Dunlap wrote: > > >> On Apr 20, 2019, at 4:24 PM, Dario Faggioli <dfaggi...@suse.com> wrote: >> >> In schedule(), if we pick, as the next vcpu to run (next) the same one >> that is running already (prev), we never get to call context_switch(). >> >> We can, therefore, get rid of all the `if`-s testing prev and next being >> different, trading them with an ASSERT() (on ARM, the ASSERT() was even >> already there!) > > Keeping in mind that ASSERT() is merely a debugging aid: suppose that testing > didn’t discover this, and a bug that violated this assumption slipped into > production. Would the patched code DTRT?
The unpatched code would already do something wrong: it would clear v->is_running (through context_saved()) for the running vcpu, potentially leading to all sorts of wrong decisions in the scheduling code later. Juergen _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel