tree:
https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
linux-5.12.y-rt-rebase
head: 2664a7f5d3d24da4b2657a1e933181d376b77616
commit: bc04b285e73c1a64fd5d9723af20a21ce0feb628 [30/193] printk: use seqcount_latch for
console_seq
config: mips-randconfig-r016-20210318 (attached as .config)
compiler: clang version 13.0.0 (
https://github.com/llvm/llvm-project
436c6c9c20cc522c92a923440a5fc509c342a7db)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
#
https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/com...
git remote add linux-rt-devel
https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
git fetch --no-tags linux-rt-devel linux-5.12.y-rt-rebase
git checkout bc04b285e73c1a64fd5d9723af20a21ce0feb628
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from kernel/printk/printk.c:62:
kernel/printk/internal.h:56:20: warning: no previous prototype for function
'vprintk_func' [-Wmissing-prototypes]
__printf(1, 0) int vprintk_func(const char *fmt, va_list args) { return 0; }
^
kernel/printk/internal.h:56:16: note: declare 'static' if the function is not
intended to be used outside of this translation unit
__printf(1, 0) int vprintk_func(const char *fmt, va_list args) { return 0; }
^
static
kernel/printk/printk.c:176:5: warning: no previous prototype for function
'devkmsg_sysctl_set_loglvl' [-Wmissing-prototypes]
int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write,
^
kernel/printk/printk.c:176:1: note: declare 'static' if the function is not
intended to be used outside of this translation unit
int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write,
^
static
kernel/printk/printk.c:2288:2: error: FIXME
#error FIXME
^
kernel/printk/printk.c:2648:9: error: implicit declaration of function
'latched_seq_read_nolock' [-Werror,-Wimplicit-function-declaration]
seq = latched_seq_read_nolock(&console_seq);
^
> kernel/printk/printk.c:2654:4: error: implicit declaration of
function 'latched_seq_write' [-Werror,-Wimplicit-function-declaration]
latched_seq_write(&console_seq, r.info->seq);
^
kernel/printk/printk.c:2664:4: error: implicit declaration of function
'latched_seq_write' [-Werror,-Wimplicit-function-declaration]
latched_seq_write(&console_seq, seq + 1);
^
kernel/printk/printk.c:2691:3: error: implicit declaration of function
'latched_seq_write' [-Werror,-Wimplicit-function-declaration]
latched_seq_write(&console_seq, seq + 1);
^
kernel/printk/printk.c:2782:4: error: implicit declaration of function
'latched_seq_write' [-Werror,-Wimplicit-function-declaration]
latched_seq_write(&console_seq, prb_first_valid_seq(prb));
^
kernel/printk/printk.c:3029:32: error: implicit declaration of function
'latched_seq_read_nolock' [-Werror,-Wimplicit-function-declaration]
exclusive_console_stop_seq =
latched_seq_read_nolock(&console_seq);
^
kernel/printk/printk.c:3033:3: error: implicit declaration of function
'latched_seq_write' [-Werror,-Wimplicit-function-declaration]
latched_seq_write(&console_seq, syslog_seq);
^
2 warnings and 8 errors generated.
vim +/latched_seq_write +2654 kernel/printk/printk.c
2582
2583 /**
2584 * console_unlock - unlock the console system
2585 *
2586 * Releases the console_lock which the caller holds on the console system
2587 * and the console driver list.
2588 *
2589 * While the console_lock was held, console output may have been buffered
2590 * by printk(). If this is the case, console_unlock(); emits
2591 * the output prior to releasing the lock.
2592 *
2593 * If there is output waiting, we wake /dev/kmsg and syslog() users.
2594 *
2595 * console_unlock(); may be called from any context.
2596 */
2597 void console_unlock(void)
2598 {
2599 static char ext_text[CONSOLE_EXT_LOG_MAX];
2600 static char text[CONSOLE_LOG_MAX];
2601 unsigned long flags;
2602 bool do_cond_resched, retry;
2603 struct printk_info info;
2604 struct printk_record r;
2605 u64 seq;
2606
2607 if (console_suspended) {
2608 up_console_sem();
2609 return;
2610 }
2611
2612 prb_rec_init_rd(&r, &info, text, sizeof(text));
2613
2614 /*
2615 * Console drivers are called with interrupts disabled, so
2616 * @console_may_schedule should be cleared before; however, we may
2617 * end up dumping a lot of lines, for example, if called from
2618 * console registration path, and should invoke cond_resched()
2619 * between lines if allowable. Not doing so can cause a very long
2620 * scheduling stall on a slow console leading to RCU stall and
2621 * softlockup warnings which exacerbate the issue with more
2622 * messages practically incapacitating the system.
2623 *
2624 * console_trylock() is not able to detect the preemptive
2625 * context reliably. Therefore the value must be stored before
2626 * and cleared after the "again" goto label.
2627 */
2628 do_cond_resched = console_may_schedule;
2629 again:
2630 console_may_schedule = 0;
2631
2632 /*
2633 * We released the console_sem lock, so we need to recheck if
2634 * cpu is online and (if not) is there at least one CON_ANYTIME
2635 * console.
2636 */
2637 if (!can_use_console()) {
2638 console_locked = 0;
2639 up_console_sem();
2640 return;
2641 }
2642
2643 for (;;) {
2644 size_t ext_len = 0;
2645 size_t len;
2646
2647 skip:
2648 seq = latched_seq_read_nolock(&console_seq);
2649 if (!prb_read_valid(prb, seq, &r))
2650 break;
2651
2652 if (seq != r.info->seq) {
2653 console_dropped += r.info->seq - seq;
2654 latched_seq_write(&console_seq, r.info->seq);
2655 seq = r.info->seq;
2656 }
2657
2658 if (suppress_message_printing(r.info->level)) {
2659 /*
2660 * Skip record we have buffered and already printed
2661 * directly to the console when we received it, and
2662 * record that has level above the console loglevel.
2663 */
2664 latched_seq_write(&console_seq, seq + 1);
2665 goto skip;
2666 }
2667
2668 /* Output to all consoles once old messages replayed. */
2669 if (unlikely(exclusive_console &&
2670 seq >= exclusive_console_stop_seq)) {
2671 exclusive_console = NULL;
2672 }
2673
2674 /*
2675 * Handle extended console text first because later
2676 * record_print_text() will modify the record buffer in-place.
2677 */
2678 if (nr_ext_console_drivers) {
2679 ext_len = info_print_ext_header(ext_text,
2680 sizeof(ext_text),
2681 r.info);
2682 ext_len += msg_print_ext_body(ext_text + ext_len,
2683 sizeof(ext_text) - ext_len,
2684 &r.text_buf[0],
2685 r.info->text_len,
2686 &r.info->dev_info);
2687 }
2688 len = record_print_text(&r,
2689 console_msg_format & MSG_FORMAT_SYSLOG,
2690 printk_time);
2691 latched_seq_write(&console_seq, seq + 1);
2692
2693 printk_safe_enter_irqsave(flags);
2694
2695 /*
2696 * While actively printing out messages, if another printk()
2697 * were to occur on another CPU, it may wait for this one to
2698 * finish. This task can not be preempted if there is a
2699 * waiter waiting to take over.
2700 */
2701 console_lock_spinning_enable();
2702
2703 stop_critical_timings(); /* don't trace print latency */
2704 call_console_drivers(ext_text, ext_len, text, len);
2705 start_critical_timings();
2706
2707 if (console_lock_spinning_disable_and_check()) {
2708 printk_safe_exit_irqrestore(flags);
2709 return;
2710 }
2711
2712 printk_safe_exit_irqrestore(flags);
2713
2714 if (do_cond_resched)
2715 cond_resched();
2716 }
2717
2718 console_locked = 0;
2719
2720 up_console_sem();
2721
2722 /*
2723 * Someone could have filled up the buffer again, so re-check if there's
2724 * something to flush. In case we cannot trylock the console_sem again,
2725 * there's a new owner and the console_unlock() from them will do the
2726 * flush, no worries.
2727 */
2728 retry = prb_read_valid(prb, latched_seq_read_nolock(&console_seq), NULL);
2729 if (retry && console_trylock())
2730 goto again;
2731 }
2732 EXPORT_SYMBOL(console_unlock);
2733
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org