Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3725831rdh; Tue, 28 Nov 2023 02:01:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2Talv9sRuSqZyqjuivbahCDY52RevWQugLyAWCOh3i6TknGPy7auxPRepLTPWx61XaSfV X-Received: by 2002:a05:6a21:a5a0:b0:17a:4871:63fd with SMTP id gd32-20020a056a21a5a000b0017a487163fdmr24759712pzc.0.1701165703836; Tue, 28 Nov 2023 02:01:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701165703; cv=none; d=google.com; s=arc-20160816; b=jaDUSvcOiSfGHX1AdGGnGEtU6DzwHwK0L/5fMq45UUNridNWETAZZN0j71dEK1ie5i gDufeqtJT+EJLDyjRaKHhGeNyn7DGmBvdZA5bNMydQ75b72yvvXiC5Q9SNdx9um9PGWi UZoxRpqYFlqvR2YnV5pwFaEHOp0CGA8K/wUH7DI+no9RYGXygxIVhN3LCbxbxp2rD4Q0 ypqF1La6MqGqwEgw/nbOKeFiPaJ2tehoWaUn4xJZ4+2ZpI3M2aZWRb7KIDIP1q7KgzM2 xHzPiOeoeMB+Qu61pldP7ce6Id0eZEPC0XNZZlDDXE5Sv8Z4NA7uktPz4RN1v0d/55Su cm6Q== 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=b0MjlIE5+pSQxzqkC8I7wOjiha8vGuuRwI00+7CVoNo=; fh=NBAzKwlMiGDYGix5qkNa9v/1v2BbnGWFRQcXjy0kDP0=; b=0j5zPlJHIhnpN7ikD9LpFYWLyvzcvXVwm4QmbAiDENv7L5RP3hl4bpPJkTyqA1cLGD VUG0Y/5t51bbo1AYTjOV0xvh1xSArdJJ7stKwbiJX2V9O79tlelye1bYpbPIQxfy9JGy Bg8HQRRNVGqPf5p9Bt2vAPz+7uaTkAts/GuZl3Ae2X+5X1twqj2Xxo6l/VqzZP0BAhu+ px+ha86+jgDNyTKSDkLyyjPDJPVRymlOUW684kP0ZcPOayXNDC7sZCiOD0hpXSDGe2EC cZjIG//zAEPaUQo3mWzH8g51Pi951apBY4OmlYhp5oCNG83nFAo94nyuG1fGypP9lrVp Cz1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="Std/ba/o"; 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=pass (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 m18-20020a62f212000000b006cd944e84fesi3061914pfh.96.2023.11.28.02.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 02:01:43 -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; dkim=pass header.i=@suse.com header.s=susede1 header.b="Std/ba/o"; 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=pass (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 919AE806895E; Tue, 28 Nov 2023 02:01:28 -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 S1343751AbjK1KBP (ORCPT + 99 others); Tue, 28 Nov 2023 05:01:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230044AbjK1KBN (ORCPT ); Tue, 28 Nov 2023 05:01:13 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B55F1DE for ; Tue, 28 Nov 2023 02:01:18 -0800 (PST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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 623C521904; Tue, 28 Nov 2023 10:01:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1701165677; 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=b0MjlIE5+pSQxzqkC8I7wOjiha8vGuuRwI00+7CVoNo=; b=Std/ba/oUYZ6nwnpUkxVkPN1odNxP+SlbOGfRn+ACrFB2uDr9iQ8DQO8/siTX0+jxulPC4 pQMkOQNZCAVww7AnkLJz2LTe9dTkOQV1UI72px6ev5OANzWzrhf7jduONBUv/RZtFgNujo a+EYPv8x3pS3AtfxzboEQnz/9l/VNW4= 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 42B1D1343E; Tue, 28 Nov 2023 10:01:17 +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 0sw8DW26ZWU4aQAAD6G6ig (envelope-from ); Tue, 28 Nov 2023 10:01:17 +0000 Date: Tue, 28 Nov 2023 11:01:16 +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 2/7] mm: shrinker: Add a .to_text() method for shrinkers Message-ID: References: <20231122232515.177833-1-kent.overstreet@linux.dev> <20231122232515.177833-3-kent.overstreet@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231122232515.177833-3-kent.overstreet@linux.dev> Authentication-Results: smtp-out1.suse.de; none X-Spam-Score: 3.24 X-Spamd-Result: default: False [3.24 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; BAYES_SPAM(3.84)[96.50%]; TO_DN_SOME(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FUZZY_BLOCKED(0.00)[rspamd.com]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[] 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 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:01:28 -0800 (PST) On Wed 22-11-23 18:25:07, Kent Overstreet wrote: [...] > +void shrinkers_to_text(struct seq_buf *out) > +{ > + struct shrinker *shrinker; > + struct shrinker_by_mem { > + struct shrinker *shrinker; > + unsigned long mem; > + } shrinkers_by_mem[10]; > + int i, nr = 0; > + > + if (!mutex_trylock(&shrinker_mutex)) { > + seq_buf_puts(out, "(couldn't take shrinker lock)"); > + return; > + } > + > + list_for_each_entry(shrinker, &shrinker_list, list) { > + struct shrink_control sc = { .gfp_mask = GFP_KERNEL, }; This seems to be global reclaim specific. What about memcg reclaim? -- Michal Hocko SUSE Labs