commit | 714332858bfd40dcf8f741498336d93875c23aa7 | [log] [tgz] |
---|---|---|
author | Anton Blanchard <anton@samba.org> | Mon Sep 03 16:51:10 2012 +0000 |
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | Wed Sep 05 16:05:22 2012 +1000 |
tree | 5faa8dbdff73f2bc85befa530f2f165dd3001724 | |
parent | 1021cb268b3025573c4811f1dee4a11260c4507b [diff] |
powerpc: Restore correct DSCR in context switch During a context switch we always restore the per thread DSCR value. If we aren't doing explicit DSCR management (ie thread.dscr_inherit == 0) and the default DSCR changed while the process has been sleeping we end up with the wrong value. Check thread.dscr_inherit and select the default DSCR or per thread DSCR as required. This was found with the following test case, when running with more threads than CPUs (ie forcing context switching): http://ozlabs.org/~anton/junkcode/dscr_default_test.c With the four patches applied I can run a combination of all test cases successfully at the same time: http://ozlabs.org/~anton/junkcode/dscr_default_test.c http://ozlabs.org/~anton/junkcode/dscr_explicit_test.c http://ozlabs.org/~anton/junkcode/dscr_inherit_test.c Signed-off-by: Anton Blanchard <anton@samba.org> Cc: <stable@kernel.org> # 3.0+ Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>