linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: kbuild-all@01.org, Andrew Morton <akpm@linux-foundation.org>,
	Petr Mladek <pmladek@suse.com>, Jan Kara <jack@suse.cz>,
	Tejun Heo <tj@kernel.org>, Calvin Owens <calvinowens@fb.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Andy Lutomirski <luto@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Hurley <peter@hurleysoftware.com>,
	linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Subject: Re: [PATCHv6 3/7] printk: introduce per-cpu safe_print seq buffer
Date: Thu, 22 Dec 2016 08:53:18 +0800	[thread overview]
Message-ID: <201612220823.uoo2cIsr%fengguang.wu@intel.com> (raw)
In-Reply-To: <20161221143605.2272-4-sergey.senozhatsky@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 11567 bytes --]

Hi Sergey,

[auto build test ERROR on linus/master]
[also build test ERROR on next-20161221]
[cannot apply to v4.9]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Sergey-Senozhatsky/printk-use-vprintk_func-in-vprintk/20161222-075616
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 6.2.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=ia64 

Note: the linux-review/Sergey-Senozhatsky/printk-use-vprintk_func-in-vprintk/20161222-075616 HEAD 43ffcdc67ed0e40d3cf6137a37fbe557bfee4fb7 builds fine.
      It only hurts bisectibility.

All error/warnings (new ones prefixed by >>):

   In file included from arch/ia64/include/asm/intrinsics.h:10:0,
                    from arch/ia64/include/asm/bitops.h:18,
                    from include/linux/bitops.h:36,
                    from include/linux/kernel.h:10,
                    from include/linux/list.h:8,
                    from include/linux/preempt.h:10,
                    from kernel/printk/printk_safe.c:18:
   kernel/printk/printk_safe.c: In function 'printk_safe_log_store':
>> kernel/printk/printk_safe.c:82:15: error: 'nmi_message_lost' undeclared (first use in this function)
      atomic_inc(&nmi_message_lost);
                  ^
   arch/ia64/include/uapi/asm/intrinsics.h:60:24: note: in definition of macro 'ia64_fetchadd'
     volatile __typeof__(*(v)) *_v = (v);      \
                           ^
>> arch/ia64/include/asm/atomic.h:75:5: note: in expansion of macro 'ia64_fetch_and_add'
      ? ia64_fetch_and_add(__ia64_aar_i, &(v)->counter) \
        ^~~~~~~~~~~~~~~~~~
>> arch/ia64/include/asm/atomic.h:316:33: note: in expansion of macro 'atomic_add_return'
    #define atomic_add(i,v)   (void)atomic_add_return((i), (v))
                                    ^~~~~~~~~~~~~~~~~
>> arch/ia64/include/asm/atomic.h:318:25: note: in expansion of macro 'atomic_add'
    #define atomic_inc(v)   atomic_add(1, (v))
                            ^~~~~~~~~~
>> kernel/printk/printk_safe.c:82:3: note: in expansion of macro 'atomic_inc'
      atomic_inc(&nmi_message_lost);
      ^~~~~~~~~~
   kernel/printk/printk_safe.c:82:15: note: each undeclared identifier is reported only once for each function it appears in
      atomic_inc(&nmi_message_lost);
                  ^
   arch/ia64/include/uapi/asm/intrinsics.h:60:24: note: in definition of macro 'ia64_fetchadd'
     volatile __typeof__(*(v)) *_v = (v);      \
                           ^
>> arch/ia64/include/asm/atomic.h:75:5: note: in expansion of macro 'ia64_fetch_and_add'
      ? ia64_fetch_and_add(__ia64_aar_i, &(v)->counter) \
        ^~~~~~~~~~~~~~~~~~
>> arch/ia64/include/asm/atomic.h:316:33: note: in expansion of macro 'atomic_add_return'
    #define atomic_add(i,v)   (void)atomic_add_return((i), (v))
                                    ^~~~~~~~~~~~~~~~~
>> arch/ia64/include/asm/atomic.h:318:25: note: in expansion of macro 'atomic_add'
    #define atomic_inc(v)   atomic_add(1, (v))
                            ^~~~~~~~~~
>> kernel/printk/printk_safe.c:82:3: note: in expansion of macro 'atomic_inc'
      atomic_inc(&nmi_message_lost);
      ^~~~~~~~~~

vim +/nmi_message_lost +82 kernel/printk/printk_safe.c

