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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A096AECAAD8 for ; Tue, 30 Aug 2022 07:11:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E6CD06B0073; Tue, 30 Aug 2022 03:11:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E1C476B0074; Tue, 30 Aug 2022 03:11:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CE3D8940007; Tue, 30 Aug 2022 03:11:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id BC74B6B0073 for ; Tue, 30 Aug 2022 03:11:05 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 693C71201B3 for ; Tue, 30 Aug 2022 07:11:05 +0000 (UTC) X-FDA: 79855387290.08.B974E0C Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf26.hostedemail.com (Postfix) with ESMTP id 02112140018 for ; Tue, 30 Aug 2022 07:11:04 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DE37B1F8C2; Tue, 30 Aug 2022 07:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1661843463; 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=NZDxjQIpg4DBs1cEPk2WSGludET2sKuRoYH6J2MJE4o=; b=FjG0sg5qq8u3wKL6301lQti6othz5KHsUMe+SGX65ANwC0vrkSnEJrV2J/c8N5mKuefp8A cKVnAis24J0Ppp+9p72/HAEuraohVKoE8oDZsbowkZYvZA4xkQdbCEXHjD9KaO15eeydNy lxGr8lqOZITedosgWhzhp+q5uw/bfgA= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C310113ACF; Tue, 30 Aug 2022 07:11:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id riUGLAe4DWPBLgAAMHmgww (envelope-from ); Tue, 30 Aug 2022 07:11:03 +0000 Date: Tue, 30 Aug 2022 09:11:03 +0200 From: Michal Hocko To: Dan Carpenter Cc: linux-mm@kvack.org Subject: Re: [bug report] mm: reduce noise in show_mem for lowmem allocations Message-ID: References: <20220830070205.GQ2030@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220830070205.GQ2030@kadam> ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=FjG0sg5q; spf=pass (imf26.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661843465; a=rsa-sha256; cv=none; b=KoeYCcWBzu6yn+0yaCJtB4qOSgF/VoJCmTuegD2Y/KSmOpmPITEegTbM9o66lYihRL5V+J O5JeRxg8Omrn8qcPtHZJEgJv1aVtDcdM5kW/BWuDWB8BQSdJJkXwauVbj0mkhjZNSpQJPh 2vbo/bas+AcnEAyMwjecu1WvB+myg8Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661843465; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=NZDxjQIpg4DBs1cEPk2WSGludET2sKuRoYH6J2MJE4o=; b=0kHWpFA/8f94xAHLxYtmqNThyKdbQDOFWqXDi+X6nvoVttT5U1EsCIpWSVjNPVPtR2R+vT ouJM7/nuRGeaVq8wMp5YMinQouT+Hbu1jSA9RtXNknnOniBcVvMzbc0bY8xOJWgQM8lGJm VohzW4bYHJ9dbnicUBWHQ5x53nAms+8= X-Rspamd-Queue-Id: 02112140018 X-Rspam-User: Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=FjG0sg5q; spf=pass (imf26.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.29 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Rspamd-Server: rspam02 X-Stat-Signature: y6gafx5a6pkr3hr3r3uaimibxxc515k9 X-HE-Tag: 1661843464-168227 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 30-08-22 10:02:05, Dan Carpenter wrote: > On Tue, Aug 30, 2022 at 08:46:58AM +0200, Michal Hocko wrote: > > On Tue 30-08-22 09:30:26, Dan Carpenter wrote: > > > Hello Michal Hocko, > > > > > > The patch e8fedfea3dea: "mm: reduce noise in show_mem for lowmem > > > allocations" from Aug 23, 2022, leads to the following Smatch static > > > checker warning: > > > > > > kernel/panic.c:190 panic_print_sys_info() > > > warn: sleeping in atomic context > > > > What is this warning saying? > > > > This is a Smatch warning. > > > > 189 if (panic_print & PANIC_PRINT_MEM_INFO) > > > --> 190 show_mem(0, NULL, GFP_HIGHUSER_MOVABLE); > > > ^^^^^^^^^^^^^^^^^^^^ > > > This obviously seems very deliberate and a lot of weird stuff happens > > > during panic(). But the panic() function disables preemption so > > > shouldn't this be GFP_ATOMIC? GFP_HIGHUSER_MOVABLE has __GFP_RECLAIM > > > and triggering swap during a panic seems bad. > > > > This function shouldn't ever be allocating any memory. The flag is > > solely to infer which memory zones should be displayed. It acts as a > > filter. Is it possible that the checker misinterprets the parameter's > > meaning? > > Ah. Yes. Smatch sees every gfp_t as a sleep/no sleep marker. I > didn't realize it wasn't used like that here. Thanks! OK, fair enough and I can actually see how that can turn out into a real allocation in a distant future when the original intention has been lost in the past. Let me re-open the discussion for that patch and CC you there. Thanks for the report. -- Michal Hocko SUSE Labs