Re: [Bug 350] New: i386 context switch very slow compared to 2.4 due to wrmsr (performance)

From: Jamie Lokier (jamie@shareable.org)
Date: Wed Feb 12 2003 - 05:27:41 EST


Andi Kleen wrote:
> + /* FIXME should disable preemption here but how can we reenable it? */
> +
> + enable_sysenter();
> +

Try this:

        1. Disable preemption in do_sys_vm86(), at the same place as
           disable_sysenter() is called.

        2. Enable preemption in save_v86_state(), and put the call
           to enable_sysenter() there.

        3. In restore_sigcontext() [signal.c], _iff_ the VM flag
           is set in the restored context, call disable_sysenter()
           and also disable preemption.

That should make vm86 simply disable preemption while it is activated.
It is not as nice as actually being preemptible, but safe first,
optimise later.

The return path to vm86 mode has the peculiar property of not doing
the need_resched test, unlike the return path to normal user space,
which is a boon here.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Feb 15 2003 - 22:00:39 EST