Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking fixes from Ingo Molnar:
"Two lockdep fixes for bugs introduced by the cross-release dependency
tracking feature - plus a commit that disables it because performance
regressed in an absymal fashion on some systems"

* 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
locking/lockdep: Disable cross-release features for now
locking/selftest: Avoid false BUG report
locking/lockdep: Fix stacktrace mess

+25 -31
+21 -29
kernel/locking/lockdep.c
··· 1873 1873 struct held_lock *next, int distance, struct stack_trace *trace, 1874 1874 int (*save)(struct stack_trace *trace)) 1875 1875 { 1876 - struct lock_list *entry; 1877 - int ret; 1878 - struct lock_list this; 1879 1876 struct lock_list *uninitialized_var(target_entry); 1877 + struct lock_list *entry; 1878 + struct lock_list this; 1879 + int ret; 1880 1880 1881 1881 /* 1882 1882 * Prove that the new <prev> -> <next> dependency would not ··· 1890 1890 this.class = hlock_class(next); 1891 1891 this.parent = NULL; 1892 1892 ret = check_noncircular(&this, hlock_class(prev), &target_entry); 1893 - if (unlikely(!ret)) 1893 + if (unlikely(!ret)) { 1894 + if (!trace->entries) { 1895 + /* 1896 + * If @save fails here, the printing might trigger 1897 + * a WARN but because of the !nr_entries it should 1898 + * not do bad things. 1899 + */ 1900 + save(trace); 1901 + } 1894 1902 return print_circular_bug(&this, target_entry, next, prev, trace); 1903 + } 1895 1904 else if (unlikely(ret < 0)) 1896 1905 return print_bfs_bug(ret); 1897 1906 ··· 1947 1938 return print_bfs_bug(ret); 1948 1939 1949 1940 1950 - if (save && !save(trace)) 1941 + if (!trace->entries && !save(trace)) 1951 1942 return 0; 1952 1943 1953 1944 /* ··· 1967 1958 if (!ret) 1968 1959 return 0; 1969 1960 1970 - /* 1971 - * Debugging printouts: 1972 - */ 1973 - if (verbose(hlock_class(prev)) || verbose(hlock_class(next))) { 1974 - graph_unlock(); 1975 - printk("\n new dependency: "); 1976 - print_lock_name(hlock_class(prev)); 1977 - printk(KERN_CONT " => "); 1978 - print_lock_name(hlock_class(next)); 1979 - printk(KERN_CONT "\n"); 1980 - dump_stack(); 1981 - if (!graph_lock()) 1982 - return 0; 1983 - } 1984 1961 return 2; 1985 1962 } 1986 1963 ··· 1981 1986 { 1982 1987 int depth = curr->lockdep_depth; 1983 1988 struct held_lock *hlock; 1984 - struct stack_trace trace; 1985 - int (*save)(struct stack_trace *trace) = save_trace; 1989 + struct stack_trace trace = { 1990 + .nr_entries = 0, 1991 + .max_entries = 0, 1992 + .entries = NULL, 1993 + .skip = 0, 1994 + }; 1986 1995 1987 1996 /* 1988 1997 * Debugging checks. ··· 2017 2018 */ 2018 2019 if (hlock->read != 2 && hlock->check) { 2019 2020 int ret = check_prev_add(curr, hlock, next, 2020 - distance, &trace, save); 2021 + distance, &trace, save_trace); 2021 2022 if (!ret) 2022 2023 return 0; 2023 - 2024 - /* 2025 - * Stop saving stack_trace if save_trace() was 2026 - * called at least once: 2027 - */ 2028 - if (save && ret == 2) 2029 - save = NULL; 2030 2024 2031 2025 /* 2032 2026 * Stop after the first non-trylock entry,
+2 -2
lib/Kconfig.debug
··· 1092 1092 select DEBUG_MUTEXES 1093 1093 select DEBUG_RT_MUTEXES if RT_MUTEXES 1094 1094 select DEBUG_LOCK_ALLOC 1095 - select LOCKDEP_CROSSRELEASE 1096 - select LOCKDEP_COMPLETIONS 1095 + select LOCKDEP_CROSSRELEASE if BROKEN 1096 + select LOCKDEP_COMPLETIONS if BROKEN 1097 1097 select TRACE_IRQFLAGS 1098 1098 default n 1099 1099 help
+2
lib/locking-selftest.c
··· 2031 2031 print_testname("mixed read-lock/lock-write ABBA"); 2032 2032 pr_cont(" |"); 2033 2033 dotest(rlock_ABBA1, FAILURE, LOCKTYPE_RWLOCK); 2034 + #ifdef CONFIG_PROVE_LOCKING 2034 2035 /* 2035 2036 * Lockdep does indeed fail here, but there's nothing we can do about 2036 2037 * that now. Don't kill lockdep for it. 2037 2038 */ 2038 2039 unexpected_testcase_failures--; 2040 + #endif 2039 2041 2040 2042 pr_cont(" |"); 2041 2043 dotest(rwsem_ABBA1, FAILURE, LOCKTYPE_RWSEM);