Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1098108rwe; Thu, 1 Sep 2022 12:29:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR50YUGufUt/EnMDu9JvA0ygGUAj4MIg1ILcJeM3LoNtivagnGuKA8BGZaz45exkznwbEPn3 X-Received: by 2002:aa7:d292:0:b0:447:f99d:8b9b with SMTP id w18-20020aa7d292000000b00447f99d8b9bmr25030558edq.29.1662060556859; Thu, 01 Sep 2022 12:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662060556; cv=none; d=google.com; s=arc-20160816; b=fzcFvWzM62h+077qXDXf8mcVZgM++7V8z3Jn8TWNsA6iqcchMTByqiLZy4ms/rAgxB ON3bi8uT2xIgF6QSsXLs1Yo36CSgblc9tXHiQdZOm/A5emVfvwGkxBpc51sOmz8jrRrn jkasW9v9IB4ieZxnTJfl/5z+vE1ducDzlo+X+D5GFgLmkUf6xULStThchnlxBHveBBWx Pi2y0LRfAnQTEjNxhqtm/bt0yalfvGt48Ye8mPLgeW5gxKO8AJc1eRjcNWTITeE6sfJT kOxgBAEtyTdb1ueWtPForE6BEdRWosErUpiIh7gbgEBq5n5boEMYOblPaVziBnQ2txp8 gk+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=UFcrc/UJOT2kK6zHMZQySOwNe/Miq+xxPRe6+0lgG/k=; b=W0lqekRqhww01U1Y4QUE+LtsLB+SrsOZWhDsSpuuKDTuT/yDp/Mk2Q61wG7AVwrPYW R8p3VFHHz1nBL6tTBoNSVK9BKo/T+cMjXCDiLUY38S+evDxZk3n0mcle9wQkNeu25YzR UmHrtJuNsoGKiIeAaBP3eVtALL8ofrpyp2YIUqO1d9ZYXxckNMFhTYmhR15sB5Rn505M Fsm/OV6ciZid2LpvfshOUgqCMFuRIeyLJPRdjwCK5o4V8Zt/OUs42cHNOnf9W5NGkD+T JpeD0+oqC6YzEVym3zLq7WhtuY2fP5E3se5h19EIxaTw5PbhkIQt4NFxHxVvHtDzagXk 1ZSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=QzrCF2Vv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x22-20020a170906b09600b0073d71079711si62569ejy.491.2022.09.01.12.28.50; Thu, 01 Sep 2022 12:29:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=QzrCF2Vv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233680AbiIATSr (ORCPT + 99 others); Thu, 1 Sep 2022 15:18:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233919AbiIATSe (ORCPT ); Thu, 1 Sep 2022 15:18:34 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D2CB8983A for ; Thu, 1 Sep 2022 12:18:32 -0700 (PDT) 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: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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