It looks to me like loadsegment() does the thing.
But what about disabling IRQs at all during task switch, just in case?
This could prevent from such surprices in the future.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to firstname.lastname@example.org
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html