Greetings,
0day kernel testing robot got the below dmesg and the first bad commit is
https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git x86/pcid
commit c4125ff6333c97d3ce00e5886b809b7c20594585
Author: Andy Lutomirski <luto(a)kernel.org>
AuthorDate: Sat Dec 19 22:20:32 2015 -0800
Commit: Andy Lutomirski <luto(a)kernel.org>
CommitDate: Fri Jan 8 15:11:27 2016 -0800
x86/mm: Try to preserve old TLB entries using PCID
PCID is a "process context ID" -- it's what other architectures call
an address space ID. Every non-global TLB entry is tagged with a
PCID, only TLB entries that match the currently selected PCID are
used, and we can switch PGDs without flushing the TLB. x86's
PCID is 12 bits.
This is an unorthodox approach to using PCID. x86's PCID is far too
short to uniquely identify a process, and we can't even really
uniquely identify a running process because there are monster
systems with over 4096 CPUs. To make matters worse, past attempts
to use all 12 PCID bits have resulted in slowdowns instead of
speedups.
This patch uses PCID differently. We use a PCID to identify a
recently-used mm on a per-cpu basis. An mm has no fixed PCID
binding at all; instead, we give it a fresh PCID each time it's
loaded except in cases where we want to preserve the TLB, in which
case we reuse a recent value.
In particular, we use PCIDs 1-7 for recently-used mms and we reserve
PCID 0 for swapper_pg_dir and for PCID-unaware CR3 users (e.g. EFI).
Nothing ever switches to PCID 0 without flushing PCID 0 non-global
pages, so PCID 0 conflicts won't cause problems.
This also leaves the door open for UDEREF-style address space
switching: the kernel will use PCID 0, and exits could simply switch
back. (As a practical matter, an in-tree implementation of that
feature would probably forego the full syscall fast path and just
invoke some or all of switch_mm in prepare_exit_to_usermode.)
This seems to save about 100ns on context switches between mms.
Signed-off-by: Andy Lutomirski <luto(a)kernel.org>
+------------------------------------------------------------------+------------+------------+------------+
| | df4b08184f |
c4125ff633 | 7246a44772 |
+------------------------------------------------------------------+------------+------------+------------+
| boot_successes | 6 | 0
| 0 |
| boot_failures | 92 | 10
| 13 |
| WARNING:at_arch/x86/mm/dump_pagetables.c:#note_page() | 92 | 4
| 13 |
| backtrace:mark_rodata_ro | 92 | 4
| 13 |
| IP-Config:Auto-configuration_of_network_failed | 4 | 4
| |
| WARNING:at_arch/x86/kernel/cpu/common.c:#warn_pre_alternatives() | 0 | 10
| 13 |
| backtrace:zap_old_pcids | 0 | 10
| 13 |
| backtrace:kernel_physical_mapping_init | 0 | 10
| 13 |
| backtrace:init_memory_mapping | 0 | 10
| 13 |
| backtrace:init_mem_mapping | 0 | 10
| 13 |
| backtrace:init_range_memory_mapping | 0 | 10
| 13 |
| backtrace:page_table_range_init | 0 | 10
| 13 |
| backtrace:early_ioremap_page_table_range_init | 0 | 10
| 13 |
| backtrace:paging_init | 0 | 10
| 13 |
| backtrace:native_pagetable_init | 0 | 10
| 13 |
+------------------------------------------------------------------+------------+------------+------------+
early console in setup code
[ 0.000000] Linux version 4.4.0-rc5-00013-gc4125ff (kbuild@lkp-ib04) (gcc version 5.2.1
20150911 (Debian 5.2.1-17) ) #1 SMP Sat Jan 9 08:38:41 CST 2016
[ 0.000000] ------------[ cut here ]------------
[ 0.000000] WARNING: CPU: 0 PID: 0 at arch/x86/kernel/cpu/common.c:1520
warn_pre_alternatives+0x17/0x1c()
[ 0.000000] You're using static_cpu_has before alternatives have run!
[ 0.000000] Modules linked in:
[ 0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted 4.4.0-rc5-00013-gc4125ff #1
[ 0.000000] 00000000 00000000 41625f34 41231c0a 41625f5c 41625f4c 41033c67 4100d0e4
[ 0.000000] 00000000 41627020 416f4020 41625f64 41033ca4 00000009 41625f5c 4155e269
[ 0.000000] 41625f78 41625f78 4100d0e4 4155e2a4 000005f0 4155e269 41625f84 410279fd
[ 0.000000] Call Trace:
[ 0.000000] [<41231c0a>] dump_stack+0x48/0x60
[ 0.000000] [<41033c67>] warn_slowpath_common+0x79/0x90
[ 0.000000] [<4100d0e4>] ? warn_pre_alternatives+0x17/0x1c
[ 0.000000] [<41033ca4>] warn_slowpath_fmt+0x26/0x2a
[ 0.000000] [<4100d0e4>] warn_pre_alternatives+0x17/0x1c
[ 0.000000] [<410279fd>] zap_old_pcids+0x1d/0x40
[ 0.000000] [<4168e2a3>] setup_arch+0xe3/0xb5f
[ 0.000000] [<410750cc>] ? vprintk_emit+0x469/0x49d
[ 0.000000] [<4168b7f7>] start_kernel+0x88/0x3bd
[ 0.000000] [<4168b2c7>] i386_start_kernel+0x91/0x95
[ 0.000000] ---[ end trace cb88537fdc8fa200 ]---
[ 0.000000] KERNEL supported cpus:
git bisect start 7246a4477267b8a2347212b8c046a68a41d2debc
168309855a7d1e16db751e9c647119fe2d2dc878 --
git bisect bad 3125083f93ee9606c4da71d32e7268ead3cb8b61 # 08:07 0- 11 Merge
'bluetooth-next/master' into devel-catchup-201601090719
git bisect good 09333fb3345b47a55fef29c9648c6ef541757dbb # 08:12 22+ 24 Merge
'linux-review/Douglas-Anderson/dma-mapping-Patches-for-speeding-up-allocation/20160109-071110'
into devel-catchup-201601090719
git bisect good 04b969a74033f896596aed80fa700082551ea3c7 # 08:19 22+ 24 Merge
'mkp-scsi/4.5/scsi-queue' into devel-catchup-201601090719
git bisect bad 13e75c84fd26cecfc47f349de90295d174d29a77 # 08:22 0- 24 Merge
'luto/x86/pcid' into devel-catchup-201601090719
git bisect good 7752daf506becd3b36e768bd2561f562f64d9d16 # 08:31 22+ 22 x86/mm:
Add nopcid to turn off PCID
git bisect good 357b13bf9d6d04e585894ff5dcf40fa14ea1d3a7 # 08:36 22+ 22 x86/mm:
Factor out remote TLB flushing
git bisect good df4b08184f61f5b87deb065ab87e56699009253d # 08:47 21+ 21 x86/mm:
Uninline switch_mm
git bisect bad c4125ff6333c97d3ce00e5886b809b7c20594585 # 08:47 0- 6 x86/mm:
Try to preserve old TLB entries using PCID
# first bad commit: [c4125ff6333c97d3ce00e5886b809b7c20594585] x86/mm: Try to preserve old
TLB entries using PCID
git bisect good df4b08184f61f5b87deb065ab87e56699009253d # 08:49 67+ 90 x86/mm:
Uninline switch_mm
# extra tests with DEBUG_INFO
git bisect bad c4125ff6333c97d3ce00e5886b809b7c20594585 # 09:28 0- 2 x86/mm:
Try to preserve old TLB entries using PCID
# extra tests on HEAD of linux-devel/devel-catchup-201601090719
git bisect bad 7246a4477267b8a2347212b8c046a68a41d2debc # 09:28 0- 13 0day
head guard for 'devel-catchup-201601090719'
# extra tests on tree/branch luto/x86/pcid
git bisect bad c4125ff6333c97d3ce00e5886b809b7c20594585 # 09:31 0- 6 x86/mm:
Try to preserve old TLB entries using PCID
# extra tests with first bad commit reverted
git bisect good ac3fc3ed7b4484e5b18135a8a1d904b063fe5ad5 # 09:50 60+ 65 Revert
"x86/mm: Try to preserve old TLB entries using PCID"
# extra tests on tree/branch linus/master
git bisect good 44d8a7d5c1b4f9e99c5601217ce03a48412f9aac # 09:53 66+ 68 Merge
tag 'fixes-for-linus' of
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
# extra tests on tree/branch linux-next/master
git bisect good e04c94f10a05003e5b6f2978efcc37b282483c2f # 09:57 66+ 72 Add
linux-next specific files for 20160108
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/lkp Intel Corporation