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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 E3BC2C48BDF for ; Thu, 10 Jun 2021 13:26:20 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 72054613FF for ; Thu, 10 Jun 2021 13:26:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72054613FF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D054B6B0036; Thu, 10 Jun 2021 09:26:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CB4DE6B006E; Thu, 10 Jun 2021 09:26:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B557F6B0070; Thu, 10 Jun 2021 09:26:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0143.hostedemail.com [216.40.44.143]) by kanga.kvack.org (Postfix) with ESMTP id 83B686B0036 for ; Thu, 10 Jun 2021 09:26:19 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 14FB687DA for ; Thu, 10 Jun 2021 13:26:19 +0000 (UTC) X-FDA: 78237888078.28.DA620DC Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf13.hostedemail.com (Postfix) with ESMTP id D308BE000254 for ; Thu, 10 Jun 2021 13:26:13 +0000 (UTC) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1623331576; h=from:from:reply-to:subject:subject: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=bG6fzWWIt6qWZK3IBMGs/xYJLoLBG31sTm79ZD9P7YY=; b=k4SQeB1X5HBaHDvB7DhC7HL0Y5KOiUtZm6Ul81+JJ1o4AVH6PVUVUkQEhNUcSFwKrL02ft RUkL1XvW44I2L1Y/mim/x7Qe0uiSy04p9vGV31W0aN0NUsBKraodwcXg4fljQOu8jpz7b9 zDp5RglFp/CFkp9C7kUQF6NnQ2zk62T51WTGyFZDhhL6pNb/upA7X8eTIp/7qIkSMdcJ5t NSj5/02QLGSIGIqmawtUekBzn07DbkaOvN1j4HbpEvZKF7YpIRSiNWiNSyNDrSxpqc9bw/ JmAObtNSpSmVNIZmCeYS0IWdkA4UONMmJFlTD+acORvSy/k6IkR9MrJWY2RWEA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1623331576; h=from:from:reply-to:subject:subject: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=bG6fzWWIt6qWZK3IBMGs/xYJLoLBG31sTm79ZD9P7YY=; b=AozmGgxT0vXnF1xVNnOTPOz4PZMajcAgl1LMBdSLjxVJ1mEBJjnKK7k+ZIH4XUtglTHra7 81QjBefDF5XG8vAA== To: Petr Mladek , kernel test robot Cc: 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 In-Reply-To: References: <20210607200232.22211-2-john.ogness@linutronix.de> <202106081055.UgUlUS1Z-lkp@intel.com> Date: Thu, 10 Jun 2021 15:26:15 +0200 Message-ID: <877dj1u9zc.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=k4SQeB1X; dkim=pass header.d=linutronix.de header.s=2020e header.b=AozmGgxT; spf=pass (imf13.hostedemail.com: domain of john.ogness@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=john.ogness@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: D308BE000254 X-Stat-Signature: ehm1yznjueyiu93coidgu749sz6w9jbu X-HE-Tag: 1623331573-746669 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 2021-06-08, Petr Mladek wrote: >> 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. Strangely enough, if I set a value for @lock_flag, it is happy and does not complain about @irq_flags. Probably a compiler oversight. > Anyway, we will likely need to do some trickery via #define to tell > the compiler that the value is set. This is on ARCH=mips and !CONFIG_SMP. So the value is _not_ getting set. (The static inline function does nothing.) By changing printk_cpu_unlock_irqrestore() to use pointers: static inline void printk_cpu_unlock_irqrestore(bool *lock_flag, unsigned long *irq_flags) then the warning disappears. Indeed, by not using pointers on unlock, technically data is copied that was never initialized. I thought maybe the compiler would optimize all that out, but it seems that it does not. I have no problems using pointers for unlock(). It was strange using pointers for lock(), but not for unlock() anyway. Or would you prefer something else? John Ogness