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 9A7D6C7EE37 for ; Tue, 6 Jun 2023 22:02:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D54506B0071; Tue, 6 Jun 2023 18:02:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CDD0A8E0002; Tue, 6 Jun 2023 18:02:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B7E128E0001; Tue, 6 Jun 2023 18:02:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A90626B0071 for ; Tue, 6 Jun 2023 18:02:41 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 81FF81C7A2F for ; Tue, 6 Jun 2023 22:02:41 +0000 (UTC) X-FDA: 80873698122.16.6720C36 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by imf16.hostedemail.com (Postfix) with ESMTP id 7B55C180023 for ; Tue, 6 Jun 2023 22:02:38 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=fromorbit-com.20221208.gappssmtp.com header.s=20221208 header.b=2t1oK2AU; dmarc=pass (policy=quarantine) header.from=fromorbit.com; spf=pass (imf16.hostedemail.com: domain of david@fromorbit.com designates 209.85.210.181 as permitted sender) smtp.mailfrom=david@fromorbit.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1686088958; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=q84P/Zpj4US01+iC9oxhz+4mQn9TmvaFzrXQHOhoFsI=; b=SUiB/C5go/F7V2wEWRg/7LCkJ6Wjde73KLNHMz7MzBswLqjTXUN+8IN8sLX0ZP1XjORGPw eKojSB7wj9/0MrHZ/loWb/HuG5P1VkGZev4H8w3lIzRDCewmBabzZRFWIOjDnPGJiZQBs5 Q1RXg1wWCblaqqyH1/b1U+Dwv1eAg2U= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=fromorbit-com.20221208.gappssmtp.com header.s=20221208 header.b=2t1oK2AU; dmarc=pass (policy=quarantine) header.from=fromorbit.com; spf=pass (imf16.hostedemail.com: domain of david@fromorbit.com designates 209.85.210.181 as permitted sender) smtp.mailfrom=david@fromorbit.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686088958; a=rsa-sha256; cv=none; b=Pnq28+g8GRULmv6owp7djqj+WUiAh/H+72HqxVneW4zLy385/tWla9lKaeiDQy85t1n6CU V4WHuu78osEASPwxw1eVpMO0Z2Pey6fRImww+qhdBakIw7YuG/dbWscN8JM24d8N+eQQqS WEUlOXRpOh6MrVF0JHolACDKxMNEApM= Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-64d24136685so4831698b3a.1 for ; Tue, 06 Jun 2023 15:02:38 -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=BhF/oNioa0El10x8aWx3irQLSaOwAMPSHRHw9XqH/1O+wgBE7TLxzd08jYz6rS8RTe 2kDhIkoMfyXFg3TuMUge71vBKT4vD8Zkw4Y7uURBRDIM60JYsqzw+CLxWyF/23SUPM+3 WWUTeOQAx0tb7a1GBX2R2l2rdS7RspuqcLsh/AHEHnQi6qSxtc8/MJv6YMcKxj1iChaG AzIDaR8Mh13okRP3fJ/UaP5TbZr40hFx/DrfOSANRD6bemlB0nkKD3063ycH1ErIG/JM o3/D9RMSLt09ZlgHyNGLx9IqumDu28jT91zXHP8cO8eGY/tiXWbFgBurFV45z+h5IGBV SCvQ== X-Gm-Message-State: AC+VfDw7QNfrwG1Sdj4eBB1cigjJhFNk8hfOeY+O6uaXiE4RFWJrZIhN NxXZjOQfnT6DQ3qydzkP1SpJIg== X-Google-Smtp-Source: ACHHUZ7xLo3qxQtzWUeCkYrgCfEBLb/Py3jsG4y1l0xhkRqsxW/43h0D9tK1yS87PaV2qRPEinYD6Q== 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-Rspamd-Queue-Id: 7B55C180023 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: cnwt15k49iyokryh9yg1o9hcix5e796g X-HE-Tag: 1686088958-962919 X-HE-Meta: U2FsdGVkX1+eZjyL1ls+5h6LV7dznQkbh9G+ZkzB8eGzbLpugXOiQ+HfO2AK9UO+r2F/1vBMCXjVjBYFeWlZk9XizTLN4KRr942h4Ks2aeNuzpYeb1prwt51xwu0h0Ujo8r330gAIthLlYcm5dPo+B1HfcqBRSjuVWZAOyANowJ2ztBFEEK5KPOxtd6vIXbXCcGLCwWhXFe7gWSoabR/Cy1JBi16RqBs/gRR8GceW8N4pM8seCtO7Z0mpYNjJfUrBGsR6FmM7YBx96yQocLC/17puR3zN1bliaKXN7EqGjXXEpe846F6/Gp4GHJSistIxRbiiLK8kHQ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imtSj0sD2/LoBlRE+2KmWJ7SKO/jR9/IIIPX7UJ1lGcqqUrmxaDve0X1WcFDwdZruC0VUhW6WaiSbSN832kxTWwCeYJpPjmXHntnGngDsUMxuMTkdGZtjpcMlUndlGo2z33/ULP8KW4pEFUbcLdiyllnhwvDd4OuBJCG4tng8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000262, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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