42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  12   * GNU General Public License for more details.
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  13   *
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  14   * You should have received a copy of the GNU General Public License
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  15   * along with this program; if not, see <http://www.gnu.org/licenses/>.
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  16   */
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  17  
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20 @18  #include <linux/preempt.h>
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  19  #include <linux/spinlock.h>
cf9b1106 kernel/printk/nmi.c         Petr Mladek        2016-05-20  20  #include <linux/debug_locks.h>
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  21  #include <linux/smp.h>
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  22  #include <linux/cpumask.h>
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  23  #include <linux/irq_work.h>
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  24  #include <linux/printk.h>
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  25  
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  26  #include "internal.h"
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  27  
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  28  /*
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  29   * printk() could not take logbuf_lock in NMI context. Instead,
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  30   * it uses an alternative implementation that temporary stores
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  31   * the strings into a per-CPU buffer. The content of the buffer
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  32   * is later flushed into the main ring buffer via IRQ work.
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  33   *
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  34   * The alternative implementation is chosen transparently
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  35   * by examinig current printk() context mask stored in @printk_context
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  36   * per-CPU variable.
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  37   *
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  38   * The implementation allows to flush the strings also from another CPU.
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  39   * There are situations when we want to make sure that all buffers
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  40   * were handled or when IRQs are blocked.
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  41   */
c178cb8a kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  42  static int printk_safe_irq_ready;
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  43  
c178cb8a kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  44  #define SAFE_LOG_BUF_LEN ((1 << CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT) -	\
427934b8 kernel/printk/nmi.c         Petr Mladek        2016-05-20  45  			 sizeof(atomic_t) - sizeof(struct irq_work))
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  46  
c178cb8a kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  47  struct printk_safe_seq_buf {
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  48  	atomic_t		len;	/* length of written data */
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  49  	struct irq_work		work;	/* IRQ work that flushes the buffer */
c178cb8a kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  50  	unsigned char		buffer[SAFE_LOG_BUF_LEN];
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  51  };
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  52  
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  53  static DEFINE_PER_CPU(struct printk_safe_seq_buf, safe_print_seq);
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  54  static DEFINE_PER_CPU(int, printk_context);
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  55  
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  56  #ifdef CONFIG_PRINTK_NMI
c178cb8a kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  57  static DEFINE_PER_CPU(struct printk_safe_seq_buf, nmi_print_seq);
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  58  atomic_t nmi_message_lost;
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  59  #endif
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  60  
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  61  /*
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  62   * Add a message to per-CPU context-dependent buffer. NMI and printk-safe
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  63   * have dedicated buffers, because otherwise printk-safe preempted by
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  64   * NMI-printk would have overwritten the NMI messages.
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  65   *
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  66   * The messages are fushed from irq work (of from panic()), possibly,
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  67   * from other CPU, concurrently with printk_safe_log_store(). Should this
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  68   * happen, printk_safe_log_store() will notice the buffer->len mismatch
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  69   * and repeat the write.
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  70   */
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  71  static int printk_safe_log_store(struct printk_safe_seq_buf *s,
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  72  				 const char *fmt, va_list args)
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  73  {
927f128d kernel/printk/printk_safe.c Sergey Senozhatsky 2016-12-21  74  	int add;
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  75  	size_t len;
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  76  
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  77  again:
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  78  	len = atomic_read(&s->len);
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  79  
4a998e32 kernel/printk/nmi.c         Petr Mladek        2016-12-12  80  	/* The trailing '\0' is not counted into len. */
4a998e32 kernel/printk/nmi.c         Petr Mladek        2016-12-12  81  	if (len >= sizeof(s->buffer) - 1) {
b522deab kernel/printk/nmi.c         Petr Mladek        2016-05-20 @82  		atomic_inc(&nmi_message_lost);
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  83  		return 0;
b522deab kernel/printk/nmi.c         Petr Mladek        2016-05-20  84  	}
42a0bb3f kernel/printk/nmi.c         Petr Mladek        2016-05-20  85  

:::::: The code at line 82 was first introduced by commit
:::::: b522deabc6f18e4f938d93a84f345f2cbf3347d1 printk/nmi: warn when some message has been lost in NMI context

:::::: TO: Petr Mladek <pmladek@suse.com>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 45847 bytes --]

  reply	other threads:[~2016-12-22  0:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21 14:35 [PATCHv6 0/7] printk: use printk_safe to handle printk() recursive calls Sergey Senozhatsky
2016-12-21 14:35 ` [PATCHv6 1/7] printk: use vprintk_func in vprintk() Sergey Senozhatsky
2016-12-21 14:36 ` [PATCHv6 2/7] printk: rename nmi.c and exported api Sergey Senozhatsky
2016-12-21 19:45   ` Linus Torvalds
2016-12-22  1:17     ` Sergey Senozhatsky
2016-12-21 14:36 ` [PATCHv6 3/7] printk: introduce per-cpu safe_print seq buffer Sergey Senozhatsky
2016-12-22  0:53   ` kbuild test robot [this message]
2016-12-22  1:18     ` Sergey Senozhatsky
2016-12-22 16:36       ` Petr Mladek
2016-12-21 14:36 ` [PATCHv6 4/7] printk: always use deferred printk when flush printk_safe lines Sergey Senozhatsky
2016-12-21 14:36 ` [PATCHv6 5/7] printk: report lost messages in printk safe/nmi contexts Sergey Senozhatsky
2016-12-23 10:54   ` Petr Mladek
2016-12-23 15:08     ` Sergey Senozhatsky
2016-12-21 14:36 ` [PATCHv6 6/7] printk: use printk_safe buffers in printk Sergey Senozhatsky
2016-12-22  5:31   ` Sergey Senozhatsky
2016-12-22 17:10     ` Petr Mladek
2016-12-23  1:46       ` Sergey Senozhatsky
2016-12-23  9:53         ` Petr Mladek
2016-12-21 14:36 ` [PATCHv6 7/7] printk: remove zap_locks() function Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201612220823.uoo2cIsr%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=calvinowens@fb.com \
    --cc=jack@suse.cz \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peter@hurleysoftware.com \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --subject='Re: [PATCHv6 3/7] printk: introduce per-cpu safe_print seq buffer' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).