I guess it's hard avoiding a TLB flush on a task switch. However, on a
system call, I did hope to not have to invalidate more than _one_ TLB
entry, if any!
> However, one possibility is to have a per-processor page at
> a fixed kernel virtual address that can contain a pointer to the
> current task and any other desired per-processor information.
>
Your current will be as fast as accessing current->this with my
proposal (if it works).
your current = *(constant_address)
2.1 current = (%esp & ~8191)
The 2.1 current is a move and an and operation. The new current is a
memory load. It is not clear that there is any speed advantage by
using a load. However, if the task_struct of the current process is at
a constant address, there is no load, just a 'mov reg, constant'
operation, which is efficient (an unconfirmed rumor sais that the
K6-II doesn't even _use_ an execution unit for constant loads!).
astor
-- Alexander Kjeldaas, Guardian Networks AS, Trondheim, Norway http://www.guardian.no/- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html