RE: [PATCH 3/3] x86: add local_tlb_flush_kernel_range()
From: Dan Magenheimer <hidden>
Date: 2012-06-27 15:14:39
Also in:
lkml
From: Minchan Kim [mailto:minchan@kernel.org] Subject: Re: [PATCH 3/3] x86: add local_tlb_flush_kernel_range() Hello, On 06/27/2012 03:14 PM, Alex Shi wrote:quoted
On 06/27/2012 01:53 PM, Minchan Kim wrote:quoted
On 06/26/2012 01:14 AM, Seth Jennings wrote:quoted
This patch adds support for a local_tlb_flush_kernel_range() function for the x86 arch. This function allows for CPU-local TLB flushing, potentially using invlpg for single entry flushing, using an arch independent function name. Signed-off-by: Seth Jennings <redacted>Anyway, we don't matter INVLPG_BREAK_EVEN_PAGES's optimization point is 8 or something.Different CPU type has different balance point on the invlpg replacing flush all. and some CPU never get benefit from invlpg, So, it's better to use different value for different CPU, not a fixed INVLPG_BREAK_EVEN_PAGES.I think it could be another patch as further step and someone who are very familiar with architecture could do better than. So I hope it could be merged if it doesn't have real big problem. Thanks for the comment, Alex.
Just my opinion, but I have to agree with Alex. Hardcoding behavior that is VERY processor-specific is a bad idea. TLBs should only be messed with when absolutely necessary, not for the convenience of defending an abstraction that is nice-to-have but, in current OS kernel code, unnecessary. IIUC, zsmalloc only cares that the breakeven point is greater than two. An arch-specific choice of (A) two page flushes vs (B) one all-TLB flush should be all that is necessary right now. (And, per separate discussion, even this isn't really necessary either.) If zsmalloc _ever_ gets extended to support items that might span three or more pages, a more generic TLB flush-pages-vs-flush-all approach may be warranted and, by then, may already exist in some future kernel. Until then, IMHO, keep it simple. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>