Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7717632rwd; Tue, 6 Jun 2023 15:22:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7DvKTXE2fR4Z+hE5DFvsUYa8YTPg5Si7fVPpIjndrZob5xZ/MV0ABwijgRWh4zZ/lgCRrL X-Received: by 2002:a05:6a20:72a2:b0:10c:b1b0:3ee3 with SMTP id o34-20020a056a2072a200b0010cb1b03ee3mr968082pzk.21.1686090155577; Tue, 06 Jun 2023 15:22:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686090155; cv=none; d=google.com; s=arc-20160816; b=h+mZ5aKvWzsEga0h33llb8TMIfr5+YDpFcUk/egtBCjVhU0C6Z6h5ZZXRRFqBXik9/ WU/2TpHrMrkFkzRsFXZAcP/AsNr9eFA+qIjoCyai8d0FJ3lpk/0IDZdnCi3wgH7YGaAt juEIFAYIFZSS/YjMpYzQL74ljnEX3eVIk08yOdpGGWI2oeU6A1Avc5tF98QWHPxh0H1V MPQAdIALGgzvJvYu1WrlZlQ/hcLqqfvpnqsOkHspdmu7gfyQhriWI8em6Inl31jCVUEX BIgwMQ95bW1D35RYD6h1sCOVCIcoDha57bHMVLeT9IsFwZiNLIweJC55use85c1z7S/u QgUg== 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=q84P/Zpj4US01+iC9oxhz+4mQn9TmvaFzrXQHOhoFsI=; b=0kAUF6EZdBu9s+VCpKDYKFjYfMWzkUsdBVzO42NqyIWfVh9cdB9jkSUMv2RN3TJteg XL3a8+ShKmU3HTnmexfXYEJW7J67vQyUmT6NezeRU09a/GwR2LnNlWsw9bqSGqKfPURQ PTWrj4tE0C9oxmZxqCR+ED9CkFP3cXh+A73W30/ElZ9xp8h3r9vvQf4RJkh4cNcwNKD+ bqEkUQOHf6mPcL3e1QyKCUcVfuESnMoIH3oi4TJrAlgaVQ2aYzmf8n+CY74CjAehxuxC SNZxTAvwrOCFLBgsGULmsYmNi7ISQHRqaBfyMqirxmjmUagG6ZQTIG0JR0dwgbTYQbW2 cjaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fromorbit-com.20221208.gappssmtp.com header.s=20221208 header.b=2t1oK2AU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b67-20020a62cf46000000b00653b13d202asi7169252pfg.368.2023.06.06.15.22.23; Tue, 06 Jun 2023 15:22:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@fromorbit-com.20221208.gappssmtp.com header.s=20221208 header.b=2t1oK2AU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=fromorbit.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239804AbjFFWCo (ORCPT + 99 others); Tue, 6 Jun 2023 18:02:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234506AbjFFWCi (ORCPT ); Tue, 6 Jun 2023 18:02:38 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDE4E1702 for ; Tue, 6 Jun 2023 15:02:37 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-64d24136685so4831701b3a.1 for ; Tue, 06 Jun 2023 15:02:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20221208.gappssmtp.com; s=20221208; t=1686088957; x=1688680957; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=q84P/Zpj4US01+iC9oxhz+4mQn9TmvaFzrXQHOhoFsI=; b=2t1oK2AUusaPWDyrc/bAkX09X3lnEYzFmaxyk172+GG0cOEWQmf6wECBZF6+Zp+gKf d3KHNOvi0ris9Zhy+trBvtmoay1bmS0vXYGhbohIc18FZ8CcoUAaKNIySqUBG3phAi/f HA+r0lNUAfKBh6C5NkCyeAptNErIRSShNhDoH3tqBFr/cgLZZV7UocP0M7p70JxxsVFM UXChm6PyU/uV8fWMUC55Bu3osIPvtlLamRBbxopA1FpM4A/bDeGLRCunyYY3kCl96buM envV9YQ8SSiEzeRqgSRZb93XH047c9f6kQdiO8TJtQvZ10t21DHCA0c+WMLiwiXo5qxt dSCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686088957; x=1688680957; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=q84P/Zpj4US01+iC9oxhz+4mQn9TmvaFzrXQHOhoFsI=; b=jbD3DUH592TigJbSEvT3X88hjhs0HbjC/mgFRNlHqrM1aKrEHMfVUoV1+FoYI1zn3A 8RL8MxGydivfMxag5nOH/UrjjVTjWj7oAKJYxhHpxYXynRSrAcu7mUiXYZk5FfoYgHi/ 39ByKqKcO2kV3tOiUhYXxjVMJSbSXq69LTqwsBqrZuMqL9SYVUnTg8flrfOXIZhjaSlc C3CJ4aBtXo7itg/sWKLIwAyV4Z80CFZLxOuHPRenPT0Ghs57ZaVffDTXmsqYsWTSSM6Z Es+OCzc8xsqBf4IuGoIIHg+1CD5S3Shk43J7vKqXTcupcLvgmjBjzaJX4RrTnCA/02qf 14WQ== X-Gm-Message-State: AC+VfDzPPcucIW4PZAFmaKN2OjNiD1iHwVsPJwe/ZMiKaxCRzCUYB0bl 6dBV8XqJSPxciWw1eO5M16xWhg== X-Received: by 2002:a05:6a00:3316:b0:645:834c:f521 with SMTP id cq22-20020a056a00331600b00645834cf521mr4960797pfb.17.1686088957175; Tue, 06 Jun 2023 15:02:37 -0700 (PDT) Received: from dread.disaster.area (pa49-179-79-151.pa.nsw.optusnet.com.au. [49.179.79.151]) by smtp.gmail.com with ESMTPSA id p15-20020aa7860f000000b0064d47cd117esm7293989pfn.39.2023.06.06.15.02.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 15:02:36 -0700 (PDT) Received: from dave by dread.disaster.area with local (Exim 4.96) (envelope-from ) id 1q6el7-008ePi-0l; Wed, 07 Jun 2023 08:02:33 +1000 Date: Wed, 7 Jun 2023 08:02:33 +1000 From: Dave Chinner To: Kirill Tkhai Cc: akpm@linux-foundation.org, roman.gushchin@linux.dev, vbabka@suse.cz, viro@zeniv.linux.org.uk, brauner@kernel.org, djwong@kernel.org, hughd@google.com, paulmck@kernel.org, muchun.song@linux.dev, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, zhengqi.arch@bytedance.com Subject: Re: [PATCH v2 0/3] mm: Make unregistration of super_block shrinker more faster Message-ID: References: <168599103578.70911.9402374667983518835.stgit@pro.pro> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Wed, Jun 07, 2023 at 12:06:03AM +0300, Kirill Tkhai wrote: > On 06.06.2023 01:32, Dave Chinner wrote: > > On Mon, Jun 05, 2023 at 10:02:46PM +0300, Kirill Tkhai wrote: > >> This patch set introduces a new scheme of shrinker unregistration. It allows to split > >> the unregistration in two parts: fast and slow. This allows to hide slow part from > >> a user, so user-visible unregistration becomes fast. > >> > >> This fixes the -88.8% regression of stress-ng.ramfs.ops_per_sec noticed > >> by kernel test robot: > >> > >> https://lore.kernel.org/lkml/202305230837.db2c233f-yujie.liu@intel.com/ > >> > >> --- > >> > >> Kirill Tkhai (2): > >> mm: Split unregister_shrinker() in fast and slow part > >> fs: Use delayed shrinker unregistration > > > > Did you test any filesystem other than ramfs? > > > > Filesystems more complex than ramfs have internal shrinkers, and so > > they will still be running the slow synchronize_srcu() - potentially > > multiple times! - in every unmount. Both XFS and ext4 have 3 > > internal shrinker instances per mount, so they will still call > > synchronize_srcu() at least 3 times per unmount after this change. > > > > What about any other subsystem that runs a shrinker - do they have > > context depedent shrinker instances that get frequently created and > > destroyed? They'll need the same treatment. > > Of course, all of shrinkers should be fixed. This patch set just aims to describe > the idea more wider, because I'm not sure most people read replys to kernel robot reports. > > This is my suggestion of way to go. Probably, Qi is right person to ask whether > we're going to extend this and to maintain f95bdb700bc6 in tree. > > There is not much time. Unfortunately, kernel test robot reported this significantly late. And that's why it should be reverted rather than trying to rush to try to fix it. I'm kind of tired of finding out about mm reclaim regressions only when I see patches making naive and/or broken changes to subsystem shrinker implementations without any real clue about what they are doing. If people/subsystems who maintain shrinker implementations were cc'd on the changes to the shrinker implementation, this would have all been resolved before merging occurred.... Lockless shrinker lists need a heap of supporting changes to be done first so that they aren't reliant on synchronise_srcu() *at all*. If the code was properly designed in the first place (i.e. dynamic shrinker structures freed via call_rcu()), we wouldn't be in rushing to fix weird regressions right now. Can we please revert this and start again with a properly throught out and reveiwed design? -Dave. -- Dave Chinner david@fromorbit.com