Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3728893rdh; Tue, 28 Nov 2023 02:07:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFSaik1rcLRLb7/trOzpeCJQ0WkGIIQlg0yC7546PF89aOyGGgZz/RNWW+WwWJzwn8D8GT1 X-Received: by 2002:a17:902:c24c:b0:1cf:a126:e7f3 with SMTP id 12-20020a170902c24c00b001cfa126e7f3mr11489170plg.35.1701166052924; Tue, 28 Nov 2023 02:07:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701166052; cv=none; d=google.com; s=arc-20160816; b=PT4zDM0BzbLdPsjx6DzVGMM+2bTGIPW03q02JNUDLzQsjIZMiUxqgaAwcq+daCwcVt i9/fBtuRXK7wUPCyiZKAopVX+zfUnHQudhUv9Oj4gqleiL79sDK516cx/taYB4qe3ZWQ qTk/xh/K4JKtyWYjXKki1+z8p8Qp7iEweJDUzFt8uB7MqISflje1QYqOGJx6syrVgC3q HjO1QYjo+oOSi/kKVbMKuZNg/1fIl7Ehx8f0X/PY/TsaqAfbbKl5nge5UHfOy0il4PMa 1H2OBI0ALIXl4jw0G/PT49InM78Ixavrjwjnw1A05bS9GPeUjR7hwRbfsaj5T9i9DBOp bsZQ== 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; bh=rFmFM0er0UxJy+JeCyImT+8F7UpJNkQ5Zg31n6xPwHM=; fh=NBAzKwlMiGDYGix5qkNa9v/1v2BbnGWFRQcXjy0kDP0=; b=sQHPXVnP5LIVInlHd2W0K7O9VV1DzB+DufW6QPxUu+y3joEMCpKYZDErJIMbJVDMJL FTgFQ0WNeQOr673S4+u1zipo+hqgXQ26WrxTHD1Qs9ivmHh5LysETng/Xvgg7mniFAVd bdlxlQwMkMr4Lo+zfZw5say77apq77Ijhge0bcgVf+58vJbGXYBLGbk9kibdZnV00OHh cCGnauAOVMRCb3OANo3OOuCvh6Cmzg6Zu5UlRMRrva+A6Q3XlTnsxc9F7zjT0ZGrx0lm k6WGTFLQVG0PLvfhxWEYxZc4pzXWULtD1xfdr60iE7s7WM07MKWWfQ13SiQfmBEsrfa7 sc+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id u1-20020a17090341c100b001cfcd31448fsi4588555ple.581.2023.11.28.02.07.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 02:07:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 8C734806AFC3; Tue, 28 Nov 2023 02:07:30 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344044AbjK1KHP (ORCPT + 99 others); Tue, 28 Nov 2023 05:07:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343991AbjK1KHO (ORCPT ); Tue, 28 Nov 2023 05:07:14 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D8231B8 for ; Tue, 28 Nov 2023 02:07:20 -0800 (PST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0C9862198D; Tue, 28 Nov 2023 10:07:19 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E3AD51343E; Tue, 28 Nov 2023 10:07:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id zBOZNNa7ZWXyagAAD6G6ig (envelope-from ); Tue, 28 Nov 2023 10:07:18 +0000 Date: Tue, 28 Nov 2023 11:07:18 +0100 From: Michal Hocko To: Kent Overstreet 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: 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: <20231122232515.177833-5-kent.overstreet@linux.dev> X-Spamd-Bar: +++++++++++++++ Authentication-Results: smtp-out1.suse.de; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=suse.com (policy=quarantine); spf=fail (smtp-out1.suse.de: domain of mhocko@suse.com does not designate 2a07:de40:b281:104:10:150:64:97 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspamd-Server: rspamd2 X-Spamd-Result: default: False [15.00 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_FAIL(1.00)[-all]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.987]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_FIVE(0.00)[6]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_THREE(0.00)[3]; DMARC_POLICY_QUARANTINE(1.50)[suse.com : No valid SPF, No valid DKIM,quarantine]; MX_GOOD(-0.01)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(2.20)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.10)[65.54%] X-Spam-Score: 15.00 X-Rspamd-Queue-Id: 0C9862198D X-Spam: Yes X-Spam-Status: No, score=-0.8 required=5.0 tests=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 groat.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 (groat.vger.email [0.0.0.0]); Tue, 28 Nov 2023 02:07:30 -0800 (PST) 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. [...] > @@ -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? > + if (buf) { > + struct seq_buf s; > + > + printk("Unreclaimable slab info:\n"); > + seq_buf_init(&s, buf, 4096); > + dump_unreclaimable_slab(&s); > + printk("%s", seq_buf_str(&s)); > + > + printk("Shrinkers:\n"); > + seq_buf_init(&s, buf, 4096); > + shrinkers_to_text(&s); > + printk("%s", seq_buf_str(&s)); > + > + kfree(buf); > + } > } -- Michal Hocko SUSE Labs