Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4030435rdh; Tue, 28 Nov 2023 09:54:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IElVJCLOoiIMK2KUNmVA3SlrW63Dooht7ekph4DehXQXQDJxE27SKj1ZcM6SKtsnqgnxW3s X-Received: by 2002:a05:6a00:1ca8:b0:6c3:78a4:223 with SMTP id y40-20020a056a001ca800b006c378a40223mr15695046pfw.18.1701194097680; Tue, 28 Nov 2023 09:54:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701194097; cv=none; d=google.com; s=arc-20160816; b=lwujYBE4DCxw+O+K5QpAtuXOESwwPxMoHyQHiz27WcN+b2q9ZG9R543FRlpiWRaLTw Ewy/WkCa26nZhA4otOJO9UCo9zzoYEnEOLMpuNfLuRwr0Q+uG7BhbdC7n+m3FglBUlvb 3ukR3oti2OkYrTYsHB/MLncz9cpuPdIhA9qWGPV5hCC0dUUN35ZpfhunmkpbB9YAWK5h X/0bI5AimjqrZF0/DKezkxKLY5Wiafn8eNAekrIYWy3PTXbj1V3BDMw99soOEeMo0NQC I2aoMayLW20YPKCM1hsT1TgRU1o0R7+G+GspfaH1QbDC/SIYpxLFoR0PiHBNcP1arznJ 1Hng== 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:dkim-signature:date; bh=A+pO7DYA9VT1hzqD2ijKa3011VeZdg5NxmlmwJJE8x0=; fh=x3uE3UNq7Ypln02+ediyb89i23aAlSwDHXCVslOqUUM=; b=oERud1Q3t8+lsyvKjqODgkiSS1XKeIVBooqf3fytjjzjJjn5g4pid8mKDSPjcRHOkb w7krQaw0Q0xFct4F7X8pcpaF3KJcFZA5jplUnmjLg2t7t9xd38V6o4NY8baDufbA5PfX LKtCiWb3kvXR+qKpN72yBWPse3tnzYDNwb1HtRuUv1nf8/FfU+DaD6wYBq52enKs9+zQ YLef2/UPuTelwuWPG0EWyHCe8kRqB3H1q1OiCUn9/sJ30z+XV+Ucive0/qaSnwkyL+YH 1ml38ZkUMsjbecy3vC2IN2kYInFZZq/1Sstw3d38rs7PvgmiAiKsAB39hGi0nlSM1jsZ oRQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=DnK9rrKx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id o6-20020a056a0015c600b006c33a1bdf92si13090152pfu.307.2023.11.28.09.54.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 09:54:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=DnK9rrKx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 95897806D811; Tue, 28 Nov 2023 09:54:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345809AbjK1Rym (ORCPT + 99 others); Tue, 28 Nov 2023 12:54:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345748AbjK1Ryi (ORCPT ); Tue, 28 Nov 2023 12:54:38 -0500 Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [IPv6:2001:41d0:1004:224b::bc]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2506F1998 for ; Tue, 28 Nov 2023 09:54:44 -0800 (PST) Date: Tue, 28 Nov 2023 12:54:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1701194082; 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=A+pO7DYA9VT1hzqD2ijKa3011VeZdg5NxmlmwJJE8x0=; b=DnK9rrKxuNVA9XQur6wR6wNty7+/ZeYFP8CiQ2aCntiJKDSHXqEgoDFVgRZbAbuZza5JYz c5yJn9IITPXcNRXHcRn4zr6tQCbnwwT6/h5WzN+eGe3DPL4vMjmZFSwaHeLDocVoK9t67T 1njDT3MlHARAsO4+ET4wot2Kf8eQhbQ= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Michal Hocko Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Qi Zheng , Roman Gushchin Subject: Re: [PATCH 4/7] mm: Centralize & improve oom reporting in show_mem.c Message-ID: <20231128175439.6jarreie7cay74fn@moria.home.lan> References: <20231122232515.177833-1-kent.overstreet@linux.dev> <20231122232515.177833-5-kent.overstreet@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 28 Nov 2023 09:54:55 -0800 (PST) On Tue, Nov 28, 2023 at 11:07:18AM +0100, Michal Hocko wrote: > On Wed 22-11-23 18:25:09, Kent Overstreet wrote: > [...] > > 00177 Shrinkers: > > 00177 super_cache_scan: objects: 127 > > 00177 super_cache_scan: objects: 106 > > 00177 jbd2_journal_shrink_scan: objects: 32 > > 00177 ext4_es_scan: objects: 32 > > 00177 bch2_btree_cache_scan: objects: 8 > > 00177 nr nodes: 24 > > 00177 nr dirty: 0 > > 00177 cannibalize lock: 0000000000000000 > > 00177 > > 00177 super_cache_scan: objects: 8 > > 00177 super_cache_scan: objects: 1 > > It would be really great to provide an example on how these numbers are > useful for the oom evaluation. I should've posted an example from the end of the patch series; I'll do that later today. > [...] > > @@ -423,4 +426,21 @@ void __show_mem(unsigned int filter, nodemask_t *nodemask, int max_zone_idx) > > #ifdef CONFIG_MEMORY_FAILURE > > printk("%lu pages hwpoisoned\n", atomic_long_read(&num_poisoned_pages)); > > #endif > > + > > + buf = kmalloc(4096, GFP_ATOMIC); > > I really do not think we want to allow allocations from the OOM context. > Is there any reason why this cannot be a statically allocated buffer? You've made this claim before without ever giving any reasoning behind it. It's GFP_ATOMIC; it has to work from _interrupt_ context, OOM context is fine. And no, we don't want to burn 4k on a static buffer that is almost never used; people do care about making the kernel run on small systems.