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 C9200C433EF for ; Fri, 20 May 2022 04:33:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D6B436B0072; Fri, 20 May 2022 00:33:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D18AC6B0075; Fri, 20 May 2022 00:33:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE0196B0078; Fri, 20 May 2022 00:33:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id AC4626B0072 for ; Fri, 20 May 2022 00:33:40 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 4A82321022 for ; Fri, 20 May 2022 04:33:40 +0000 (UTC) X-FDA: 79484853000.15.7519405 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf04.hostedemail.com (Postfix) with ESMTP id D7FE240015 for ; Fri, 20 May 2022 04:33:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653021219; 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=1xG+mMcwGEN5XJMWaqhoEuXIw7t293hEIaVOvS4m0iY=; b=Nc+BxR93rOqZctssgkjCTJLcGUhkUd033HEBPHtlc/H5RqZzAHGAGPVRoY0aWpe+a3OCYd 78+TaEmfHcUfUOowZpLXpXT6Wb07/LRPMdlrB5FcWFXC3t15sjyL4cviuRMw8fM40hBkge c0jAKHiENQrVUbugkIllRMoFXD439EI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-205-h6Fig9C-M2y92jb6AIGjmQ-1; Fri, 20 May 2022 00:33:35 -0400 X-MC-Unique: h6Fig9C-M2y92jb6AIGjmQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 116C02949BA9; Fri, 20 May 2022 04:33:35 +0000 (UTC) Received: from rh (vpn2-54-35.bne.redhat.com [10.64.54.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 21A042011C79; Fri, 20 May 2022 04:33:34 +0000 (UTC) Received: from localhost ([::1] helo=rh) by rh with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nruKR-001Ult-34; Fri, 20 May 2022 14:33:31 +1000 Date: Fri, 20 May 2022 14:33:29 +1000 From: Dave Chinner To: Roman Gushchin Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Kent Overstreet , Hillf Danton , Christophe JAILLET Subject: Re: [PATCH v3 0/6] mm: introduce shrinker debugfs interface Message-ID: References: <20220509183820.573666-1-roman.gushchin@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: D7FE240015 Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Nc+BxR93; spf=none (imf04.hostedemail.com: domain of dchinner@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=dchinner@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspam-User: X-Stat-Signature: pqws3udr5tjx7bfitr66rr4yimgr93tu X-HE-Tag: 1653021205-659208 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, May 19, 2022 at 10:15:04AM -0700, Roman Gushchin wrote: > On Mon, May 09, 2022 at 11:38:14AM -0700, Roman Gushchin wrote: > > There are 50+ different shrinkers in the kernel, many with their own bells and > > whistles. Under the memory pressure the kernel applies some pressure on each of > > them in the order of which they were created/registered in the system. Some > > of them can contain only few objects, some can be quite large. Some can be > > effective at reclaiming memory, some not. > > > > The only existing debugging mechanism is a couple of tracepoints in > > do_shrink_slab(): mm_shrink_slab_start and mm_shrink_slab_end. They aren't > > covering everything though: shrinkers which report 0 objects will never show up, > > there is no support for memcg-aware shrinkers. Shrinkers are identified by their > > scan function, which is not always enough (e.g. hard to guess which super > > block's shrinker it is having only "super_cache_scan"). > > > > To provide a better visibility and debug options for memory shrinkers > > this patchset introduces a /sys/kernel/debug/shrinker interface, to some extent > > similar to /sys/kernel/slab. > > > > For each shrinker registered in the system a directory is created. > > As now, the directory will contain only a "scan" file, which allows to get > > the number of managed objects for each memory cgroup (for memcg-aware shrinkers) > > and each numa node (for numa-aware shrinkers on a numa machine). Other > > interfaces might be added in the future. > > > > To make debugging more pleasant, the patchset also names all shrinkers, > > so that debugfs entries can have meaningful names. > > > > > > v3: > > 1) separated the "scan" part into a separate patch, by Dave > > 2) merged *_memcg, *_node and *_memcg_node interfaces, by Dave > > 3) shrinkers naming enhancements, by Christophe and Dave > > 4) added signal_pending() check, by Hillf > > 5) enabled by default, by Dave > > Any comments? Thoughts? Objections? I have no time available to look at this right now, and won't for a while. Cheers, Dave. -- Dave Chinner dchinner@redhat.com