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 1EFF4ECAAD1 for ; Thu, 1 Sep 2022 19:18:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 97D5F80045; Thu, 1 Sep 2022 15:18:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 92BCA8000D; Thu, 1 Sep 2022 15:18:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 81C8180045; Thu, 1 Sep 2022 15:18:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 73B5B8000D for ; Thu, 1 Sep 2022 15:18:32 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 44DE9810C4 for ; Thu, 1 Sep 2022 19:18:32 +0000 (UTC) X-FDA: 79864478064.01.AFE913A Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf29.hostedemail.com (Postfix) with ESMTP id DAAA3120082 for ; Thu, 1 Sep 2022 19:18:31 +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-out1.suse.de (Postfix) with ESMTPS id 90CAE33755; Thu, 1 Sep 2022 19:18:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1662059910; 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=UFcrc/UJOT2kK6zHMZQySOwNe/Miq+xxPRe6+0lgG/k=; b=QzrCF2VvdUGGEdAHTIYe+W8NaZ02hQLHwMvfPQVoUSuUDjN0RbEvycquJq6nki301gknLP z5xDtdb8MxPFGkyfe4df8UB8Ym4ieIT3yRshjHzu5oKl1v2Qe0NWhNxJDTKIvJQAMkPXgV FxtluHEcLtfnCR6sM0z7ZXfyJhfzHbQ= 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 721C313A79; Thu, 1 Sep 2022 19:18:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id LYfVGIYFEWOEWAAAMHmgww (envelope-from ); Thu, 01 Sep 2022 19:18:30 +0000 Date: Thu, 1 Sep 2022 21:18:29 +0200 From: Michal Hocko To: Vlastimil Babka Cc: linux-mm@kvack.org, Christoph Hellwig , Andrew Morton , Mel Gorman , Johannes Weiner , Dan Carpenter , LKML Subject: Re: [RFC PATCH] mm: reduce noise in show_mem for lowmem allocations Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662059911; 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=UFcrc/UJOT2kK6zHMZQySOwNe/Miq+xxPRe6+0lgG/k=; b=SWOz+l3WCup0Qt/j7pOLXYWMs2a/Rkhg6zgyMOn5Fvq75BD7R1FDMYlmLvQdM5A2R/NukE C/0PZWjINLHE7Wg4rllAcn/WdtEa0SiyjD5wS0a3rcKydqD5sjsav4xhXOICpcBAMHVntm HNqaN3yYVzDMI36efvL7U5FxcacSh4g= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=QzrCF2Vv; spf=pass (imf29.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 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=1662059912; a=rsa-sha256; cv=none; b=CXDWZSF53MZXbGWT0zGq3XmCrUGEaCcnlUP3+Dcx621YR+UEXQLSZNSjn4Re7MiogkWoO7 wRIDYO71lHHKJ6USZsULk22T5qAvBqgzMiLWWSHj+VAMfS+wHeak6pnV7SScO44qZpe8zz cxie4WDzToCCC+TRBBRSFu6ePvemaQQ= X-Stat-Signature: zxzufrm1ciyw9466xe15sugrpzr4rukb X-Rspamd-Queue-Id: DAAA3120082 Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=QzrCF2Vv; spf=pass (imf29.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Rspamd-Server: rspam12 X-Rspam-User: X-HE-Tag: 1662059911-815102 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 Thu 01-09-22 16:14:39, Vlastimil Babka wrote: > On 8/30/22 09:34, Michal Hocko wrote: > > [Cc Dan] > > Dan has brought up[1] that the use of gfp mask has confused his static > > analyzer which assumes that GFP_HIGHUSER_MOVABLE implies a sleeping > > allocation and that wouldn't be a great idea from the panic path. I > > would add that most callers of this function would be really bad to > > allocate. > > > > The report itself is a false positive but it made me think a bit about > > this. Even if the check is too simplistic I guess it resembles how many > > developers are thinking (including me). If I see GFP_HIGHUSER_MOVABLE or > > GF_KERNEL I automatically assume a sleeping allocation down the road. > > And who know somebody might add one in the future even into show_mem > > because the gfp parameter would be too tempting to not (ab)use. > > > > My original intention was to use a natural allocation speak but this can > > backfire so maybe it would be better to give the argument its real > > meaning and that is the high_zone_idx. This is cryptic for code outside > > of MM but that is not all that many callers and we can hide this fact > > from them. In other words does the thing below looks better (incremental > > for illustration, I will make it a proper patch if yes)? > > Yeah, looks better to me this way. Thanks! Thanks for looking into this. Unless somebody objects I will send a consolidated patch early next week. -- Michal Hocko SUSE Labs