public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: John Ogness <john.ogness@linutronix.de>, Petr Mladek <pmladek@suse.com>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	Peter Zijlstra <peterz@infradead.org>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andrea Parri <parri.andrea@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Paul McKenney <paulmck@kernel.org>,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 4/4] printk: use the lockless ringbuffer
Date: Wed, 8 Jul 2020 03:25:00 +0800	[thread overview]
Message-ID: <202007080356.fSb8SLZk%lkp@intel.com> (raw)
In-Reply-To: <20200707145932.8752-5-john.ogness@linutronix.de>

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

Hi John,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linux/master]
[also build test WARNING on linus/master v5.8-rc4 next-20200707]
[cannot apply to pmladek/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/John-Ogness/printk-replace-ringbuffer/20200707-230114
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 9ebcfadb0610322ac537dd7aa5d9cbc2b2894c68
config: arm-randconfig-r014-20200707 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 02946de3802d3bc65bc9f2eb9b8d4969b5a7add8)
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 arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> kernel/printk/printk.c:1146:10: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
                          new_descs_size);
                          ^~~~~~~~~~~~~~
   include/linux/printk.h:338:33: note: expanded from macro 'pr_err'
           printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
                                  ~~~     ^~~~~~~~~~~
   1 warning generated.

vim +1146 kernel/printk/printk.c

  1090	
  1091	void __init setup_log_buf(int early)
  1092	{
  1093		unsigned int new_descs_count;
  1094		struct prb_desc *new_descs;
  1095		struct printk_info info;
  1096		struct printk_record r;
  1097		size_t new_descs_size;
  1098		unsigned long flags;
  1099		char *new_dict_buf;
  1100		char *new_log_buf;
  1101		unsigned int free;
  1102		u64 seq;
  1103	
  1104		/*
  1105		 * Some archs call setup_log_buf() multiple times - first is very
  1106		 * early, e.g. from setup_arch(), and second - when percpu_areas
  1107		 * are initialised.
  1108		 */
  1109		if (!early)
  1110			set_percpu_data_ready();
  1111	
  1112		if (log_buf != __log_buf)
  1113			return;
  1114	
  1115		if (!early && !new_log_buf_len)
  1116			log_buf_add_cpu();
  1117	
  1118		if (!new_log_buf_len)
  1119			return;
  1120	
  1121		new_descs_count = new_log_buf_len >> PRB_AVGBITS;
  1122		if (new_descs_count == 0) {
  1123			pr_err("new_log_buf_len: %lu too small\n", new_log_buf_len);
  1124			return;
  1125		}
  1126	
  1127		new_log_buf = memblock_alloc(new_log_buf_len, LOG_ALIGN);
  1128		if (unlikely(!new_log_buf)) {
  1129			pr_err("log_buf_len: %lu text bytes not available\n",
  1130			       new_log_buf_len);
  1131			return;
  1132		}
  1133	
  1134		new_dict_buf = memblock_alloc(new_log_buf_len, LOG_ALIGN);
  1135		if (unlikely(!new_dict_buf)) {
  1136			pr_err("log_buf_len: %lu dict bytes not available\n",
  1137			       new_log_buf_len);
  1138			memblock_free(__pa(new_log_buf), new_log_buf_len);
  1139			return;
  1140		}
  1141	
  1142		new_descs_size = new_descs_count * sizeof(struct prb_desc);
  1143		new_descs = memblock_alloc(new_descs_size, LOG_ALIGN);
  1144		if (unlikely(!new_descs)) {
  1145			pr_err("log_buf_len: %lu desc bytes not available\n",
> 1146			       new_descs_size);
  1147			memblock_free(__pa(new_dict_buf), new_log_buf_len);
  1148			memblock_free(__pa(new_log_buf), new_log_buf_len);
  1149			return;
  1150		}
  1151	
  1152		prb_rec_init_rd(&r, &info,
  1153				&setup_text_buf[0], sizeof(setup_text_buf),
  1154				&setup_dict_buf[0], sizeof(setup_dict_buf));
  1155	
  1156		prb_init(&printk_rb_dynamic,
  1157			 new_log_buf, order_base_2(new_log_buf_len),
  1158			 new_dict_buf, order_base_2(new_log_buf_len),
  1159			 new_descs, order_base_2(new_descs_count));
  1160	
  1161		logbuf_lock_irqsave(flags);
  1162	
  1163		log_buf_len = new_log_buf_len;
  1164		log_buf = new_log_buf;
  1165		new_log_buf_len = 0;
  1166	
  1167		free = __LOG_BUF_LEN;
  1168		prb_for_each_record(0, &printk_rb_static, seq, &r)
  1169			free -= add_to_rb(&printk_rb_dynamic, &r);
  1170	
  1171		/*
  1172		 * This is early enough that everything is still running on the
  1173		 * boot CPU and interrupts are disabled. So no new messages will
  1174		 * appear during the transition to the dynamic buffer.
  1175		 */
  1176		prb = &printk_rb_dynamic;
  1177	
  1178		logbuf_unlock_irqrestore(flags);
  1179	
  1180		if (seq != prb_next_seq(&printk_rb_static)) {
  1181			pr_err("dropped %llu messages\n",
  1182			       prb_next_seq(&printk_rb_static) - seq);
  1183		}
  1184	
  1185		pr_info("log_buf_len: %u bytes\n", log_buf_len);
  1186		pr_info("early log buf free: %u(%u%%)\n",
  1187			free, (free * 100) / __LOG_BUF_LEN);
  1188	}
  1189	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

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

  reply	other threads:[~2020-07-07 19:26 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07 14:59 [PATCH v4 0/4] printk: replace ringbuffer John Ogness
2020-07-07 14:59 ` [PATCH v4 1/4] crash: add VMCOREINFO macro to define offset in a struct declared by typedef John Ogness
2020-07-07 14:59 ` [PATCH v4 2/4] printk: add lockless ringbuffer John Ogness
2020-07-07 14:59 ` [PATCH v4 3/4] Revert "printk: lock/unlock console only for new logbuf entries" John Ogness
2020-07-08 14:34   ` Petr Mladek
2020-07-09  1:20   ` Sergey Senozhatsky
2020-07-07 14:59 ` [PATCH v4 4/4] printk: use the lockless ringbuffer John Ogness
2020-07-07 19:25   ` kernel test robot [this message]
2020-07-08 13:18     ` John Ogness
2020-07-08 14:35   ` Petr Mladek
2020-07-08 19:24   ` kernel test robot
2020-07-09  7:14   ` [printk] 18a2dc6982: ltp.kmsg01.fail kernel test robot
2020-07-09  8:33     ` Sergey Senozhatsky
2020-07-09 10:14       ` John Ogness
2020-07-09 10:59         ` Petr Mladek
2020-07-09 11:13           ` Petr Mladek
2020-07-09 11:17             ` John Ogness
2020-07-09 12:25               ` Petr Mladek
2020-07-09 13:07                 ` Sergey Senozhatsky
2020-07-09 14:41                   ` Petr Mladek
2020-07-08 15:20 ` [PATCH v4 0/4] printk: replace ringbuffer Petr Mladek
2020-07-09  7:03   ` John Ogness
2020-07-10  9:11     ` Petr Mladek
2020-07-10  9:52       ` John Ogness
2020-07-10 14:15         ` Petr Mladek
2020-07-14  2:56         ` 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=202007080356.fSb8SLZk%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=john.ogness@linutronix.de \
    --cc=kbuild-all@lists.01.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=parri.andrea@gmail.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=rostedt@goodmis.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=tglx@linutronix.de \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox