tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git ms head: 49683159093b2bd63321b7e997e225a40fe5f3cd commit: 369e989ee2578ff47cd28f1fcfa8c076dfdb5a8d [1/2] mm: Add wrapper functions for mmap_sem acquire and release config: i386-tinyconfig (attached as .config) compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901 reproduce: git checkout 369e989ee2578ff47cd28f1fcfa8c076dfdb5a8d # save the attached .config to linux build tree make ARCH=i386 Note: the rcu/ms HEAD 49683159093b2bd63321b7e997e225a40fe5f3cd builds fine. It only hurts bisectibility. All errors (new ones prefixed by >>): In file included from include/linux/spinlock_types.h:18:0, from include/linux/spinlock.h:81, from include/linux/rcupdate.h:38, from include/linux/rculist.h:10, from include/linux/pid.h:4, from include/linux/sched.h:13, from include/linux/uaccess.h:4, from arch/x86/include/asm/stacktrace.h:9, from arch/x86/include/asm/perf_event.h:246, from include/linux/perf_event.h:24, from arch/x86/events/core.c:15: arch/x86/events/core.c: In function 'x86_pmu_event_mapped': >> arch/x86/events/core.c:2123:44: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_sem1'? lockdep_assert_held_exclusive(¤t->mm->mmap_sem); ^ include/linux/lockdep.h:454:54: note: in definition of macro 'lockdep_assert_held_exclusive' #define lockdep_assert_held_exclusive(l) do { (void)(l); } while (0) ^ -- arch/x86/mm/fault.c: In function '__bad_area': >> arch/x86/mm/fault.c:973:13: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_sem1'? up_read(&mm->mmap_sem); ^~ arch/x86/mm/fault.c: In function '__do_page_fault': arch/x86/mm/fault.c:1281:15: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_sem1'? prefetchw(&mm->mmap_sem); ^~ In file included from arch/x86/include/asm/current.h:4:0, from include/linux/sched.h:11, from arch/x86/mm/fault.c:6: arch/x86/mm/fault.c:1384:37: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_sem1'? if (unlikely(!down_read_trylock(&mm->mmap_sem))) { ^ include/linux/compiler.h:179:42: note: in definition of macro 'unlikely' # define unlikely(x) __builtin_expect(!!(x), 0) ^ arch/x86/mm/fault.c:1391:16: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_sem1'? down_read(&mm->mmap_sem); ^~ arch/x86/mm/fault.c:1471:13: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_sem1'? up_read(&mm->mmap_sem); ^~ -- arch/x86/entry/vdso/vma.c: In function 'map_vdso': >> arch/x86/entry/vdso/vma.c:161:29: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_sem1'? if (down_write_killable(&mm->mmap_sem)) ^~ arch/x86/entry/vdso/vma.c:204:14: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_sem1'? up_write(&mm->mmap_sem); ^~ arch/x86/entry/vdso/vma.c: In function 'map_vdso_once': arch/x86/entry/vdso/vma.c:266:16: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_sem1'? down_write(&mm->mmap_sem); ^~ arch/x86/entry/vdso/vma.c:277:16: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_sem1'? up_write(&mm->mmap_sem); ^~ arch/x86/entry/vdso/vma.c:281:14: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_sem1'? up_write(&mm->mmap_sem); ^~ -- kernel//events/core.c: In function 'perf_event_addr_filters_apply': >> kernel//events/core.c:8241:15: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_sem1'? down_read(&mm->mmap_sem); ^~ kernel//events/core.c:8261:13: error: 'struct mm_struct' has no member named 'mmap_sem'; did you mean 'mmap_sem1'? up_read(&mm->mmap_sem); ^~ vim +2123 arch/x86/events/core.c 4b07372a arch/x86/events/core.c Andy Lutomirski 2017-03-16 2117 * userspace with CR4.PCE clear while another task is still 4b07372a arch/x86/events/core.c Andy Lutomirski 2017-03-16 2118 * doing on_each_cpu_mask() to propagate CR4.PCE. 4b07372a arch/x86/events/core.c Andy Lutomirski 2017-03-16 2119 * 4b07372a arch/x86/events/core.c Andy Lutomirski 2017-03-16 2120 * For now, this can't happen because all callers hold mmap_sem 4b07372a arch/x86/events/core.c Andy Lutomirski 2017-03-16 2121 * for write. If this changes, we'll need a different solution. 4b07372a arch/x86/events/core.c Andy Lutomirski 2017-03-16 2122 */ 4b07372a arch/x86/events/core.c Andy Lutomirski 2017-03-16 @2123 lockdep_assert_held_exclusive(¤t->mm->mmap_sem); 4b07372a arch/x86/events/core.c Andy Lutomirski 2017-03-16 2124 7911d3f7 arch/x86/kernel/cpu/perf_event.c Andy Lutomirski 2014-10-24 2125 if (atomic_inc_return(¤t->mm->context.perf_rdpmc_allowed) == 1) 7911d3f7 arch/x86/kernel/cpu/perf_event.c Andy Lutomirski 2014-10-24 2126 on_each_cpu_mask(mm_cpumask(current->mm), refresh_pce, NULL, 1); :::::: The code at line 2123 was first introduced by commit :::::: 4b07372a32c0c1505a7634ad7e607d83340ef645 x86/perf: Clarify why x86_pmu_event_mapped() isn't racy :::::: TO: Andy Lutomirski :::::: CC: Ingo Molnar --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation