Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1681691ioo; Mon, 23 May 2022 00:07:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHoHYtq7V4Lh+cImudeIABpuk0Cu2YYC0BjQWspS0NFT8LrqQQhaGWSTjpogobYGra7xKJ X-Received: by 2002:a17:902:ef8f:b0:161:e39c:2f15 with SMTP id iz15-20020a170902ef8f00b00161e39c2f15mr18489310plb.165.1653289632961; Mon, 23 May 2022 00:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653289632; cv=none; d=google.com; s=arc-20160816; b=YYpU3gECCjS0JbKXBMWPzpAkeuQHE9p5ux6QETEpJjjtBTmlJvVHT3R3p+AV5sZrNS zXEn+OM+IZOfZbtVHWHaTxuuNmBFv7JhIhK705uFXCc4KXepw3P+eJhDhxJgUlTBxkJa Qt28F/HunHp1yfg1ZX9mD0uuqkiT5neNggXa8MrGQFnn1SUHi1JphY5qPMEcOg+M9LSL ANjkHTeFXuYlp6SJs3xeHGsw+Xjm/l2fsscU9OpVN1ZFRIF/RR2DFtAoqv4vt2o/A2jy fWXc1qpCAf0Wu+gaExmsZ4Px3wP7ngAte4N7/y/0dSpeX6EXJ6ks8BVLUUSih8mKSpYA qTQw== 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=1xG+mMcwGEN5XJMWaqhoEuXIw7t293hEIaVOvS4m0iY=; b=EYYAje50LhPzdC/iz0M2+awTV2gvB555nd+W0OPKVNyYquX+gu+5ntPDzO5lfw35S4 VVqxgNnz+I1eiZSjIkL6Tl5SGjvdJ2iLAN5ccLTPYffaWqpoGqPHfp/adT5DrhH32Y+t aah+BJ3vyY3VWfLcp6YVxOdSxJR1T3gQlL8d6hp5t/sALBc2sC8ZhQJUoEm2+ekzhCGS xpxRW7xE5g9MnsiWGgR1tClAUYVnGEmFQx1TnPPDLq9abuICCQKi4bFFyQAsJ3PiTtRu nlyTCgSeAK6iKiOfGvCbyIwlfv6auAaCIeqYXfxpqFultUqKhl+5tv+6LsorNCdNzRkz xXLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Nc+BxR93; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k9-20020a635a49000000b0038222818815si9430060pgm.112.2022.05.23.00.07.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:07:12 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Nc+BxR93; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CC70311C20; Sun, 22 May 2022 23:28:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238438AbiETEdp (ORCPT + 99 others); Fri, 20 May 2022 00:33:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239676AbiETEdm (ORCPT ); Fri, 20 May 2022 00:33:42 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 58C025F261 for ; Thu, 19 May 2022 21:33:40 -0700 (PDT) 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-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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