Re: [RFC 01/11] x86/ldt: Simplify LDT switching logic

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 5, 2017 at 3:40 PM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> I think the "LDT didn't match" was really just a simpler and more
> efficient way to say "they weren't both NULL".

In fact, looking back in the history, it used to instead add the sizes
of the context (and then similar logic: "if the sum is non-zero, one
or the other was non-zero").

Commit 0bbed3beb4 ("[PATCH] Thread-Local Storage (TLS) support") in
the historical tree then did this:

-               if (next->context.size+prev->context.size)
+               if (unlikely(prev->context.ldt != next->context.ldt))

I'm ok with your change, but I reacted to the commit log about how
this was "overcomplicated". It was actually an optimization exactly to
avoid two compares..

               Linus

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux