From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D45D0C47082 for ; Tue, 8 Jun 2021 13:48:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7F5746108D for ; Tue, 8 Jun 2021 13:48:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7F5746108D Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 019166B0036; Tue, 8 Jun 2021 09:48:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F0AE36B006E; Tue, 8 Jun 2021 09:48:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DAB3E6B0070; Tue, 8 Jun 2021 09:48:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0191.hostedemail.com [216.40.44.191]) by kanga.kvack.org (Postfix) with ESMTP id A9BED6B0036 for ; Tue, 8 Jun 2021 09:48:25 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 4AB93180AD807 for ; Tue, 8 Jun 2021 13:48:25 +0000 (UTC) X-FDA: 78230686170.29.B8A6C14 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf02.hostedemail.com (Postfix) with ESMTP id 2F22E4202A16 for ; Tue, 8 Jun 2021 13:48:23 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 56F4F219B0; Tue, 8 Jun 2021 13:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1623160103; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Hb0+q30Gnp7DrPWOKT7XlTLbXFkLxN7BDKSfDeblI9U=; b=rSqDwP5fROQpQw3tt1jtvGahQY7+vrm4nVZD6ybGz0s6PYAx5CYSr9EdXAsJWgaRYubcxx L8vYL1NQsJ83CREDRrBNgPjcQ1MmEmJRh/04lrFQyhWcrZjGY0UJ2fLkOGG6b5UC/VS6Jl G842nrMxQVa1BGRbE+PAjgVONTvdR+0= Received: from suse.cz (unknown [10.100.216.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id EBA28A3B83; Tue, 8 Jun 2021 13:48:22 +0000 (UTC) Date: Tue, 8 Jun 2021 15:48:22 +0200 From: Petr Mladek To: kernel test robot Cc: John Ogness , kbuild-all@lists.01.org, Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Andrew Morton , Linux Memory Management List , Dmitry Safonov <0x7f454c46@gmail.com>, Peter Zijlstra , Marco Elver Subject: Re: [PATCH next v2 1/2] dump_stack: move cpu lock to printk.c Message-ID: References: <20210607200232.22211-2-john.ogness@linutronix.de> <202106081055.UgUlUS1Z-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202106081055.UgUlUS1Z-lkp@intel.com> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 2F22E4202A16 X-Stat-Signature: j8tpodcetjrhndspbdixdb3ownebh97d Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=rSqDwP5f; dmarc=pass (policy=quarantine) header.from=suse.com; spf=pass (imf02.hostedemail.com: domain of pmladek@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=pmladek@suse.com X-HE-Tag: 1623160103-771233 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue 2021-06-08 10:43:46, kernel test robot wrote: > Hi John, > > I love your patch! Perhaps something to improve: > > [auto build test WARNING on next-20210607] > > url: https://github.com/0day-ci/linux/commits/John-Ogness/introduce-printk-cpu-lock/20210608-040454 > base: 7f09e895a7f3e0af63bf9ec6c7c22893ec7e6c8e > config: mips-randconfig-r036-20210607 (attached as .config) > compiler: mips-linux-gcc (GCC) 9.3.0 > 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 > # https://github.com/0day-ci/linux/commit/136bcc2980e636b2ae156ca63fbe95c713e44c1b > git remote add linux-review https://github.com/0day-ci/linux > git fetch --no-tags linux-review John-Ogness/introduce-printk-cpu-lock/20210608-040454 > git checkout 136bcc2980e636b2ae156ca63fbe95c713e44c1b > # save the attached .config to linux build tree > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips > > If you fix the issue, kindly add following tag as appropriate > Reported-by: kernel test robot > > All warnings (new ones prefixed by >>): > > lib/dump_stack.c: In function 'dump_stack_lvl': > >> lib/dump_stack.c:107:2: warning: 'lock_flag' is used uninitialized in this function [-Wuninitialized] > 107 | printk_cpu_unlock_irqrestore(lock_flag, irq_flags); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Interesting. I am curious that it does not complain also about irq_flags. But it is possible the it reports only the first problem. Anyway, we will likely need to do some trickery via #define to tell the compiler that the value is set. I mean to do similar thing as: #define raw_local_irq_save(flags) \ do { \ typecheck(unsigned long, flags); \ flags = arch_local_irq_save(); \ } while (0) In our case, it might look like: #define printk_cpu_lock_irqsave(lock_nested, irq_flags) \ do { \ local_irq_save(irq_flags); \ typecheck(bool, lock_nested); \ lock_nested = __printk_cpu_lock(irq_flags); \ } while (0) then we would need to do in __prink_cpu_lock(unsigned long irq_flags) } else { local_irq_restore(irq_flags); /* * Wait for the lock to release before jumping to cmpxchg() * in order to mitigate the thundering herd problem. */ do { cpu_relax(); } while (atomic_read(&printk_cpulock_owner) != -1); local_irq_save(irq_flags) goto retry; } Best Regards, Petr