Commit d80734da authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: remove silly debug path from get_vsid()

From: David Gibson <david@gibson.dropbear.id.au>

Currently the get_vsid() and get_kernel_vsid() functions have a test which
enables a different VSID algorithm for debugging.  Using a dumb VSID
algorithm for stressing the hash table is a reasonable debugging tool, but
switching it at runtime makes no sense at all.  Plus it adds another test
and memory access to the performance critical SLB miss path.

This patch removes the test, replacing it with a compile time switch.  It
seems to make a measurable, although small speedup to the SLB miss path
(maybe 0.5%).
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 9978a575
......@@ -189,15 +189,15 @@ get_kernel_vsid( unsigned long ea )
ordinal = (((ea >> 28) & 0x1fff) * LAST_USER_CONTEXT) | (ea >> 60);
vsid = (ordinal * VSID_RANDOMIZER) & VSID_MASK;
ifppcdebug(PPCDBG_HTABSTRESS) {
/* For debug, this path creates a very poor vsid distribuition.
* A user program can access virtual addresses in the form
* 0x0yyyyxxxx000 where yyyy = xxxx to cause multiple mappings
* to hash to the same page table group.
*/
ordinal = ((ea >> 28) & 0x1fff) | (ea >> 44);
vsid = ordinal & VSID_MASK;
}
#ifdef HTABSTRESS
/* For debug, this path creates a very poor vsid distribuition.
* A user program can access virtual addresses in the form
* 0x0yyyyxxxx000 where yyyy = xxxx to cause multiple mappings
* to hash to the same page table group.
*/
ordinal = ((ea >> 28) & 0x1fff) | (ea >> 44);
vsid = ordinal & VSID_MASK;
#endif /* HTABSTRESS */
return vsid;
}
......@@ -212,11 +212,11 @@ get_vsid( unsigned long context, unsigned long ea )
ordinal = (((ea >> 28) & 0x1fff) * LAST_USER_CONTEXT) | context;
vsid = (ordinal * VSID_RANDOMIZER) & VSID_MASK;
ifppcdebug(PPCDBG_HTABSTRESS) {
/* See comment above. */
ordinal = ((ea >> 28) & 0x1fff) | (context << 16);
vsid = ordinal & VSID_MASK;
}
#ifdef HTABSTRESS
/* See comment above. */
ordinal = ((ea >> 28) & 0x1fff) | (context << 16);
vsid = ordinal & VSID_MASK;
#endif /* HTABSTRESS */
return vsid;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment