From patchwork Tue Aug 7 15:37:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10558791 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9430D14E5 for ; Tue, 7 Aug 2018 15:37:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7EC5928DBA for ; Tue, 7 Aug 2018 15:37:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 720A429E90; Tue, 7 Aug 2018 15:37:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 595D228DBA for ; Tue, 7 Aug 2018 15:37:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A65B26B0008; Tue, 7 Aug 2018 11:37:37 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A38866B000A; Tue, 7 Aug 2018 11:37:37 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8D9816B000C; Tue, 7 Aug 2018 11:37:37 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id 2E2056B0008 for ; Tue, 7 Aug 2018 11:37:37 -0400 (EDT) Received: by mail-ed1-f70.google.com with SMTP id c2-v6so5531392edi.20 for ; Tue, 07 Aug 2018 08:37:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:subject:from:to:date:message-id :user-agent:mime-version:content-transfer-encoding :spamdiagnosticoutput:spamdiagnosticmetadata; bh=3ZWbgfrXZk4tDjS2Z1ApZL2kNek79RZjPDTiGfD2smQ=; b=GVO0St72BFHUoOHfrp/1f6yx023ieO4ZIzPX56yugJv+w32jDL7ZotxnaQ/F/OoIXh +PMgBav8huJ/8I5BArjKeK/ZdGI3jQoAiTEY2HeSkfYs6nEm4yjhzp1Sbnir4/o64MAA iBVFl1UTijm071hz7KZGKOHf5XerHlac9CeuTDp1oNCJH6Z3oEtUvD+4gqKKzuwJjh3R pqT7oTDFvAzGPKxbTWaDrHOzAEreVAKtapQ4WsTrH9c8G5RiXlY9LBfZzyRJif5015xk ZLJ+vdqLulxDunfmI6cHJ/uyEbl55ZXJrTC6AB4abQrjZV3u0JqVkvgIz76+Oox3TO0L WIQg== X-Gm-Message-State: AOUpUlHnqHScuBAKHaMetXEbWSAtTqoPbX3N5R65hmPZj8SYYIni3pOx FtTzJuvBZ/bwAHgtjmTA3c2sMdj06LSdmtQGJIIQAdCMdERcGgKS5DjRQ1P0Zq7sMQBoVYIKsrn 2FYcvMCM9yKiqwxY1UHKuQ482QQjAtxWsAPoHj81GRIXJH4zhnuFN+WiG2xoikpmuKQ== X-Received: by 2002:a50:89d3:: with SMTP id h19-v6mr23299422edh.140.1533656256482; Tue, 07 Aug 2018 08:37:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfxtMlKc2/DnB9PBu+4E5VvUEuwE9bNYtgmTCKPSfpjmEOQ8rgZRkYVOWAsjO8pYwz2kzhs X-Received: by 2002:a50:89d3:: with SMTP id h19-v6mr23299352edh.140.1533656255453; Tue, 07 Aug 2018 08:37:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533656255; cv=none; d=google.com; s=arc-20160816; b=KGiBPT2gvrzc627LXXP5fKmCeCcSno8rYRZgZqJCogP98/liIPnvxYP9ahBdTpGOZl xIizL+iUNQn/tZnyD4J78tUNXmT6n6NIyUWCHiSzClX1FkBFt1Z6zwsFNVNWwYU9UPwG zNwmovc6lo7ecIPvyFkqy14wI/A4n5NlJ5ubRxk7dqQhSbE+mSO6Y3RPOLmdxEwJsRE8 lIoRRGzyT5UbiXMw30TX0QmumxH9mRd6J9PoYsw2pOr+IpzhtF7tf43UVKDyokgmgopH Ac8lmSnuVt1/b+pPTXJV2gl395f4ryIWcoNleC36MSPOiwi6CGG9HNnPO6apaqxCaQGF 7cKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=spamdiagnosticmetadata:spamdiagnosticoutput :content-transfer-encoding:mime-version:user-agent:message-id:date :to:from:subject:dkim-signature:arc-authentication-results; bh=3ZWbgfrXZk4tDjS2Z1ApZL2kNek79RZjPDTiGfD2smQ=; b=KSd+RtOQYjU0ZNfw8p+H++ETGSSG1F8bJrk07SnhWWjPSmDMAmctHOoIPGCck9XGiK ADlaKw6cPHT0YmybWf5YSAbKkJk3+p/Eo/mwmkISd6IWonXEVpkWlNPZdvNWjDA8ddHJ wV5ESsfA2z0aXcud13o/c2w7NctKydkGeCPQqywAuinhreQ05aW7TfS4Z+ulqbi8CM5a 5Gg1ZMoQExMvAFhEn5jWUj+38k8rA1w4G+UItjEeW8D4rgcdWfTOkcYTl7O3rYnU7HyK tcw9JWunXPMwtt537IWyFm9VT/nExJyrEQu8ZrBrNj5ye/3M4RHz6CLSqzNa6kFu4zUw v1XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=RmZvE7Si; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.0.132 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00132.outbound.protection.outlook.com. [40.107.0.132]) by mx.google.com with ESMTPS id o5-v6si1491845edd.67.2018.08.07.08.37.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Aug 2018 08:37:35 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.0.132 as permitted sender) client-ip=40.107.0.132; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=RmZvE7Si; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.0.132 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3ZWbgfrXZk4tDjS2Z1ApZL2kNek79RZjPDTiGfD2smQ=; b=RmZvE7SifJencs/GRLjU9nlgwXWxlwOP2E73AeRFE7oNNeqUWaIIHwvnRhU9xymvvIuNRKXXvi6Pe9P1mj7ukM0ZMTEgTQvpdTiAAh4qL1isN1DVhcQfj9SW0a6caNz0jGO13pdogsFyUiFpfJnmkQV4ovwCuspULsnW5cIVwF8= Received: from localhost.localdomain (185.231.240.5) by HE1PR0801MB2025.eurprd08.prod.outlook.com (2603:10a6:3:50::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.17; Tue, 7 Aug 2018 15:37:23 +0000 Subject: [PATCH RFC 00/10] Introduce lockless shrink_slab() From: Kirill Tkhai To: akpm@linux-foundation.org, gregkh@linuxfoundation.org, rafael@kernel.org, viro@zeniv.linux.org.uk, darrick.wong@oracle.com, paulmck@linux.vnet.ibm.com, josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, hughd@google.com, shuah@kernel.org, robh@kernel.org, ulf.hansson@linaro.org, aspriel@gmail.com, vivek.gautam@codeaurora.org, robin.murphy@arm.com, joe@perches.com, heikki.krogerus@linux.intel.com, ktkhai@virtuozzo.com, sfr@canb.auug.org.au, vdavydov.dev@gmail.com, mhocko@suse.com, chris@chris-wilson.co.uk, penguin-kernel@I-love.SAKURA.ne.jp, aryabinin@virtuozzo.com, willy@infradead.org, ying.huang@intel.com, shakeelb@google.com, jbacik@fb.com, mingo@kernel.org, mhiramat@kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Date: Tue, 07 Aug 2018 18:37:19 +0300 Message-ID: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: DB6P193CA0006.EURP193.PROD.OUTLOOK.COM (2603:10a6:6:29::16) To HE1PR0801MB2025.eurprd08.prod.outlook.com (2603:10a6:3:50::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 33310057-ae48-43c8-c963-08d5fc7baffd X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:HE1PR0801MB2025; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2025;3:lhCuntUu50gnumQVvsFfMn04PEs27KyPtIZpZFtFk35MgJjCErxtrrrGlFmQ6SMmJpwZ4M6U63C8wVW9U9MAJ2+w7yA3iRuDKBlpeC+jgeagk/okkur1znID+GyYdNn7NeV5CcmKgg4b5OtrXjmepZAw2DHGbA+dQ+vebj0eJXLUwOPkv6w1ZfRP43/N79mAqmP4eQ8dpf4FGE8xFyeBsHe9u5xPzXLH/I+qttgvqWCCd2yhez+Z6+HwIo5ZXjhv;25:UwJfF+4yI2s8Sg/43FLjXbd+UDWC4P7wH1ORFMWDwjbHRYlXoH0O8QueDzg4EnRk1TBIk/bwjmfo9Au/Xk6oXWQq6lIyoyTgbKdGvPa8cjnLaBMwjSfNG/lZ0tTvlbL0EnlwR94hAFm0nl4gjYVk7Y9KKQZl8hxqqLJU5+Fa6LwHo1+ruXDo/lY4pHeuSSeZaPO/xn36ZWm0w8LeZD/sM8WY32QzpdLhWrD2dDX91aYkDVWTENg5S4l9flwVl0kjirGcHtzSv+re3sIW8e7FeQPHwxnWydoomNF3a9/2R7Nis0UXQTcXvUNgWvzZkydsRm1nOf3LZQvyT6GeeFFCmQ==;31:IUal/JZ5r5mr3JWjAkn69WAZSI6QF6e9w+8RQKUjPHL2fdU8cHciwvS8aToF9qbVgqNL1JESYrfCl09Mk/H8HJPH42lNrBqNBiVkgMKxTnzWnHYGpglp+4ktp+3NTHyjZ/MP0ehNESmYLS/0odS6x/5hyOkB7lDudgYiSz18WFwUZexK6JoXZfG2vDdMU9W9dpeJzQjsVTNlCZ/MBQHNkZIY1JAEcg1xduY8/AuIUDY= X-MS-TrafficTypeDiagnostic: HE1PR0801MB2025: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2025;20:G2UNUL+yf3vIZKM1PbfcYj+XtNjGKc/COG3UNLq2IkBrYV0/P0NHXoadq+WTDtyI9RbCt6lUmjaCFUMG2MqkVPp4suMWNH1EKZu6ugnUf9F2AHUqkt3NGQGINIzPi+PtAcWq1sx1xSUP8f2znG8ZqWMe1dU4FrGbLUzRUL1DksDpd3HJ7oBQCoEDpy9cTdSG0cJopUwA99AZM9nc9j4lLmX33He+7flvrrgddHPZJvOiMG82PYzX5a75dXW/crB68jSTDNcHh2EWbioCWVtWw/wwmhCo0NT3q4VIkbS8bJ6pA1+jHgy9fqcr38WZvhUSItFcXfzU3maU1VPyRREuDNmkvWR66ielrBNvxCEKgVkUCDOG+tEr444U9qYtjy2mPAFFwxwYtHNUEl44U6MoWZlVxcWWFmYzGEAZLG2oEskKNdHwdQsh+QAQvhRq02NBpepODlc4j4EkeDDvJFdkraIV5rUcIuAte1Q1u6H1stgMgJW5bDKGrk2cfnBdoGYd;4:WtD2Qah3nwPjmqgT0OG17XnnLJBJt35RY+qIxqO8ZLpejsb8FNzeORVCDNXKOlGYsGQEq7IpiEPpc4/N2rX+MDE65P7KWO8bucCWf41rLyq+UrdcEJLZww0GdQZK3oj5+cmhj4quIxv2v1vkYpCor0Fyo93Vjk+lHsZJrDe3Jplf7z83oe2TVowobrbD1udV/7rot82G4pyHiB1j3czd8A6g6KSf5QCEjn8/Lp3lO3aYM7BT/Car5f4reiG6NZbG8FvbAloS4dlkeCBvpeDH0w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:HE1PR0801MB2025;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0801MB2025; X-Forefront-PRVS: 0757EEBDCA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(136003)(39850400004)(396003)(366004)(346002)(376002)(199004)(189003)(8936002)(305945005)(81166006)(316002)(97736004)(8676002)(81156014)(66066001)(7406005)(7416002)(7736002)(47776003)(61506002)(2906002)(217873002)(14444005)(478600001)(486006)(956004)(476003)(58126008)(6666003)(68736007)(50466002)(86362001)(16526019)(7696005)(23676004)(2486003)(106356001)(39060400002)(6116002)(3846002)(186003)(26005)(9686003)(103116003)(33896004)(25786009)(966005)(386003)(105586002)(52116002)(55016002)(6506007)(6306002)(53936002)(5660300001)(230700001)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0801MB2025;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BHE1PR0801MB2025=3B23=3AoFQex?= =?utf-8?q?/jcqH8Gt3db7WB5skZlwtsWV9c7Z+8vXDR4cWGOYkuluJqEuDGF91HrvV9lD0yfPd?= =?utf-8?q?RHuBSp/W3TGwnGmb2JFaqPuCQYeY+tYhnrDy/lrchloAb8JNWog/5jiZ306xTV6hz?= =?utf-8?q?9hlv9CzbfsytQ4FJGhSAGYS7VqwXbC4zE3ktMLKM0YbXVG8RZArSwAljRRFVwMdZF?= =?utf-8?q?zCz+dChH7STXNot+2jzFZBe+7JwHqLP0xcD90cqj81Z+4uYmnktrFgMEanFM0qEQM?= =?utf-8?q?GsYhJl4EPUFnlH6JdJuGM27dLY9Urm7/vULbmDvEzkL0BOTyqnxvmNUJHIqKb+0fK?= =?utf-8?q?vkLiVwPpyxHnRl5LmX0n9DG/OgjitY3x6m8Ja+cp9nwpOauBmOQFos1SeZfTRi5Uc?= =?utf-8?q?OkJAdmKLObi9x4riZsZp8ImxWS5Q/OqvTqcARrRd3lP5wW0+p6eG1HWoduRoNOqmr?= =?utf-8?q?LYNjkA2C2WWsk+FOhGEDOYeI2kRJJ96tyQV7rOOQH4xNSjqwpVH+h8aVDPcVGYMmf?= =?utf-8?q?P1ZFCXw5plRi+OyB62NWeIkWmQDieQwPC3CC3cOpe9ynShcJO84+GFNgce2PWvjm9?= =?utf-8?q?BafvOx9/umdZhUGy1ucLFgnm91gpG3V/fbSHiZW3iRqdqu0yTKENaXDR+p7ktPxT7?= =?utf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adata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2025;20:QjX4kbynVcbBmdcJDUulQaRCcQKuAx3Jf/OCaNdoqvr2JnUqbJ3dgqHqY+pCH7GPQLSV92YHbYGiAiknabMpSBAcDZzE/bdQG0blmP2L0o91rkgSQq8yGMk4x7+ss+mHq30ncnmfDCyhtkyCvdo1gANCUPXdyzq0AAq7VVLTsN8= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2018 15:37:23.9588 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33310057-ae48-43c8-c963-08d5fc7baffd X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB2025 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: X-Virus-Scanned: ClamAV using ClamSMTP After bitmaps of not-empty memcg shrinkers were implemented (see "[PATCH v9 00/17] Improve shrink_slab() scalability..." series, which is already in mm tree), all the evil in perf trace has moved from shrink_slab() to down_read_trylock(). As reported by Shakeel Butt: > I created 255 memcgs, 255 ext4 mounts and made each memcg create a > file containing few KiBs on corresponding mount. Then in a separate > memcg of 200 MiB limit ran a fork-bomb. > > I ran the "perf record -ag -- sleep 60" and below are the results: > + 47.49% fb.sh [kernel.kallsyms] [k] down_read_trylock > + 30.72% fb.sh [kernel.kallsyms] [k] up_read > + 9.51% fb.sh [kernel.kallsyms] [k] mem_cgroup_iter > + 1.69% fb.sh [kernel.kallsyms] [k] shrink_node_memcg > + 1.35% fb.sh [kernel.kallsyms] [k] mem_cgroup_protected > + 1.05% fb.sh [kernel.kallsyms] [k] queued_spin_lock_slowpath > + 0.85% fb.sh [kernel.kallsyms] [k] _raw_spin_lock > + 0.78% fb.sh [kernel.kallsyms] [k] lruvec_lru_size > + 0.57% fb.sh [kernel.kallsyms] [k] shrink_node > + 0.54% fb.sh [kernel.kallsyms] [k] queue_work_on > + 0.46% fb.sh [kernel.kallsyms] [k] shrink_slab_memcg The patchset continues to improve shrink_slab() scalability and makes it lockless completely. Here are several steps for that: 1)Use SRCU to synchronize shrink_slab() and unregister_shrinker(). Nothing exiting is here, just srcu_read_lock() in shrink_slab() and shrink_slab_memcg() and synchronize_srcu() in unregister_shrinker(). See [2/10] for details. 2)The above requires to make SRCU unconditional enabled. [1/10] makes this. Note, that if we can't always enable SRCU, we may use percpu_rw_semaphore instead of this. See comment to [2/10] for details. 3)Convert shrinker_rwsem to mutex. Just cleanup. 4)Further patches make possible to speed up unregister_shrinker() by splitting it in two stages. The first stage unlinks shrinker from shrinker_list and shrinker_idr, while the second finalizes the thing by calling synchronize_srcu() and freeing memory. Patch [4/10] actually splits unregister_shrinker(), while [10/10] makes superblock shrinker to use the new helpers (unregister_shrinker_delayed_{initiate,finalize}(). 5)Patches [5-9/10] are preparations on fs, which make possible to split superblock unregistration in two stages. They sequentially make super_cache_count() and super_cache_scan() safe to be called on unregistering shrinker: [cpu0] [cpu1] unregister_shrinker_delayed_initiate(shrinker) ... shrink_slab(shrinker) (OK!) unregister_shrinker_delayed_finalize(shrinker) After all of this, shrink_slab() becomes lockless, while unregister_shrinker() remains fast at least for superblock shrinker (another shrinkers also can be made to unregister in the same delayed manner). (This requires "mm: Use special value SHRINKER_REGISTERING instead list_empty() check" from https://lkml.org/lkml/2018/8/6/276, which is on the way to -mm tree, as said by -mm tree notification message from Andrew). --- Kirill Tkhai (10): rcu: Make CONFIG_SRCU unconditionally enabled mm: Make shrink_slab() lockless mm: Convert shrinker_rwsem to mutex mm: Split unregister_shrinker() fs: Move list_lru_destroy() to destroy_super_work() fs: Shrink only (SB_ACTIVE|SB_BORN) superblocks in super_cache_scan() fs: Introduce struct super_operations::destroy_super() callback. xfs: Introduce xfs_fs_destroy_super() shmem: Implement shmem_destroy_super() fs: Use unregister_shrinker_delayed_{initiate,finalize} for super_block shrinker drivers/base/core.c | 42 ---------- fs/super.c | 32 ++++---- fs/xfs/xfs_super.c | 14 +++ include/linux/device.h | 2 include/linux/fs.h | 6 + include/linux/rcutiny.h | 4 - include/linux/shrinker.h | 2 include/linux/srcu.h | 5 - kernel/notifier.c | 3 - kernel/rcu/Kconfig | 12 --- kernel/rcu/tree.h | 5 - kernel/rcu/update.c | 4 - mm/shmem.c | 8 ++ mm/vmscan.c | 82 ++++++++++---------- .../selftests/rcutorture/doc/TREE_RCU-kconfig.txt | 5 - 15 files changed, 89 insertions(+), 137 deletions(-) -- Signed-off-by: Kirill Tkhai