Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1359731

Re: [RFC][PATCH v4 2/2] printk: Skip messages on oops

From Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Newsgroups linux.kernel
Subject Re: [RFC][PATCH v4 2/2] printk: Skip messages on oops
Date 2016-03-17 12:00 +0100
Message-ID <rdDOO-6iN-11@gated-at.bofh.it> (permalink)
References <rcBvI-4Pn-17@gated-at.bofh.it> <rcBvJ-4Pn-37@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hello Jan,

On (03/14/16 23:13), Sergey Senozhatsky wrote:
> 
> From: Jan Kara <jack@suse.cz>
> 
> When there are too many messages in the kernel printk buffer it can take
> very long to print them to console (especially when using slow serial
> console). This is undesirable during oops so when we encounter oops and
> there are more than 100 messages to print, print just the newest 100
> messages and then the oops message.

I think this patch will introduce a regression, so I'd probably prefer
not to include it now in the series.

the pattern "print something important then panic()" is quite common.
given that other CPUs can printk() a lot before panic_cpu send out
stop_ipi, we can lose the "print something important" part.

...
arch/metag/kernel/cachepart.c:                  pr_emerg("Potential cache aliasing detected in %s on Thread %d\n",
arch/metag/kernel/cachepart.c-                           cache_type ? "DCACHE" : "ICACHE", thread_id);
arch/metag/kernel/cachepart.c-                  pr_warn("Total %s size: %u bytes\n",
arch/metag/kernel/cachepart.c-                          cache_type ? "DCACHE" : "ICACHE",
arch/metag/kernel/cachepart.c-                          cache_type ? get_dcache_size()
arch/metag/kernel/cachepart.c-                          : get_icache_size());
arch/metag/kernel/cachepart.c-                  pr_warn("Thread %s size: %d bytes\n",
arch/metag/kernel/cachepart.c-                          cache_type ? "CACHE" : "ICACHE",
arch/metag/kernel/cachepart.c-                          thread_cache_size);
arch/metag/kernel/cachepart.c-                  pr_warn("Page Size: %lu bytes\n", PAGE_SIZE);
arch/metag/kernel/cachepart.c-                  panic("Potential cache aliasing detected");
...
arch/s390/kernel/jump_label.c:  pr_emerg("Jump label code mismatch at %pS [%p]\n", ipc, ipc);
arch/s390/kernel/jump_label.c:  pr_emerg("Found:    %6ph\n", ipc);
arch/s390/kernel/jump_label.c:  pr_emerg("Expected: %6ph\n", ipe);
arch/s390/kernel/jump_label.c:  pr_emerg("New:      %6ph\n", ipn);
arch/s390/kernel/jump_label.c-  panic("Corrupted kernel text");
...



another example is hardlockup detector with sysctl_hardlockup_all_cpu_backtrace.

static void watchdog_overflow_callback(...)
{
	...
	if (is_hardlockup()) {
	...
		if (sysctl_hardlockup_all_cpu_backtrace &&
				!test_and_set_bit(0, &hardlockup_allcpu_dumped))
			trigger_allbutself_cpu_backtrace();

		nmi_panic(regs, msg);
	...
	}
	...
}

trigger_allbutself_cpu_backtrace() can be much more than 100 lines.
trigger_allbutself_cpu_backtrace() may or may not be implemented via
NMI. for example arch/sparc/kernel/process_64.c

thus, we better avoid skipping any messages when in panic() I think.

	-ss

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC][PATCH v4 0/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-03-14 15:20 +0100
  [RFC][PATCH v4 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-03-14 15:20 +0100
    Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Jan Kara <jack@suse.cz> - 2016-03-15 11:10 +0100
      Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-03-15 15:20 +0100
        Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Byungchul Park <byungchul.park@lge.com> - 2016-03-16 06:50 +0100
          Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-16 08:00 +0100
            Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Byungchul Park <byungchul.park@lge.com> - 2016-03-16 08:40 +0100
              Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-16 09:00 +0100
                Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Byungchul Park <byungchul.park@lge.com> - 2016-03-16 11:40 +0100
                Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-17 01:40 +0100
                Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Byungchul Park <byungchul.park@lge.com> - 2016-03-18 06:50 +0100
                Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-18 08:20 +0100
                RE: [RFC][PATCH v4 1/2] printk: Make printk() completely async "byungchul.park" <byungchul.park@lge.com> - 2016-03-18 09:30 +0100
          Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Byungchul Park <byungchul.park@lge.com> - 2016-03-16 08:10 +0100
            Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-16 08:10 +0100
    Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Petr Mladek <pmladek@suse.com> - 2016-03-15 17:00 +0100
      Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-16 03:10 +0100
        Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Byungchul Park <byungchul.park@lge.com> - 2016-03-16 03:20 +0100
          Re: [RFC][PATCH v4 1/2] printk: Make printk() completely async Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-16 03:40 +0100
  [RFC][PATCH v4 2/2] printk: Skip messages on oops Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-03-14 15:20 +0100
    Re: [RFC][PATCH v4 2/2] printk: Skip messages on oops Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-03-17 12:00 +0100

csiph-web