From patchwork Tue Aug 7 15:37:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10558793 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 CC33614E5 for ; Tue, 7 Aug 2018 15:37:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7DDD28DBA for ; Tue, 7 Aug 2018 15:37:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB18C2A3E6; Tue, 7 Aug 2018 15:37:48 +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 D618829E90 for ; Tue, 7 Aug 2018 15:37:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EF7956B000C; Tue, 7 Aug 2018 11:37:46 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id ECC446B000D; Tue, 7 Aug 2018 11:37:46 -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 D94D56B000E; Tue, 7 Aug 2018 11:37:46 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-io0-f200.google.com (mail-io0-f200.google.com [209.85.223.200]) by kanga.kvack.org (Postfix) with ESMTP id A9DDD6B000C for ; Tue, 7 Aug 2018 11:37:46 -0400 (EDT) Received: by mail-io0-f200.google.com with SMTP id s14-v6so12562813ioc.0 for ; Tue, 07 Aug 2018 08:37:46 -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 :in-reply-to:references:user-agent:mime-version :content-transfer-encoding:spamdiagnosticoutput :spamdiagnosticmetadata; bh=HHFDjKdL6Buzx5I7OUG4LnsCYKjp0S409y16pw5PmLQ=; b=bqSdIjyghif9i/QeuNGK74/Mef166UrbCET/kYp7btTUtagY2h5KN3Xipo3V6rBsyL GeAhPIIZGJ/fXMXRZxIuDfsPLFF4isNol5Vb6kZ32LpqvI2yr41Rgd60232ov42DVcD4 2pxGyFKaYegxWgt7YV4+DePmCLCh7WyUXmyjNGfu1f6Wb6sgSACq5GFjz65J0dvC4sXU zZx/6KYFvJP0YEDKA7FySb5kx5iBz8GRhmxyn8HGzQK+knWt4Hb1F2muTUHSm67VYtI9 p/L5MWqQicY1iAwy3QhEuj4B7HPXZWQlN+RrkwTDJz4+5r7YjGHjFSe3MrbDOcdsLh/S 8BLw== X-Gm-Message-State: AOUpUlGaRqA+FF2Mgqgduf4ncto4RuNpLLD1QMusjNhpTGZD/IO0FS5o yb+7trrhhp8B9PtXscrW4/P2s4dPejXkfqfmHGJL+0JGoWohzrUiJOzeI+kCyCeDfWz2zKSBHzV 5p1muxCZIOpZk9u+Si7CGMffkzoRcRdmvG467Nxj23zMntAtlQySUFVcr1+H+0wLDKA== X-Received: by 2002:a24:97cd:: with SMTP id k196-v6mr2212645ite.93.1533656266355; Tue, 07 Aug 2018 08:37:46 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzaJO/yA+kkN6GMmYJ3dExIX8yVaff4p2h80eYQBjQNSoefpS8p5aUaUk38fDe4Hkxyspmo X-Received: by 2002:a24:97cd:: with SMTP id k196-v6mr2212582ite.93.1533656265043; Tue, 07 Aug 2018 08:37:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533656265; cv=none; d=google.com; s=arc-20160816; b=WXGIZnr981fBpHTegsMT6conONC7AEzPHkdPwfY1O570jigJXCDEcq4UHNi8FeI06+ ay7bRG5mZ3pg2jzIUmvY/UpwmyP++lZNIFuA9AhKQGqcSscF8k0KHxvI4ufE2ltXJONu aDVVM8Zj8F7NBT8MqumsOy/Q8Fu9a0SdLn+6a2nk5MHRvESPKBxFiHd6O/CNVeIktjp7 wHyAS4C8BhMuT+NWH/uUa8sGJP8hboxDgaItVNr/06gXzxVE4McwAQaM4tDY/RJs0DAb h3kmHs7k8pqe1vxABXscFDctJp5L/D9yja4MTH29S0o+73dvqc63K/FTW45f8RHkuSia 8ehw== 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:references :in-reply-to:message-id:date:to:from:subject:dkim-signature :arc-authentication-results; bh=HHFDjKdL6Buzx5I7OUG4LnsCYKjp0S409y16pw5PmLQ=; b=wBlUWPpr0LFhwymlzcE7hYAdWgoLSasPLC/87t1L2xsvf/dHbAMgrSeZ9ji5FGl5b0 vSL0RsAS4F6hmcxHk88JQ3yUKPdk9Z45RLuWJF9LX50qypM9ma8Tf6xMTECmymlkLN4n YW8mRREflQ1YsSd31lE+ndzk/mZ7VfOgHu9ezEdx3SdDPmTEMP8P5pdy8HIQ/CB6nYZJ 3SHM2MjKM0Zsf7TQSqdUID5yaX0Z977yf+xN7wDXRDsuXaIF6qzks6rBhdvSvf/NQy1a gKTsOoZiELus/cW0TrNrc0Z4QEBUGTObFRJO6LYd1+ckudAn9PEHhKfXH5Hw0CUaQ/rR VaMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=VL9qFctI; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 2a01:111:f400:fe07::703 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-am5eur02on0703.outbound.protection.outlook.com. [2a01:111:f400:fe07::703]) by mx.google.com with ESMTPS id w130-v6si407216iod.188.2018.08.07.08.37.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Aug 2018 08:37:44 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 2a01:111:f400:fe07::703 as permitted sender) client-ip=2a01:111:f400:fe07::703; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=VL9qFctI; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 2a01:111:f400:fe07::703 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=HHFDjKdL6Buzx5I7OUG4LnsCYKjp0S409y16pw5PmLQ=; b=VL9qFctIsGB312rFR76hG8lkdfQsaFe30R/A2YNXom+arhp/VfLtioRslmLk6Z6TVmauGxVOjRm95pwkcamPXR/arRraUQYBxYlZjy4Fs7FaZE4jlgo/itf1OBXcAF/2NqBeSIOCN3i5TWM4RedIaaLB//2PQD0VbLvpP44iBnA= 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:39 +0000 Subject: [PATCH RFC 01/10] rcu: Make CONFIG_SRCU unconditionally enabled 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:36 +0300 Message-ID: <153365625652.19074.8434946780002619802.stgit@localhost.localdomain> In-Reply-To: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> References: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: HE1PR0701CA0062.eurprd07.prod.outlook.com (2603:10a6:3:9e::30) To HE1PR0801MB2025.eurprd08.prod.outlook.com (2603:10a6:3:50::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c85a468-862a-4fa9-3baf-08d5fc7bb60d 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:N3+QQcOPo3UoJ2bz+ZpDWjELIk8tEgZ//wGaiEaK0sIOTSoP/cXKg6PLfrKux7Yy8lkEXTRhyvNeg+Bv5O8CTS4VSgKk6T+A2JMpuBqejHXV/CCjCZ+CLIfglP6S5W529h82A35BQByMTuXGztB3iPSiZYdybQpJIKwR6UGDcJtCOPejfcG4AkW8fdATXlVOFYhKLbpBEqc0AOffTTFXTE0lyNS99DyLg0DXirp1VszrNKl8JcRUZFmho0omALXC;25:BdPCUy4ijZzlT4gSDP0ICAgh+LdG80zwla2Mr5ENjEBcdH6uBt4bSAJrkREReEbpVTYAN1UmShcgUiUfkUh5IefWZWacuoC2R8ikc6HZXuhW9cZLsN8ilBCQt/O/VqiCFqDigsJy5FMeNRHE0SYjqwFWN0pCPlkaO/TH9LmrM+aESRHwBstpeyee0e64z53dTcK5H1Ha4xRumjLo+FKKSefpitpHZGvT246/5HlVX5F5/McEwJQ0AETn0ctPhyuDq7zEPk9ulYzbVvosgG3rr2PhJfsiPw5G/PDblrwF8gGCiXIKeB/YRyzgt6FLAi1urhB6Kre8HMqzyl689VQtdg==;31:l30VJS8EUu3XdUiLfKgROzNru5i1uVtJiMJB5wIEpu9I9B3R2m+V2uujy5EwcJh4DXkM7D8xhvpo75W26NkWTvs7GQi8uQ0b9XV1PRcm7X9FQMTfs4JenxmKE0zUXcmZfTvYGR77OeaEh5Qff5t1gS9RIpiToGYsDpo2GIgX52FesB8Z4VqSYjHp0RsWIIEjX3ZRgc4/hm0l5TX6ab1B4E9IF6PQBcxsWEYy6JSwNQo= X-MS-TrafficTypeDiagnostic: HE1PR0801MB2025: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2025;20:07Vc/jlEVWSE9q0oY1cqhoMpBZX45iU/BA82Yf43NcDuuN6m9rHGy/AMuMAZLf5W9YnK11J8uAkNp+DfUlvkpYqg1mRGzRlGaKYeouBpG7zNkuzCRgEbR0do2MZrkPn26lN4qfYDHL4dlmJ+hVWRZIFV8PcUUXttOe+rkau8fuJQ8K5TJA+MFK4+RHjwh8FwixO06nscI+5WV2PfzJo7JJseDeZH15p+suTNmLxTnVE0MrDcxYmZble6ydqRSO0JzJalx/41nBPu5ISAabd3QC4mKn102e8+oDrCVXRjZLDONal0kMR9sES0WDI4t23hcoewE/NBFtEKPEM5y28D9u5xhhxpWPfOlCocwRCUSpFuwzAF3wBOr30D5emrXeigbRQMRWKwiVfE0cO+xSZj+PPw9izJvhSbalWIOQE8R/dkx43oTjFiNFtw1HHhKUfoZRdym7PTlsDckyWo9Vk95LldZf15sZ3RYf1JoOl8Gl+u6H/Ac+DANq0oeNGb18CS;4:1g73q+z4zUdX9AH5/BFGuStBpRELK0DhgAoEOuvwUJg3zJLsj+gkwPiknMTFYnziYz42Om09S3cSJ9RVjcvRNSVn3mKZBxE3oO2ojprLgx98JqETOC7nB3nLiFMSWI3LUi1B/0jEIA/I0XMBXKSU0iPqN7IgY+uhzXT4WvPvpMl8PaI7g2QPd05i/Mhhpr6i9w6/3t9O3MdIrF2a2JRpRoWwZfj0U7wYRMY5S+yFDjexxD5+Kv+ZWmjaycAYeSxAZFo3lqpGyp8qXIZ0VK9Zow== 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)(11346002)(446003)(7736002)(47776003)(61506002)(2906002)(217873002)(14444005)(478600001)(486006)(956004)(476003)(58126008)(6666003)(68736007)(575784001)(50466002)(86362001)(16526019)(7696005)(23676004)(2486003)(106356001)(39060400002)(6116002)(3846002)(76176011)(186003)(26005)(9686003)(103116003)(33896004)(25786009)(386003)(105586002)(52116002)(55016002)(6506007)(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=3AIyiDo?= =?utf-8?q?3lI7DUaydFdn7pnm0MMIbyq17SgnUAyoJp2EW1CG3XG6HsHDNri1PPvtl7yeRA5zD?= =?utf-8?q?QIG5D0F7lngFzHvmItKfe6cXazDnABtriJSyO9se/ils1XT+OQMf2o3LnoX3VOV3E?= =?utf-8?q?9cqYfJR7cp9J6JYNgNPLzhSyU4D2jsBIlZBx1NnxhYf2oBvrqdkm66xJj0FmWVXC+?= =?utf-8?q?E/+qW3BdSVp8ezzUjXfuyw6pH8bkI5rkxw9S4Hn6NlA1rqe9qu9D2ANPlXnn5vVUI?= =?utf-8?q?y6MBUPif6zF/NxJIn2I/Ts+Z/selBmEFJTWxy9mpWYGu/ssipMNMCXzAr4gYWVk3/?= =?utf-8?q?THS8wJ5csU+6fzYnBc7ywSSf2mwsIp+jyzxUzLsBU7tCbe9S/kd9Q/dgUOBONsOoT?= =?utf-8?q?0Zc4QFFKCxv2BCsNBSbYcIqRw7IddV63/ivBFBSjxdvJsq+tvvOyFk/BXjrRmoyoZ?= =?utf-8?q?2RpqPNOZf3w5UF7sEwPhDFjDflhXCMmYMTmBmM7o1LURa/8S7aWHFc2ZeohTjctvA?= =?utf-8?q?kCAb7TvHxffz9fiKbgFqd0xxfca+BrrEl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IPwL+xrfxq/30x1HIxTUimNVDot42bn0XSjDrj40ewsQRKn8BRPKLAXFAvoN4o6Bcj0uYQhA0plVdR5y1hKuLx2z1b0epb+6ibjaTmzkcq9MccOOQlDf2FDc6dx+/Pze/Az3TEk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2025;20:hI7OJJ+sqyjQUP2vyRFowQAb3Ku5bPqVOwqRNfEB6VeztthF2XwDBg2hIDQiqvhclKvA0J67wOlphpXILb4mtQyQSMOG2Lx5vrc038amE1YCV/ERAwcYQersNvyNwQ6abkJtqDp2ZzGBcOEg3pVVHlQOljfoHM+EJvwD5obK3vc= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2018 15:37:39.0065 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c85a468-862a-4fa9-3baf-08d5fc7bb60d 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 This patch kills all CONFIG_SRCU defines and the code under !CONFIG_SRCU. Signed-off-by: Kirill Tkhai --- drivers/base/core.c | 42 -------------------- include/linux/device.h | 2 - include/linux/rcutiny.h | 4 -- include/linux/srcu.h | 5 -- kernel/notifier.c | 3 - kernel/rcu/Kconfig | 12 +----- kernel/rcu/tree.h | 5 -- kernel/rcu/update.c | 4 -- .../selftests/rcutorture/doc/TREE_RCU-kconfig.txt | 5 -- 9 files changed, 3 insertions(+), 79 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 04bbcd779e11..8483da53c88f 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -44,7 +44,6 @@ early_param("sysfs.deprecated", sysfs_deprecated_setup); /* Device links support. */ -#ifdef CONFIG_SRCU static DEFINE_MUTEX(device_links_lock); DEFINE_STATIC_SRCU(device_links_srcu); @@ -67,30 +66,6 @@ void device_links_read_unlock(int idx) { srcu_read_unlock(&device_links_srcu, idx); } -#else /* !CONFIG_SRCU */ -static DECLARE_RWSEM(device_links_lock); - -static inline void device_links_write_lock(void) -{ - down_write(&device_links_lock); -} - -static inline void device_links_write_unlock(void) -{ - up_write(&device_links_lock); -} - -int device_links_read_lock(void) -{ - down_read(&device_links_lock); - return 0; -} - -void device_links_read_unlock(int not_used) -{ - up_read(&device_links_lock); -} -#endif /* !CONFIG_SRCU */ /** * device_is_dependent - Check if one device depends on another one @@ -317,7 +292,6 @@ static void device_link_free(struct device_link *link) kfree(link); } -#ifdef CONFIG_SRCU static void __device_link_free_srcu(struct rcu_head *rhead) { device_link_free(container_of(rhead, struct device_link, rcu_head)); @@ -337,22 +311,6 @@ static void __device_link_del(struct kref *kref) list_del_rcu(&link->c_node); call_srcu(&device_links_srcu, &link->rcu_head, __device_link_free_srcu); } -#else /* !CONFIG_SRCU */ -static void __device_link_del(struct kref *kref) -{ - struct device_link *link = container_of(kref, struct device_link, kref); - - dev_info(link->consumer, "Dropping the link to %s\n", - dev_name(link->supplier)); - - if (link->flags & DL_FLAG_PM_RUNTIME) - pm_runtime_drop_link(link->consumer); - - list_del(&link->s_node); - list_del(&link->c_node); - device_link_free(link); -} -#endif /* !CONFIG_SRCU */ /** * device_link_del - Delete a link between two devices. diff --git a/include/linux/device.h b/include/linux/device.h index 8f882549edee..524dc17d67be 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -827,9 +827,7 @@ struct device_link { u32 flags; bool rpm_active; struct kref kref; -#ifdef CONFIG_SRCU struct rcu_head rcu_head; -#endif }; /** diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 8d9a0ea8f0b5..63e2b6f2e94a 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h @@ -115,11 +115,7 @@ static inline void rcu_irq_exit_irqson(void) { } static inline void rcu_irq_enter_irqson(void) { } static inline void rcu_irq_exit(void) { } static inline void exit_rcu(void) { } -#ifdef CONFIG_SRCU void rcu_scheduler_starting(void); -#else /* #ifndef CONFIG_SRCU */ -static inline void rcu_scheduler_starting(void) { } -#endif /* #else #ifndef CONFIG_SRCU */ static inline void rcu_end_inkernel_boot(void) { } static inline bool rcu_is_watching(void) { return true; } diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 3e72a291c401..27238223a78e 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h @@ -60,11 +60,8 @@ int init_srcu_struct(struct srcu_struct *sp); #include #elif defined(CONFIG_TREE_SRCU) #include -#elif defined(CONFIG_SRCU) -#error "Unknown SRCU implementation specified to kernel configuration" #else -/* Dummy definition for things like notifiers. Actual use gets link error. */ -struct srcu_struct { }; +#error "Unknown SRCU implementation specified to kernel configuration" #endif void call_srcu(struct srcu_struct *sp, struct rcu_head *head, diff --git a/kernel/notifier.c b/kernel/notifier.c index 6196af8a8223..6e4b55e74736 100644 --- a/kernel/notifier.c +++ b/kernel/notifier.c @@ -402,7 +402,6 @@ int raw_notifier_call_chain(struct raw_notifier_head *nh, } EXPORT_SYMBOL_GPL(raw_notifier_call_chain); -#ifdef CONFIG_SRCU /* * SRCU notifier chain routines. Registration and unregistration * use a mutex, and call_chain is synchronized by SRCU (no locks). @@ -529,8 +528,6 @@ void srcu_init_notifier_head(struct srcu_notifier_head *nh) } EXPORT_SYMBOL_GPL(srcu_init_notifier_head); -#endif /* CONFIG_SRCU */ - static ATOMIC_NOTIFIER_HEAD(die_chain); int notrace notify_die(enum die_val val, const char *str, diff --git a/kernel/rcu/Kconfig b/kernel/rcu/Kconfig index 9210379c0353..f52e55e33f0a 100644 --- a/kernel/rcu/Kconfig +++ b/kernel/rcu/Kconfig @@ -49,28 +49,20 @@ config RCU_EXPERT Say N if you are unsure. -config SRCU - bool - help - This option selects the sleepable version of RCU. This version - permits arbitrary sleeping or blocking within RCU read-side critical - sections. - config TINY_SRCU bool - default y if SRCU && TINY_RCU + default y if TINY_RCU help This option selects the single-CPU non-preemptible version of SRCU. config TREE_SRCU bool - default y if SRCU && !TINY_RCU + default y if !TINY_RCU help This option selects the full-fledged version of SRCU. config TASKS_RCU def_bool PREEMPT - select SRCU help This option enables a task-based RCU implementation that uses only voluntary context switch (not preemption!), idle, and diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h index 4e74df768c57..b7f76400a45e 100644 --- a/kernel/rcu/tree.h +++ b/kernel/rcu/tree.h @@ -489,12 +489,7 @@ static bool rcu_nohz_full_cpu(struct rcu_state *rsp); static void rcu_dynticks_task_enter(void); static void rcu_dynticks_task_exit(void); -#ifdef CONFIG_SRCU void srcu_online_cpu(unsigned int cpu); void srcu_offline_cpu(unsigned int cpu); -#else /* #ifdef CONFIG_SRCU */ -void srcu_online_cpu(unsigned int cpu) { } -void srcu_offline_cpu(unsigned int cpu) { } -#endif /* #else #ifdef CONFIG_SRCU */ #endif /* #ifndef RCU_TREE_NONCORE */ diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index 39cb23d22109..90de81c98524 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c @@ -210,8 +210,6 @@ void rcu_test_sync_prims(void) synchronize_sched_expedited(); } -#if !defined(CONFIG_TINY_RCU) || defined(CONFIG_SRCU) - /* * Switch to run-time mode once RCU has fully initialized. */ @@ -224,8 +222,6 @@ static int __init rcu_set_runtime_mode(void) } core_initcall(rcu_set_runtime_mode); -#endif /* #if !defined(CONFIG_TINY_RCU) || defined(CONFIG_SRCU) */ - #ifdef CONFIG_DEBUG_LOCK_ALLOC static struct lock_class_key rcu_lock_key; struct lockdep_map rcu_lock_map = diff --git a/tools/testing/selftests/rcutorture/doc/TREE_RCU-kconfig.txt b/tools/testing/selftests/rcutorture/doc/TREE_RCU-kconfig.txt index af6fca03602f..b4f015c3244a 100644 --- a/tools/testing/selftests/rcutorture/doc/TREE_RCU-kconfig.txt +++ b/tools/testing/selftests/rcutorture/doc/TREE_RCU-kconfig.txt @@ -73,9 +73,4 @@ CONFIG_TASKS_RCU These are controlled by CONFIG_PREEMPT and/or CONFIG_SMP. -CONFIG_SRCU - - Selected by CONFIG_RCU_TORTURE_TEST, so cannot disable. - - boot parameters ignored: TBD From patchwork Tue Aug 7 15:37:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10558799 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 6723814E5 for ; Tue, 7 Aug 2018 15:38:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 543902A426 for ; Tue, 7 Aug 2018 15:38:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 480E12A429; Tue, 7 Aug 2018 15:38:01 +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 9A0D22A426 for ; Tue, 7 Aug 2018 15:38:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 903D66B000E; Tue, 7 Aug 2018 11:37:59 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8DA576B0010; Tue, 7 Aug 2018 11:37:59 -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 7C80F6B0274; Tue, 7 Aug 2018 11:37:59 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f197.google.com (mail-qk0-f197.google.com [209.85.220.197]) by kanga.kvack.org (Postfix) with ESMTP id 498066B000E for ; Tue, 7 Aug 2018 11:37:59 -0400 (EDT) Received: by mail-qk0-f197.google.com with SMTP id q3-v6so17103678qki.4 for ; Tue, 07 Aug 2018 08:37:59 -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 :in-reply-to:references:user-agent:mime-version :content-transfer-encoding:spamdiagnosticoutput :spamdiagnosticmetadata; bh=IOgHna0IjgNaMkcfTG3lH2LiLelmPRrnFUp70X32rg8=; b=I5BTcandgSyPbUuzkpe+r+dQUpG1GoN5sf0c8U9HIrYH0MIC55mSZSESwU8/1F87oQ VGGVoV6GGA8RQIattAGXEV39lupX0N6CQmSbwUFu2rVac79R7f5QVf0UoCUjnKg1wf2R UYJ7l381TNwLPFjd4ULXIvd0LF4QP9WCEgKNX8bm6oHSyBaSCjZykHZ6HhqpvLuj1mRz Grmqt6ADqle75MDhalJ4vpLM0tvy02CFFry/iiIC9+XYvnSTSf+3vEaEcXvbmifGCDBG MU+TbGClaUBVHX0/yle/FB9QVgX8yqA6rh2rw0qS58n9cQpKV3qXvTNuz+XNOe/6e0kv aJfQ== X-Gm-Message-State: AOUpUlG+hChWHR2Nr8MK9G7UIKnAQ96m8BzxdvEmOElrgmHaKOIAEgfW 7w8DCGDcQZgYTIdZ4RYRnW+6o//DiVPTeNpd4on48N7NRiLOD/nccxqIC8vqIAjBkSxj6VLoqNr xPkLXI278gSwJqBrJYRZ6EGOVrd6lChIMZYPKxjM3k8Bxw6E+xIpifhaPMMACJTZSsQ== X-Received: by 2002:a0c:f747:: with SMTP id e7-v6mr17226793qvo.96.1533656278913; Tue, 07 Aug 2018 08:37:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfoJArIQWSoeIUoaH31ZBP2DpoOOm0EfxKFFpJ2S43z3AjSAL1eGhhuKjqsDkE/FB4iINOl X-Received: by 2002:a0c:f747:: with SMTP id e7-v6mr17226737qvo.96.1533656278079; Tue, 07 Aug 2018 08:37:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533656278; cv=none; d=google.com; s=arc-20160816; b=oifWI5tXPWEf4G5mmiq3gn6LITDSXHC0fuzIt+OixaGvYE9/PwYexsceeB+BEd91gj eoM/9yYuJr26Sfim3evAtJ+phj6XJrzZ8jkuog5LqLlWuHH2Wjqko9AaXmBF5cs1GgVp sWdKOMI48iWBCYHpvkPhi9+diVB+Dmg+bOmRXYlAc6QsE1rA5D35vbgm4+WNOghmyvsM 08imIFi+dyhQR6Fma/PGHbFx2EKKv4n5dsDrUadA0GH3J5X0xLjDRXsQ1kBxvQA6YYFs /X1HiQkFAq+1gwQxz5bJ7JE9oUhNb38F3giEs2kq4VR+1wHok3QPUQB7/CSRN5RBMz1C qr8A== 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:references :in-reply-to:message-id:date:to:from:subject:dkim-signature :arc-authentication-results; bh=IOgHna0IjgNaMkcfTG3lH2LiLelmPRrnFUp70X32rg8=; b=o1yr16E130pdXt6EmQCZWnfVYDtvN8el32GpSltYR+zFN2I7R+DEIUua5/kiYhffpX 0dff+d54WEeWCNKrKj2ysYUJkJHa2qHvSuB8eB9vTajPlSX7jYqvv7OCxUKXMLfktDLW wQk4eARdEIewff3UiESno+tfSISobIs3tGyKc6h1lLHnWhxxfU4I7w91UA5JLem6kYXY YWN0607Q6b5GBfls2r1qlicsj+a4Muim94YcOSy7lo+Z0ODZ4PfHE4OtOH2ozyO2e7Ab qYXwBZygapw84DdRYCHJAGELtfoZeG+aBiU3hUZ5nk/1Zc+ctQe7JRNgddAcbxZL7UUz Jyxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=FXqBnciJ; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.127 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0127.outbound.protection.outlook.com. [104.47.1.127]) by mx.google.com with ESMTPS id m81-v6si1480353qke.299.2018.08.07.08.37.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Aug 2018 08:37:58 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.127 as permitted sender) client-ip=104.47.1.127; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=FXqBnciJ; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.127 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=IOgHna0IjgNaMkcfTG3lH2LiLelmPRrnFUp70X32rg8=; b=FXqBnciJoI192137vBDlbX128rGMK68+IF9JW+o8GdPomPVZmQiUbXOkEvJAyoJrF2CfUMxrcdGiHA5r0u+R8WCNiOzr8rOwfNwDbjEYbXwa4h0G4HljOIBO5iNdMUzOctjgnGpQj+PedxzeR2xcuPwMb/rvrE+NhEqer9iTAKc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by HE1PR0801MB2026.eurprd08.prod.outlook.com (2603:10a6:3:50::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Tue, 7 Aug 2018 15:37:50 +0000 Subject: [PATCH RFC 02/10] mm: Make shrink_slab() lockless 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:46 +0300 Message-ID: <153365626605.19074.16202958374930777592.stgit@localhost.localdomain> In-Reply-To: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> References: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: LO2P265CA0164.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::32) To HE1PR0801MB2026.eurprd08.prod.outlook.com (2603:10a6:3:50::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 679832a7-3215-43b5-fe22-08d5fc7bbeaa X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:HE1PR0801MB2026; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2026;3:SGApD3x/zPMVBpLYc2HjeYF1T9qt1J58SZ83TLV2FOa8bED4wE9QuUuwL6ZY3g5bH8hq0eOt+t0p/lGIndvxYiYXs+0pSbYrcQIem18kuqpVgo6TKrz8ai6LS5GNAGLGIDsJcv9o6E78c2BgxM5szuestHVE3vXV0sHyfpLzq206Ft8LG+Sk4kQpxQlmQX4EvdyxcMs/wq3NUT7P/yYqcHOL1iNr75eGuyug0wgp5rrIvpsrCdpFQa7DDVvoZXLx;25:DTMTrlSl/4trqRgA6h0vG75bXkH5Nt4Gga5sB1mGeH/slK5A/aEIuOH31eMhaLQTjBzcrOu5HYo4tkKHE7uQV20xz6sAnPVAZnoM3PPASYn0ez04keffS0y5VQaW5ca9+E5lFhkGTiulZh5Mjqv2PFDO2plLjKUjc+0c53M+gnl9/glhGNNzt7cl0g29+zywp1+9HDVSkeJcBolQM8xuGPjf8YU45+79wkWzsnwhWK0dwpLmTR0AyFoPcOtO2UlW3CgfcJqilhmMCi6yI3zcyCnszs7YMPFxvnoGioH+jIyd90p2A/OkO/JqRjdYaNyr695bVg6YuYdq9yciDsQtuw==;31:6dGbsOQbxf7P2y9yJ1ZpRWVs7Ehy2GJEOUCVn5tPlIyExISRz6sL5rn/gJkDhwAZWmAEXqVH98bfpqBVCPWOyJ6K54jVKknP8O8ad1wzKah8gJLG8h0iWcubL3vsYKS92i8f8E0rKBm/aplTubkRpFJfau3GR2xr07SnF4vCFM9c6bhcUJVIEaEMoJgjwWLYh7BFov2O4GU38nooqKVBYYiHV+PZeCvtsXvbiIJQUNo= X-MS-TrafficTypeDiagnostic: HE1PR0801MB2026: X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2026;20:Sztlz14lFFUdc0cIE9eINNcqJp0eKEsbCXmDbbdDXc72V3IVDJ/rlPZsArYUhdmnXqQtZSoZwt3I1ZPBQIpEVfVtbOXNstdjJZZ2+lvRiQpyUQxBp0YNpg7OqJIqX+L2PYTKTC2CaBPPR5pIcDXrUnZA5MfhM/M5l+pmQVVVXz4X2Ov4GDkUrXg2ut3GbfRnkN94fo8Dqtrum6Pp34duzsuCYT0A8PVOucaupJdAwt2SFYu/I3M0kIVi7nhj2X/00ONZCaxF72xvRFcr1T2w/zaox3wOjuMyOOoVbVLgMkUkucZHCesy2uC6bzCyAksPIZOBqU88OXBN2ni2XcAMaAtz4mos62DxWfU/Tdp85ld88axaj/SCvUnEscc99HT5KjzcXUeOoCH62QQL9nNKqkBJ6/mCpAYp2qOasbOmRI9Ftkp+KKLhF+TdpC1pm2HSKeJ21ogKZ9o1QfEZ/kWPEgw2N/IhlNOzl9SoaoM5JtVZ/NLK5OKipCphc8a/+b9u;4:m8yV8XhbFiyl9ZCqI66IDfQriCkHTYRJjx5roZ6L53Wg/EG3TxnTgZYH5pljYlD+7c6SIRhleBdo6ckMAdJbW8shaKkxMS/wf+i3hvKOIxuGNwsQFD7s7ltK8JbDrzRxsmLDLiIT8v0x6sBf3uzHRTtx+/VyuOFZXo9tBQDJLitSZRpi6BCOlWrmFXhzL4caX0L+xHhsxzIJsMez/A8jAmX2i0FbmVNmfGZnQ3qtOupbGAelAAz3bYRzsDiTNGiefcO7B/wiMZQadEWKuSdaJA== 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)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:HE1PR0801MB2026;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0801MB2026; X-Forefront-PRVS: 0757EEBDCA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(39850400004)(396003)(376002)(346002)(366004)(136003)(199004)(189003)(55016002)(105586002)(7696005)(97736004)(3846002)(6116002)(23676004)(2486003)(230700001)(25786009)(106356001)(47776003)(14444005)(66066001)(52116002)(81156014)(9686003)(8936002)(103116003)(8676002)(217873002)(81166006)(76176011)(6666003)(61506002)(316002)(53936002)(305945005)(5660300001)(68736007)(476003)(2906002)(386003)(6506007)(39060400002)(478600001)(26005)(58126008)(50466002)(33896004)(11346002)(486006)(86362001)(446003)(956004)(186003)(7736002)(7416002)(16526019)(7406005)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0801MB2026;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=3BHE1PR0801MB2026=3B23=3ANt2OV?= =?utf-8?q?gvfoUetPD4f8OLMoxW5NZ1bntV69T3elaQq2Wmq9eoBQaaBL7c6vuimeN9+Q6t3wV?= =?utf-8?q?e24UZBMNK+/6Ka5basiIZgxlDdRine99OL4Lj+yZAfvrxVQIBZalQQdS9Wzul1lz4?= =?utf-8?q?0q7+Ydsb3XujrSNj+YTbA4BtVwrTV5SGaIPA7LMyhBqQfBMNXxWlc1b0msKq+/njh?= =?utf-8?q?edgwMfphK1Jk346XbSpjfIDALqH9SYcpe5tu9QG87bSp84p6paoEeVGLvQRdD5ylP?= =?utf-8?q?RTxW+fTKwKnuRHsMiNXP5wsjPq0SRYM7Yn6VywME85KtO+UHiNN22QUcELHj/cR5b?= =?utf-8?q?MapxcbLk9eAHvsIZn6RxynivXtJDN0ytQ1kw2Fws/HrDuks1y89+1j7KTYtymH+ds?= =?utf-8?q?JZgdxO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+tU=;7:C8tZiZRNhi/DyMz2yN4GOcupIPloblHlpZaH8oLIEmohrq/tFOHWqWn2iUnuRbuArz/ngWg0q51AgrUcx6xOeUwhttIxNCsEVB/v6mgPKfNy17NZDAKyTon7REi02HDu9V2OR2TLN4HF+y1J/GVMiVfUO7trpbiRSpCs10rz2q9ZZjF7JOSz6ylZ6c3ugeTRoEn6aGxhwlAwzrWJnsJrDqgazsPis1YuK9SnO3lu5/zLGtw7DbUfM8D8M03QoHM4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2026;20:LrQHlzuO4ScRNp+WX0KrOLhI3m17GrFfUcUmpJgpeH2Umo2/L1+eSWmRGeDp3BcbId7L32gt3I7inGyOavULUXGFiihsz6xzGcx5H91AE1fsk1zPqNreXeAlll6Q0hncBrYQeCiQ5tSXtIZid8nAqapkk0X9wmiNl7O2YV3F/iI= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2018 15:37:50.5971 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 679832a7-3215-43b5-fe22-08d5fc7bbeaa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB2026 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 The patch makes shrinker list and shrinker_idr SRCU-safe for readers. This requires synchronize_srcu() on finalize stage unregistering stage, which waits till all parallel shrink_slab() are finished Note, that patch removes rwsem_is_contended() checks from the code, and this does not result in delays during registration, since there is no waiting at all. Unregistration case may be optimized by splitting unregister_shrinker() in tho stages, and this is made in next patches. Also, keep in mind, that in case of SRCU is not allowed to make unconditional (which is done in previous patch), it is possible to use percpu_rw_semaphore instead of it. percpu_down_read() will be used in shrink_slab_memcg() and in shrink_slab(), and consecutive calls percpu_down_write(percpu_rwsem); percpu_up_write(percpu_rwsem); will be used instead of synchronize_srcu(). Signed-off-by: Kirill Tkhai Signed-off-by: Kirill Tkhai --- mm/vmscan.c | 42 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index da135e1acd94..9dda903a1406 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -168,6 +168,7 @@ unsigned long vm_total_pages; static LIST_HEAD(shrinker_list); static DECLARE_RWSEM(shrinker_rwsem); +DEFINE_STATIC_SRCU(srcu); #ifdef CONFIG_MEMCG_KMEM @@ -192,7 +193,6 @@ static int prealloc_memcg_shrinker(struct shrinker *shrinker) int id, ret = -ENOMEM; down_write(&shrinker_rwsem); - /* This may call shrinker, so it must use down_read_trylock() */ id = idr_alloc(&shrinker_idr, SHRINKER_REGISTERING, 0, 0, GFP_KERNEL); if (id < 0) goto unlock; @@ -406,7 +406,7 @@ void free_prealloced_shrinker(struct shrinker *shrinker) void register_shrinker_prepared(struct shrinker *shrinker) { down_write(&shrinker_rwsem); - list_add_tail(&shrinker->list, &shrinker_list); + list_add_tail_rcu(&shrinker->list, &shrinker_list); idr_replace(&shrinker_idr, shrinker, shrinker->id); up_write(&shrinker_rwsem); } @@ -432,8 +432,11 @@ void unregister_shrinker(struct shrinker *shrinker) if (shrinker->flags & SHRINKER_MEMCG_AWARE) unregister_memcg_shrinker(shrinker); down_write(&shrinker_rwsem); - list_del(&shrinker->list); + list_del_rcu(&shrinker->list); up_write(&shrinker_rwsem); + + synchronize_srcu(&srcu); + kfree(shrinker->nr_deferred); shrinker->nr_deferred = NULL; } @@ -567,14 +570,12 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid, { struct memcg_shrinker_map *map; unsigned long freed = 0; - int ret, i; + int ret, i, srcu_id; if (!memcg_kmem_enabled() || !mem_cgroup_online(memcg)) return 0; - if (!down_read_trylock(&shrinker_rwsem)) - return 0; - + srcu_id = srcu_read_lock(&srcu); map = rcu_dereference_protected(memcg->nodeinfo[nid]->shrinker_map, true); if (unlikely(!map)) @@ -621,14 +622,9 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid, memcg_set_shrinker_bit(memcg, nid, i); } freed += ret; - - if (rwsem_is_contended(&shrinker_rwsem)) { - freed = freed ? : 1; - break; - } } unlock: - up_read(&shrinker_rwsem); + srcu_read_unlock(&srcu, srcu_id); return freed; } #else /* CONFIG_MEMCG_KMEM */ @@ -665,15 +661,13 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid, { struct shrinker *shrinker; unsigned long freed = 0; - int ret; + int srcu_id, ret; if (!mem_cgroup_is_root(memcg)) return shrink_slab_memcg(gfp_mask, nid, memcg, priority); - if (!down_read_trylock(&shrinker_rwsem)) - goto out; - - list_for_each_entry(shrinker, &shrinker_list, list) { + srcu_id = srcu_read_lock(&srcu); + list_for_each_entry_rcu(shrinker, &shrinker_list, list) { struct shrink_control sc = { .gfp_mask = gfp_mask, .nid = nid, @@ -684,19 +678,9 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid, if (ret == SHRINK_EMPTY) ret = 0; freed += ret; - /* - * Bail out if someone want to register a new shrinker to - * prevent the regsitration from being stalled for long periods - * by parallel ongoing shrinking. - */ - if (rwsem_is_contended(&shrinker_rwsem)) { - freed = freed ? : 1; - break; - } } + srcu_read_unlock(&srcu, srcu_id); - up_read(&shrinker_rwsem); -out: cond_resched(); return freed; } From patchwork Tue Aug 7 15:38:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10558803 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 C710914E5 for ; Tue, 7 Aug 2018 15:38:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B418E2A425 for ; Tue, 7 Aug 2018 15:38:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A77082A464; Tue, 7 Aug 2018 15:38:15 +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 1975A2A425 for ; Tue, 7 Aug 2018 15:38:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 314046B0274; Tue, 7 Aug 2018 11:38:14 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2C15B6B0276; Tue, 7 Aug 2018 11:38:14 -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 186C96B0277; Tue, 7 Aug 2018 11:38:14 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by kanga.kvack.org (Postfix) with ESMTP id ADF736B0274 for ; Tue, 7 Aug 2018 11:38:13 -0400 (EDT) Received: by mail-wr1-f71.google.com with SMTP id i16-v6so14277601wrr.9 for ; Tue, 07 Aug 2018 08:38:13 -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 :in-reply-to:references:user-agent:mime-version :content-transfer-encoding:spamdiagnosticoutput :spamdiagnosticmetadata; bh=E7jHJUl1lc3BUVao1mtGPcK2ZJN1Fh8IXYergT6SrkQ=; b=ANrsVZFiKqmvVR6N5i/EpvwUHBwuWZz5r0S4vN4GmWA2NKAE/Yl/Eq5PC9mExxF9MI QdANmen/yxo0Fdv/8CkI+5A0WAcu8fIfYQGk3BQKLDgT4/TD1i+ZrpgnsN9OssBNFeUs OzfB79VBt6kyoL0y5+RCmNfSNfZ1D97f30MrokffPUtQP5q5i707aTqA4j6+cyrEq5YT HMuraGbwUNomeSB2w9qgMThv/ghhQzTDAyhHjz8pxStYhUxvLk7eXavtXBcPsguMFFDd qAeD3fWoAWZ25vbnP0M7dzjzab8eiwZ2XEceJHTaCsI2ZDZxpiqktMHfSOgNIVvggu0s n/Ww== X-Gm-Message-State: AOUpUlEf+r+jTkw42xLVLaxazQ+9XC1qgXaiRWJIln5eGdo7MEI6v16Y genKqSsmRqUgLKx9JJVvYWiH+UBBGo6RMtdpmTazjQq5ToajeUMZheYujrjJyXOZFWDdkcgddWM o/lFNZRHQCxR79reJjtcCz1sLJ3Hbs2goiC7umQVeLCEWrqRou2mKZnOhF+LQOfGsbA== X-Received: by 2002:a1c:64d5:: with SMTP id y204-v6mr2018582wmb.14.1533656293151; Tue, 07 Aug 2018 08:38:13 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxQFVqndE/Hiratj+KN6l5e+3WMyOrN24EKLk7F7veFQ/GDZG2WqbGDiB25iTZw2tfrAj7S X-Received: by 2002:a1c:64d5:: with SMTP id y204-v6mr2018541wmb.14.1533656292349; Tue, 07 Aug 2018 08:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533656292; cv=none; d=google.com; s=arc-20160816; b=KjEIjZsqgHm4uB1HrZISVqt2xC4g0L7EcenIImbe9PxqxFJKWnIEIocWO8KSCEDjGZ r4OeXNFRMmRf40SdtxOfix476LwCs82vD4p7Ba6UcAlMV3pfNRWevrOku0oFbFBCME2A 91EWjgpesWG5oxJWvyuGsKXRl/ubVj6DOEzY7ZymitCHivKwIdr4OqIryP92gJ1OYyD4 LRji7zaJSYmmgz3M4a3yx7hMYJm86wgGuU7EvL8rq9SWobyIgNd4mIOesBmdAQDvcMZ+ DsjJZxMNLYZ1ud+aw2FCMwI0W+cJ/Uz7n6jUjy5LezIqR2sm2QyYLE8q66q05tXbF1pu ZNCA== 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:references :in-reply-to:message-id:date:to:from:subject:dkim-signature :arc-authentication-results; bh=E7jHJUl1lc3BUVao1mtGPcK2ZJN1Fh8IXYergT6SrkQ=; b=bj6cIll+4AsySH5F+2UqCKN9YIJMfaaQVQkgNP/JhqgYZlwdqoxB1IIVP/pKfMl2kC DEcE4aCeIFmlT/BV0qgzOQSXz9wA3HmnkloZT2TQGJ92pCTafSZ43nbpU7r/bY2+fzeg tL5xoxXhVENJOmrK2CWkeO2g+fSgW6ZQwh0yOonWXGB8Qi5Cm7R1b+gAX6/h55l9kOCX 1KrO97EK4QjfBN+LpRA6wmlO5RD13ANyGTMt2szxHNvbnXF65rYgDp/+THE9287Ohhzr rNmoC4yjZ3p0qXjsNGRA8RAu5Cwg4KC09HV7gi2llRQQAYN75O+mwpb3MaCdp2eXTRwD SpKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b="Z9jr/qGX"; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.4.105 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40105.outbound.protection.outlook.com. [40.107.4.105]) by mx.google.com with ESMTPS id k1-v6si1554722wme.46.2018.08.07.08.38.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Aug 2018 08:38:12 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.4.105 as permitted sender) client-ip=40.107.4.105; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b="Z9jr/qGX"; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.4.105 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=E7jHJUl1lc3BUVao1mtGPcK2ZJN1Fh8IXYergT6SrkQ=; b=Z9jr/qGXKvbVQDICc/oUuACt/klkRQy9bZImGLH+C/8BGn1dOW3heNsWVf+TBBg2aYmLeKc0pAWNJbvLXE7B9DbzlNDE3qUu0z5O2JjBmdBFzmHO32n+eexG7MhZWakFzKAMdagmZeqItmtBpp6PoQnelA70N3+uhjn4RRzXusw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by VI1PR0801MB2031.eurprd08.prod.outlook.com (2603:10a6:800:8b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Tue, 7 Aug 2018 15:38:03 +0000 Subject: [PATCH RFC 03/10] mm: Convert shrinker_rwsem to mutex 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:38:00 +0300 Message-ID: <153365628066.19074.11561153370778563231.stgit@localhost.localdomain> In-Reply-To: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> References: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: HE1PR0701CA0065.eurprd07.prod.outlook.com (2603:10a6:3:9e::33) To VI1PR0801MB2031.eurprd08.prod.outlook.com (2603:10a6:800:8b::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1f5a6071-f4d4-4df1-2e42-08d5fc7bc599 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:VI1PR0801MB2031; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2031;3:wC1Ak5LGoD5+LOhgASazwwFvf4+Winewb//x1LEdGx/zYiz6nvqQPCRC0drX16/LGeIU5hYp+igZCc3I7vuvzy2bVP/8Nb3VklJlF+KiM2wivPCM3cqM95+OvG4M9rIiA8asIwEyEqYfLWhpQf3CWgiuxBbo22yLaz0YV6ubzRf0jWJcTOQE/yTktzOf67lWjsypeyUyAbYXo7BiZM3lLPyXIiXPVXoTYK6oMwFPbDTAIk5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tRE08WQsxRBNPHCiQaFbQttT0qcG9fhHhKdbzagu3hHhvyLkNFgTixAYLwdRl58jMzLsw4uk5Fd6hyko522X+BV5cDZxjd;4:gT20+UFzBxMZ2jmy15wsyR2TOPPztonLA0kFdcnTzT8opka9J4xpoK+yc7hmjB4Xk76etdzRSMvyfUU1goF5uBj67e3YLMC21a7srorrR1p++wrqewig8pUefp1HLcRRIygnPYpctLAG041JdWECA/1sl4Y7ALdm6FL4yGoaCkeVn14lDuWhWZWXh+fsf6UbDUyjeJVO2/xSESRHfU6wkxPmirzNGGGA/mEb/l1xmqV7HAIzLyhrCcpLXc12uJFYfgCwrYrxXeTDLqAZyYvT1Q== 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)(3231311)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:VI1PR0801MB2031;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB2031; X-Forefront-PRVS: 0757EEBDCA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(39850400004)(396003)(346002)(136003)(366004)(376002)(189003)(199004)(66066001)(14444005)(5660300001)(7416002)(8676002)(186003)(7406005)(16526019)(446003)(55016002)(26005)(81166006)(81156014)(8936002)(305945005)(39060400002)(86362001)(68736007)(9686003)(7736002)(53936002)(217873002)(25786009)(230700001)(476003)(316002)(956004)(486006)(76176011)(61506002)(6116002)(3846002)(97736004)(33896004)(478600001)(2906002)(6506007)(106356001)(50466002)(11346002)(23676004)(47776003)(103116003)(58126008)(2486003)(7696005)(52116002)(386003)(105586002)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0801MB2031;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BVI1PR0801MB2031=3B23=3Ahl6v1?= =?utf-8?q?uOcMxblEq1mpN+3TPYeMUcu7F84oFLbOqTZt5QdfOxvFWqduF4VONX/rKCUckaXc/?= =?utf-8?q?8Rl5bWMSmirSLyUsrnR3kgm2AWsoebStfSbL/21tWXopLegQd1SIEQr0UdWBhygNZ?= =?utf-8?q?1HMZo2rVWxFcQK5lGBB/rJjx28IXP0hM62SJ7Ku6EEM01eWc0baxlL4qaXYBf2hdG?= =?utf-8?q?WIn7rwLXirRE0XdQcOSV2vbfmgGKTfS3VdurnkpUrOH5C0//hpP4hWRE6BcvYVDTw?= =?utf-8?q?lHGMADz2b5s7lOKCBsK6hhz1qPxjw6d+64p8rVzC0js+LHJeHo5/qy4s9gw5bXsdM?= =?utf-8?q?5fpmCHGa2lnpSF+ksEu08JU2p1m4T0vy9OnphRnNUrwwg6vR1AUIipU2fGxNr/NH/?= =?utf-8?q?Q87ImCMJgGd0VgPpCFmdUdMomP74knNI4GbfMFX6cdW0Gg2y1kpPQodpJlC+bpWhu?= =?utf-8?q?qXn5fb1SRYZ06/wiygbPliQeJIJ9f60mZwh9wzoarNyryDyvWKXXaTVKcOkBy+Il5?= =?utf-8?q?6oYkoBc8UQ5lomqX8R8nn8bc0IkK9Z80jQxTITrgjmpAZ3aLdBw7kfRUpbiKFD+WP?= =?utf-8?q?OYwrcxtx7qmpWAOMGmAUG8dXuoCP57Nl34NtoeWO/RCDHXNN0T8xOWahxgPom6NJn?= =?utf-8?q?TIPE19KOSmZ+f10ATiSB7qtvqURf0/MC4n3L1R38ZQEislGJTk47SbjGaqxWUcHYT?= =?utf-8?q?DN67ElHI7Mt2ZDfLnGkH66FRth8BU62XYNkQPlmrbvz57gEY6DmW2Jer2t+HDcBF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BA73jUd2GodQYgQ1AcMbiJyf64X3WDvyT0NFzUdPgKCYGb8DnADNkLBO0ufZWkbKVVN2cA5VF7dICWDWXw= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2018 15:38:03.6852 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f5a6071-f4d4-4df1-2e42-08d5fc7bc599 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2031 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 There are no readers, so rwsem is not need anymore. Signed-off-by: Kirill Tkhai --- mm/vmscan.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 9dda903a1406..2dc274a385b9 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -167,7 +167,7 @@ int vm_swappiness = 60; unsigned long vm_total_pages; static LIST_HEAD(shrinker_list); -static DECLARE_RWSEM(shrinker_rwsem); +static DEFINE_MUTEX(shrinker_mutex); DEFINE_STATIC_SRCU(srcu); #ifdef CONFIG_MEMCG_KMEM @@ -192,7 +192,7 @@ static int prealloc_memcg_shrinker(struct shrinker *shrinker) { int id, ret = -ENOMEM; - down_write(&shrinker_rwsem); + mutex_lock(&shrinker_mutex); id = idr_alloc(&shrinker_idr, SHRINKER_REGISTERING, 0, 0, GFP_KERNEL); if (id < 0) goto unlock; @@ -208,7 +208,7 @@ static int prealloc_memcg_shrinker(struct shrinker *shrinker) shrinker->id = id; ret = 0; unlock: - up_write(&shrinker_rwsem); + mutex_unlock(&shrinker_mutex); return ret; } @@ -218,9 +218,9 @@ static void unregister_memcg_shrinker(struct shrinker *shrinker) BUG_ON(id < 0); - down_write(&shrinker_rwsem); + mutex_lock(&shrinker_mutex); idr_remove(&shrinker_idr, id); - up_write(&shrinker_rwsem); + mutex_unlock(&shrinker_mutex); } #else /* CONFIG_MEMCG_KMEM */ static int prealloc_memcg_shrinker(struct shrinker *shrinker) @@ -405,10 +405,10 @@ void free_prealloced_shrinker(struct shrinker *shrinker) void register_shrinker_prepared(struct shrinker *shrinker) { - down_write(&shrinker_rwsem); + mutex_lock(&shrinker_mutex); list_add_tail_rcu(&shrinker->list, &shrinker_list); idr_replace(&shrinker_idr, shrinker, shrinker->id); - up_write(&shrinker_rwsem); + mutex_unlock(&shrinker_mutex); } int register_shrinker(struct shrinker *shrinker) @@ -431,9 +431,9 @@ void unregister_shrinker(struct shrinker *shrinker) return; if (shrinker->flags & SHRINKER_MEMCG_AWARE) unregister_memcg_shrinker(shrinker); - down_write(&shrinker_rwsem); + mutex_lock(&shrinker_mutex); list_del_rcu(&shrinker->list); - up_write(&shrinker_rwsem); + mutex_unlock(&shrinker_mutex); synchronize_srcu(&srcu); From patchwork Tue Aug 7 15:38:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10558807 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 94760157D for ; Tue, 7 Aug 2018 15:38:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80E682A464 for ; Tue, 7 Aug 2018 15:38:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73F302A46E; Tue, 7 Aug 2018 15:38:25 +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 C48982A464 for ; Tue, 7 Aug 2018 15:38:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BE8CF6B0277; Tue, 7 Aug 2018 11:38:23 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BC0A66B0278; Tue, 7 Aug 2018 11:38:23 -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 A627D6B0279; Tue, 7 Aug 2018 11:38:23 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f197.google.com (mail-qt0-f197.google.com [209.85.216.197]) by kanga.kvack.org (Postfix) with ESMTP id 78F0A6B0277 for ; Tue, 7 Aug 2018 11:38:23 -0400 (EDT) Received: by mail-qt0-f197.google.com with SMTP id g7-v6so13743587qtp.19 for ; Tue, 07 Aug 2018 08:38:23 -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 :in-reply-to:references:user-agent:mime-version :content-transfer-encoding:spamdiagnosticoutput :spamdiagnosticmetadata; bh=KHhaKK0koKcZB5yc5yD4q+dXe27lzN4IMJnbu8sfryo=; b=OZ2xBWutFwbmwL9hvYLXWz7LtFBWgSEW69hRlqPGA9hSwJo9pVhZ6zdhDE1thUh42I ueit6NHUOdbU8kjMbZ3Cyu+ziqT5qXnRc2fVrWXzUL7NNQu5tHjjP9uMKJTTxPE4BsOw lffezVYYPnzs7JQ4qHG2h07ItiWtoQfP+XiSeTDbWFV15baFurnugLITCKLZnIwJmdmH s6Kpk5tt4YTXTRZBRPU3wVk7HLmotWlmneX746qy8pstw8Se3i43ru32VEHWPHU4E37D L8Li6MuxZMrNCRfocaQRnXr5BhFZymIIv3iz/plUYqS0RCKVY/nmAKB50+9oX2ykdhpE tzTQ== X-Gm-Message-State: AOUpUlHDEATZDyybC0OjNTHQFrlMSxn+CaO+Oz8uXnV/RsJLIvnwNSFF IQ51mQRSNQ1im2BXFUB74KMvJ6iU6LTMe/mAvuNI6dTNUEQULlcvQXz7J5DnGqv0MbkWlnyZFTJ qQ2+cjNmqiPdsKB47Dvmo6ImjGSTFqDZ0q9DBNF5QFPrhRYSMHXvKe+7+9ltXKrD6BQ== X-Received: by 2002:ae9:eb04:: with SMTP id b4-v6mr18481644qkg.272.1533656303261; Tue, 07 Aug 2018 08:38:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeaFzRPCHY1gsSWTxd3OToIFnXeBIDTj8MAoce4A7OVlziNjquKxkzh0120ljD4cDucK6if X-Received: by 2002:ae9:eb04:: with SMTP id b4-v6mr18481598qkg.272.1533656302579; Tue, 07 Aug 2018 08:38:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533656302; cv=none; d=google.com; s=arc-20160816; b=S2ABOxJNezgwtXR3qpJ09bdKFXTCOnaKTRZ3Du0P3301KuINXxWKNT2e0iy7nShyo8 5hzVSjmG9BX6P2kDkiohE+BvRV+bwCS8eQpSnzwciil2oOejds0Y/W+sCiE6MVA91+OL Qg4DEDtId48QuppzsHhRwG4xNeXsmK+VIkCif3RSpVJfesXGVIakz5eIw4JijCmVYDtJ bLe1+PHeeIxGn3JAmKds0LMB17c9cmS+WSSbHj6PdVC7lKXqFlm0mIv9CZ+MjAILa8qT z5Ui3PQ4oTdcljnylsdYQ7o+6wdfNC4y2ul7RF9PtXCDYUefXfk18iLs02mW+H+njU9+ Xo/g== 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:references :in-reply-to:message-id:date:to:from:subject:dkim-signature :arc-authentication-results; bh=KHhaKK0koKcZB5yc5yD4q+dXe27lzN4IMJnbu8sfryo=; b=B8g8lignWN8LYL7SpjigEWnRxzdgnWpadqL9ZdpISmbqC/xzt5bPN7NsWzUhqD76QJ 6QMovUOrJ11+zMOdSu8wZb+a4QKvDV5nypTm+TsKnWJJz5UznrZomx8IH4tG18ra0cix vW7d47iTODk8V4Vjb2qN7y6SGg2uYqNi8i61U9sygONxO5Cg/RxFKqB0R3lQC36cwgJZ LB/f8TuV5aCVXdBg/uqcXczaXVZl74A6UsYcvLubTMKwoZ+UTr4OrWBqZlPk/uNtSSA2 4gn7O/vWVtn3cjS+IEFHYWXYjMk5L3q3izN+Wbr3OEIvaJ5cp3J919dlJqjJiIYePvFN njZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=NvZYqm3R; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.4.104 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40104.outbound.protection.outlook.com. [40.107.4.104]) by mx.google.com with ESMTPS id e64-v6si1530383qkb.255.2018.08.07.08.38.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Aug 2018 08:38:22 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.4.104 as permitted sender) client-ip=40.107.4.104; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=NvZYqm3R; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.4.104 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=KHhaKK0koKcZB5yc5yD4q+dXe27lzN4IMJnbu8sfryo=; b=NvZYqm3R5ZRyUy/fhsA7+bAZmeal9lo6kN5g7RnWoNlBNxFSELkWKbUxGb9E4Lh6EhC46j8NQXIclX/wcqC0Ay0SZfSuKmQqLrqCA0dqmsyJ4I49SQO1nFTWei0qzEtVafHLC3B7TtbijUhId8PYessrW29JUPOBR6l0QyRxaNM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by DB6PR0801MB2021.eurprd08.prod.outlook.com (2603:10a6:4:76::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.14; Tue, 7 Aug 2018 15:38:15 +0000 Subject: [PATCH RFC 04/10] mm: Split unregister_shrinker() 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:38:12 +0300 Message-ID: <153365629257.19074.5257843346605031007.stgit@localhost.localdomain> In-Reply-To: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> References: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: AM4PR07CA0006.eurprd07.prod.outlook.com (2603:10a6:205:1::19) To DB6PR0801MB2021.eurprd08.prod.outlook.com (2603:10a6:4:76::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bf64a4f9-e62d-4738-0b7a-08d5fc7bcc24 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:DB6PR0801MB2021; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0801MB2021;3:Jjhg9hl0PGi28VW6MlST5xLkv/Ty7ADCqvbMngxBQu84Vwzr5Zaera4aOmMK8iAJJ29Sk7G8HXByex7QxY8L7BhwxZcF0IRm1iaYMEtfrwaqwEN3l6ZuFTrYY5zG4YY5ZJVJynqYXNOcW7hZk4TeaE3q95gGt//1SaCDIE8PHHojQ8TrvXs4cC7wQ9niW+6zRoTKKuxuK4mYC2mo8pNaIbC+fgEMUe8Nlm7ieVWO7fiyGyZVeI0c9cj9qrue3LL+;25:KFMPtMMXE3FX+W0mdlXXrY/w7UqtEt9D86fJsKvfYGbUP0S/nzJQ1qDuuSdqAmKojfuVBe29d9zFuWCDQabz32/97+WwyN2n299boCE+KuI6InZ6avMpm/+Dpo2ReeBW24SHv2U5iO58RVoPWOSpOinvEuMjzHc40y58127oMjDbmJNMQzaj73A+hBLI7o+ZmHekMUej5eXAqHYiQcwMk15yQSV54rPGWu0VAKO4uaQiQ+qEG+OhKzz0UWk0NXaDAvJ5p/uiYDNzo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QIIDJSrjwCvY5X/T4C7WB6is/s5AoOGd9mAgsMlcD48V1awvR6Y+D8JLU6CeW+/eBICugFTF2AuRNJyVNln75jO3Bk6R1xgipA== 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)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016);SRVR:DB6PR0801MB2021;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0801MB2021; X-Forefront-PRVS: 0757EEBDCA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(346002)(376002)(39850400004)(136003)(396003)(366004)(199004)(189003)(230700001)(3846002)(7406005)(47776003)(7736002)(316002)(105586002)(6666003)(58126008)(97736004)(6116002)(7416002)(305945005)(5660300001)(66066001)(86362001)(61506002)(8676002)(50466002)(6506007)(446003)(11346002)(386003)(81166006)(486006)(956004)(2906002)(217873002)(52116002)(25786009)(76176011)(39060400002)(476003)(23676004)(68736007)(103116003)(186003)(55016002)(106356001)(9686003)(7696005)(8936002)(14444005)(16526019)(26005)(53936002)(81156014)(478600001)(2486003)(33896004)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:DB6PR0801MB2021;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=3BDB6PR0801MB2021=3B23=3AMZBaY?= =?utf-8?q?NmU0Iu7APnOsxeH1zVD4fCxXvwqQrLjCz4cPcZvFzw3yHgXG+cOV5a8XuWFwwsp8x?= =?utf-8?q?UO9ZQCvESvL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H5plkQCGjKgJlQDkc0X7c2uFlYIxaekU/5omB6lAzB2oKsukJb4A6Hi/pUFUSCZyqvf81jglLrrQsgkpdXz+LZOWU1XdMr4xU9FHtvuUJdv2nCavXB6nO8Jn5pY/P+Pg+sVa00fZJ7TuHAwSD99pJzELy8d2u9F+8ySjj12JC2CZs+ZUznKAWmkHc4wapnejVLP7+y2V8E9MVzvyNu/+/GUXRMpbLB+HXhekJuqw==;5:nokdg+a4sJl05bXVoFbhB10Cem79XuOD+0vldx+yiPLLXPVsiYPue3KCgEyFwsPdB2bgi533FqIx0aCWjLKQSwSeWfc9XQ23h8DVBOy6arqKMWw2p5qMVpdU+OrPrzfxxiEDYXklQMVbfYv3DjaXN2SzB3cveloVgZMuQNFgHQs=;7:tfztc9dpudgYGMMFel6T9i/H91SzF1E0A/zhyTysCcX7IOwhV97qHd4KYkWTB3NcPnQCdT1oBh8P1qUuwG+GWUk2bNL5OcTZTNAYlHPUpNx7YjS4aQw5xZibRc9PljPw/3bH7ArScG/TgAnNcjnqGPFY7O1mZ29znRiXw9ruaNou3Io2hE6N+V75NAg3pap0o/Bka7vuImkUL0X7r0Q1VutOLP2Vpg1BAGNnZJPG9XvC+xqx7yEXNZeXte6HnMh4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DB6PR0801MB2021;20:QV+9fHQEYBZUWbFr7haq41cnk9W3UpdOzydwRd5ttHkV+1R250GxwQ5r45YFvkaeiuqQKB2TB1SYr3Zf7EeZqQmfQMwWgl9xoBguDv3jhZmFM2DFhoiNBiUGHcEwIwzAoVbv70CaOu5RXisdFRo6DpLDta3ly/jXBloHlv1niEM= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2018 15:38:15.4293 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf64a4f9-e62d-4738-0b7a-08d5fc7bcc24 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB2021 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 This and the next patches in this series aim to make time effect of synchronize_srcu() invisible for user. The patch splits unregister_shrinker() in two functions: unregister_shrinker_delayed_initiate() unregister_shrinker_delayed_finalize() and shrinker users may make the second of them to be called asynchronous (e.g., from workqueue). Next patches make superblock shrinker to follow this way, so user-visible umount() time won't contain delays from synchronize_srcu(). Signed-off-by: Kirill Tkhai --- include/linux/shrinker.h | 2 ++ mm/vmscan.c | 22 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h index 9443cafd1969..92062d1239c2 100644 --- a/include/linux/shrinker.h +++ b/include/linux/shrinker.h @@ -86,5 +86,7 @@ extern int prealloc_shrinker(struct shrinker *shrinker); extern void register_shrinker_prepared(struct shrinker *shrinker); extern int register_shrinker(struct shrinker *shrinker); extern void unregister_shrinker(struct shrinker *shrinker); +extern void unregister_shrinker_delayed_initiate(struct shrinker *shrinker); +extern void unregister_shrinker_delayed_finalize(struct shrinker *shrinker); extern void free_prealloced_shrinker(struct shrinker *shrinker); #endif diff --git a/mm/vmscan.c b/mm/vmscan.c index 2dc274a385b9..fba4996dfe25 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -422,10 +422,7 @@ int register_shrinker(struct shrinker *shrinker) } EXPORT_SYMBOL(register_shrinker); -/* - * Remove one - */ -void unregister_shrinker(struct shrinker *shrinker) +void unregister_shrinker_delayed_initiate(struct shrinker *shrinker) { if (!shrinker->nr_deferred) return; @@ -434,12 +431,29 @@ void unregister_shrinker(struct shrinker *shrinker) mutex_lock(&shrinker_mutex); list_del_rcu(&shrinker->list); mutex_unlock(&shrinker_mutex); +} +EXPORT_SYMBOL(unregister_shrinker_delayed_initiate); + +void unregister_shrinker_delayed_finalize(struct shrinker *shrinker) +{ + if (!shrinker->nr_deferred) + return; synchronize_srcu(&srcu); kfree(shrinker->nr_deferred); shrinker->nr_deferred = NULL; } +EXPORT_SYMBOL(unregister_shrinker_delayed_finalize); + +/* + * Remove one + */ +void unregister_shrinker(struct shrinker *shrinker) +{ + unregister_shrinker_delayed_initiate(shrinker); + unregister_shrinker_delayed_finalize(shrinker); +} EXPORT_SYMBOL(unregister_shrinker); #define SHRINK_BATCH 128 From patchwork Tue Aug 7 15:38:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10558811 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 9458D14E5 for ; Tue, 7 Aug 2018 15:38:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 806A02A464 for ; Tue, 7 Aug 2018 15:38:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 746FF2A46E; Tue, 7 Aug 2018 15:38: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 3875F2A464 for ; Tue, 7 Aug 2018 15:38:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2E87C6B0279; Tue, 7 Aug 2018 11:38:38 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2BDD06B027A; Tue, 7 Aug 2018 11:38:38 -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 185AC6B027B; Tue, 7 Aug 2018 11:38:38 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f198.google.com (mail-qt0-f198.google.com [209.85.216.198]) by kanga.kvack.org (Postfix) with ESMTP id E2DAC6B0279 for ; Tue, 7 Aug 2018 11:38:37 -0400 (EDT) Received: by mail-qt0-f198.google.com with SMTP id b7-v6so13775280qtp.14 for ; Tue, 07 Aug 2018 08:38: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 :in-reply-to:references:user-agent:mime-version :content-transfer-encoding:spamdiagnosticoutput :spamdiagnosticmetadata; bh=rjLeLihaI+2XAryE8IBKttfF8XLlJtjoquTPBZciGHM=; b=Bf4b4F0fVoXiUB1hHhbMhzwccwWfLMchGiMhmehJDlGecb/MDrmscZ2LTSctcCJUd/ bCGO09NSctvkvQ70WXd7DJJ8JZv6fcFa6MLtwJrh1nxoogqXymciZQSNjswVcaSNuRhI 8QS5so7y+J6m6whOg4zD2cf4tFVGsKv5UJGesP2YafEW386/U+V0tfwP6fK5MoSAIkso ctjJjVPsDCGMjponKkXIIw0ozYIFzsmh9drwzePpJA+FTM0V8nXNsPotXtv7AxrJn0qA dlru+iDoT83KqJBtH9Dmc5N8PlDTq3w+W6DNHtb4UlHpCmxCHSh8Op6dO57NUEyRO4vS H6DA== X-Gm-Message-State: AOUpUlH6c2gbEFwCDC4B0FqJ/97p2c+x2AYr/iCz0W/lrI0vOZAKJa4o ZQlfsUvdSavCarUr5544BbrH6DoMsWTXoQnGbPfH3O0zOLpc8SW6BrCJZCoXvtHGdayysXCsxi1 oiCb02h1OgKttzQkgzwdM9U7NuZ6yjU8L+PeM9ZgN07nNB70cbY5rwcznpd+NVwuoLg== X-Received: by 2002:ac8:302e:: with SMTP id f43-v6mr19110861qte.217.1533656317696; Tue, 07 Aug 2018 08:38:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcXHxFi8mtxhm27lgb3llqaxAoL0IIcL7thr4q9HBYpQwNszBdxvU3j7Mznzj3Yd46bd67q X-Received: by 2002:ac8:302e:: with SMTP id f43-v6mr19110825qte.217.1533656317037; Tue, 07 Aug 2018 08:38:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533656317; cv=none; d=google.com; s=arc-20160816; b=Ete6OKoEsf6w/APFu45aM51tKAGWeadwc5o2T8CMmKpL7K2jVyS3LmmKouaI74e1NZ D17M5xdr47UsolbbCB7SQ1mx9EgF2+56IcCqyJZlz2AwepbWab5sixl9v41TlxlJ8oha 9le77ogIPxwbwzDfmqDyBt4iXtJoaOmtKLb10mhtYPg8IoTOOP1iEV88cEytIXKRuVGl 8pQxx1dbXdIq2wXRT0OfdR6l6b7uyRjAKDIOTaObSZgS1JymXuzEoP1UiSPpNXcX96+t 6eZt5P6IlQO0XgIddsaMtxJhaj9qX/WT9i4hZwHl6NiSHjOCA0+HYirRBN+3ECZisG/j VUmA== 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:references :in-reply-to:message-id:date:to:from:subject:dkim-signature :arc-authentication-results; bh=rjLeLihaI+2XAryE8IBKttfF8XLlJtjoquTPBZciGHM=; b=VW3NacR7g3sz0x0d8YmbclI/mt4Qhpa6IegDIsDZIBjWcL3oboV+5lVraWXvdynyHI GKCcDoA/2kIwcFIiLOjVd+x2UVaFnoBim97eU4Yx1OTCpg3WmJc8XFpzAFFXgTWb7Q8C iCguv4BDmNtBN0/63Ad7FLCpHhJJ62Xq288r0fRrIIKurRz4ipWqm37/0JpLPO6wJfU8 Is8+vjKuoAHgZqxpf+yM4Ue6zSYx9Wz0Am961wYof3jWAzAC6FuYTFCeXHobQ64H3+0d n33iIYOH/QzKu3sA/QLXvoOGmdb8UX792A8HhBcAe9VR312rPsH9neKTgdFPg04id1Jf 9ESw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=SNitA1nH; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.4.96 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40096.outbound.protection.outlook.com. [40.107.4.96]) by mx.google.com with ESMTPS id u27-v6si1642637qte.81.2018.08.07.08.38.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Aug 2018 08:38:37 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.4.96 as permitted sender) client-ip=40.107.4.96; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=SNitA1nH; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.4.96 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=rjLeLihaI+2XAryE8IBKttfF8XLlJtjoquTPBZciGHM=; b=SNitA1nHzY+fSEk9kgdqk7FWwpMkmXzOtEhwtAd0CcDs+sd9ztZR5m15PJSdfDU27KkAbnisvmN+ziOqepMIXj9iwYFbOavOKPcS9vub018J6Trn2+pZIYxfZhJrlvHMFZnGyn5uveZxzx2LhAuWG9eHoW2p3Ur8SzbsS7NCsoo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by VI1PR0801MB2030.eurprd08.prod.outlook.com (2603:10a6:800:8b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Tue, 7 Aug 2018 15:38:27 +0000 Subject: [PATCH RFC 05/10] fs: Move list_lru_destroy() to destroy_super_work() 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:38:23 +0300 Message-ID: <153365630328.19074.5326096793225967868.stgit@localhost.localdomain> In-Reply-To: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> References: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: AM0PR02CA0029.eurprd02.prod.outlook.com (2603:10a6:208:3e::42) To VI1PR0801MB2030.eurprd08.prod.outlook.com (2603:10a6:800:8b::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 535b2c34-803b-493e-31b8-08d5fc7bd3f8 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:VI1PR0801MB2030; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2030;3:vP4s6+o13YMo+jE4eLKJudDTNTpU3qf5LPU0PDe2VBHt0aLjg0ojRu5/V7+QBsHK2PZIoEjOxAzzj7Gw5kGpgugYwL7L3GU9ortWVwNega/CD3XOC1T66o99jtBsXe+donK+VZmhdR+oTbURZdaZiDPwZsQRqaiGrjleUlTNd5z1pXKXPGQKpeOFPNAcEPflWysy4M1aK5LvOBmLdhmyI1Cf8jjowy0ziZ3djy1BlNf9h2NidAIOEYHZ5P1TFicF;25:8yKSQzcuV9rzdACbV4nlke5ULHDs+ZbX93ih+bUrOQz/dk+qBlL4akeSlT2/mrlcXW2lRk6dbnskGC3439r32lBBmuxcN04IYojhwBOxXBiU7Lcmebr77JJw3Cb5TCAe3CHzm+JcOMlIwQTa0w/PGau3/m/N4hV3St2A1Siu/koKSItPYCjNA4QopwswkR2ShkDo1plN5zb2Nv7dCHUc+20XtIlNd56OlabdqORChLMl4NGBBYedVK7pUrgckw2RsDGipOlyTvfRnafko7IL3aBCaYWAzJoeN43xUhZe0WkOdOjWxkghthyly1xK98QOx2W7y64RpfrQHTcgaUZjKQ==;31:/f3lgy4jc5cyd+4vrLuCoXT91qEaaX+Y+mlICZBXIG7UxgBuY/xEDeT7HvRzYMJ5yMRigfRd1usyIF6YBxu6uTshDqrLQVOTUhfPOIrzdoxH50WGUQeh4GpEY0OXjo3IysOylhwYUBPhQGYYLa4TmH0JKAivliCzS31Qn6Aufl/DjBpdobmAyv6w/1iShaTnUH/+1dwZ0+JMtrWERhXhKrPn2YtWVeE8YAHHjQDgmKo= X-MS-TrafficTypeDiagnostic: VI1PR0801MB2030: X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2030;20:Bdg5aKVsoEJoGqoyQfmkr5d0uJ6D+L7+6USasHsbsCHiSYliYDmrjXevwubxlPiHT49rHjQacchrsn77R+iNwfxCaI9hYSRsO4Cp2gerNJqd9RRu5sqbQ/zIDnzLLmuD9hDMmVHELHPUJrwnWEzH//DOZ7pCTQoqdRSSyZvWKAxj1I6FcEt8oYYAuVECulODhOXF5YDpcA26D7iKnHsk1lp7tk+Po5lBl4ZEh2eYVW/bL1a4Jsw6NU+YUNWnReUphVSEn/5tpAiNQ31kJox83zHJHdCb+ymOCqn7uiweZCyIaP0qNkElIrmdu7oUgwqNCCvw5JFpxXN0mMdt/lSIjiKqCVrA+KoM3z46qoemA41rWAJuYiHrr7oI7V/z/1vT1QAwD5Uv7OvKkldkn4M5onPp2JpDB6GFKZARurpqhrnjuSxviGgRCLZaxPXiVeFqUCXZ/8PKUBFnjiGCJa/dECWvP2TmH0w0MgaJh880KE5PCok5PiGq22/Fu9OI8kPQ;4:BqeWMkVFM7T0yae1tktwRqUBS9M3hV1bjU64hfWF0nqlnY9Vy1M9Sg4mxFkLvgYOsob1QkL4bHnqYHwLhnz9846qOiudwww0znBAA4bPqy7EMrfeAjhEUpBZUvtvufSIaKLlwLDHJUPqttYAbgKVYYd7YLJcISF4jN5Yxh955mlTXMBMPoG7Ifo/9vQMyzrQW1lUi7rGR60BMmlcshu2urCVURJ/WVB8VOc2AjRinHXSIrKkzPksnlvIkKS5ExJana6uwQw8hV816bI7nu6fDeeHzt6iyVeaVZMylGwJlqJKuLXUbnWYTd10MlxiB7dl X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192374486261705); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:VI1PR0801MB2030;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB2030; X-Forefront-PRVS: 0757EEBDCA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(39850400004)(396003)(366004)(346002)(376002)(136003)(189003)(199004)(6506007)(16526019)(386003)(6666003)(7406005)(7416002)(106356001)(105586002)(5660300001)(97736004)(47776003)(66066001)(61506002)(55016002)(9686003)(217873002)(26005)(14444005)(53936002)(39060400002)(956004)(486006)(2906002)(25786009)(11346002)(446003)(186003)(476003)(33896004)(478600001)(50466002)(305945005)(3846002)(6116002)(8936002)(7736002)(81156014)(8676002)(81166006)(230700001)(76176011)(7696005)(52116002)(86362001)(58126008)(316002)(103116003)(68736007)(2486003)(23676004)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0801MB2030;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BVI1PR0801MB2030=3B23=3AOCmS3?= =?utf-8?q?4hzyvBMfaNlQ4EDpCmflHvLibhbVc5Pk0KwLO66gb395pqr03D7sf6lUp0A1BqL9q?= =?utf-8?q?wMl9CFVaMDDLfNiLnWu1U1BkSR+lrgJzcW77PKiVczOIfQ2XllwwrrjXFToSi//d1?= =?utf-8?q?UwmpIdPnRa7nGMtvxWKAA/PA/dY5VGS2dkLYGY6+hgd/NjhlDTvmNwaOLDiRArlvb?= =?utf-8?q?ZfbHDrFC6d4j2dOyU/ftSp+E1JgivcbSaFDn5nfVhbX4F/ydAQnX+2CvYDkAd9nMB?= =?utf-8?q?zhpRyNUrdUgKOamSBgm0ndKMxv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espUDvfUxF8CuFUg+HD9IXT6vXiYlLoqqca7hbPyJmJioWj6Fgu+bYOnaHljae6ofPEwUg4pCl8dMuJQ+QWXvaeVmd5CaMUaAjxkBHBINf1bqxLw3BYd4hlRpUIjsvZRWFMCBmbqhiPJSs=;7:ZaX9nXvYn8rHdvLvK9FbHf/4jmEFhqneqFLncQ3usfoljbggv13H3QvjhXiZ6U3bIAjsv9ko6AIQHgqPfk49zV0I8YThx9a/3+NW6Rrz+lgbGZJ+DNuBvmMlNtqF0VFp1vya5B+XsfoNQhqMsogsPY+uPuRYHlVy571sWWxl3m9HUheGSOeGv1XxXyNHXFvSNZm+pRd/eVzn4EBSjAlpfZk6Lk3v7Sj3vYHvmIrUMH8Bi1nM62Rgyy4E2/1lzM+c SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2030;20:O0SU6s1e7ZO+MbBKMYnyxB3kzr6KhN7aeCoKpGJjKE1I4g18pjnB9M9PuU/pO1Hp+qLXnrV791Ce8E1F1dr1pT7FXULxUvzqlNtG4fHtt2e90L9TyAnsszpa4LrUrcfToLDmzT5SQl9xJPhOSy8NfiMAiXMHGekFQIAwDBCSGz8= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2018 15:38:27.6610 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 535b2c34-803b-493e-31b8-08d5fc7bd3f8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2030 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 The patch makes s_dentry_lru and s_inode_lru be destroyed later from the workqueue. This is preparation to split unregister_shrinker(super_block::s_shrink) in two stages, and to call finalize stage from destroy_super_work(). Note, that generic filesystem shrinker unregistration is safe to be splitted in two stages right after this patch, since super_cache_count() and super_cache_scan() have a deal with s_dentry_lru and s_inode_lru only. But there are two exceptions: XFS and SHMEM, which define .nr_cached_objects() and .free_cached_objects() callbacks. These two do not allow us to do the splitting right after this patch. They touch fs-specific data, which is destroyed earlier, than destroy_super_work(). So, we can't call unregister_shrinker_delayed_finalize() from destroy_super_work() because of them, and next patches make preparations to make this possible. Signed-off-by: Kirill Tkhai --- fs/super.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/fs/super.c b/fs/super.c index 426161360af3..457834278e37 100644 --- a/fs/super.c +++ b/fs/super.c @@ -159,6 +159,11 @@ static void destroy_super_work(struct work_struct *work) destroy_work); int i; + WARN_ON(list_lru_count(&s->s_dentry_lru)); + WARN_ON(list_lru_count(&s->s_inode_lru)); + list_lru_destroy(&s->s_dentry_lru); + list_lru_destroy(&s->s_inode_lru); + for (i = 0; i < SB_FREEZE_LEVELS; i++) percpu_free_rwsem(&s->s_writers.rw_sem[i]); kfree(s); @@ -177,8 +182,6 @@ static void destroy_unused_super(struct super_block *s) if (!s) return; up_write(&s->s_umount); - list_lru_destroy(&s->s_dentry_lru); - list_lru_destroy(&s->s_inode_lru); security_sb_free(s); put_user_ns(s->s_user_ns); kfree(s->s_subtype); @@ -283,8 +286,6 @@ static void __put_super(struct super_block *s) { if (!--s->s_count) { list_del_init(&s->s_list); - WARN_ON(s->s_dentry_lru.node); - WARN_ON(s->s_inode_lru.node); WARN_ON(!list_empty(&s->s_mounts)); security_sb_free(s); put_user_ns(s->s_user_ns); @@ -327,14 +328,6 @@ void deactivate_locked_super(struct super_block *s) unregister_shrinker(&s->s_shrink); fs->kill_sb(s); - /* - * Since list_lru_destroy() may sleep, we cannot call it from - * put_super(), where we hold the sb_lock. Therefore we destroy - * the lru lists right now. - */ - list_lru_destroy(&s->s_dentry_lru); - list_lru_destroy(&s->s_inode_lru); - put_filesystem(fs); put_super(s); } else { From patchwork Tue Aug 7 15:38:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10558813 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 BCCB6157D for ; Tue, 7 Aug 2018 15:38:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A83FA2A464 for ; Tue, 7 Aug 2018 15:38:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9AC8C2A46E; Tue, 7 Aug 2018 15:38:47 +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 101DF2A464 for ; Tue, 7 Aug 2018 15:38:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E80126B027B; Tue, 7 Aug 2018 11:38:45 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E57A26B027C; Tue, 7 Aug 2018 11:38:45 -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 D20846B027D; Tue, 7 Aug 2018 11:38:45 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f199.google.com (mail-qt0-f199.google.com [209.85.216.199]) by kanga.kvack.org (Postfix) with ESMTP id AB2C96B027B for ; Tue, 7 Aug 2018 11:38:45 -0400 (EDT) Received: by mail-qt0-f199.google.com with SMTP id w7-v6so3843747qto.9 for ; Tue, 07 Aug 2018 08:38:45 -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 :in-reply-to:references:user-agent:mime-version :content-transfer-encoding:spamdiagnosticoutput :spamdiagnosticmetadata; bh=2uYe2qDeYfym+/n7FbyMe2UtdLf6NUQqwQG95QedNIE=; b=iIHEajjrDK5RE8alvticrRM5cb0L7reIUJSr4CJiNexLHRjOjTU3dYPY/b0EQmzIMF Al8g7EJO1ycX1z924Z58DN2XIcIaFY7d7a7j1PYM+fT+CDNyF1ZklE6F1L0BCR7t0l7b bwqmemzEAl0pV7lrBeJA4fVBc16cZ8c5TkBsPstdi92T3w//D2jvNaMYsB0c/ICdFBlG uKsFiVMQra8ZLef7vjcLgj3CKWkVP20kPy++Zp+Cnitf9zF2DcAUoBFApHz0Bz6L3wTU 6aIjeyKAEMYQWpMXIMqARo3tSFhtYheyuZplJL1Qr+B3Sh3eY7P33EjWLgZzsOpbRB6E Ybtg== X-Gm-Message-State: AOUpUlE5bue0WiXAdS6qHPYeWU/MyuDD0UYbOz9oTXOGWYXH7Gj8ha1G wAFPccN1o/MsVKyCTs57A2JKrk8aOlnjtQYCsVBnW/NJ//jVFE3X2cSpw8rYHKNt2Jw8rFoTvN0 DtJ/xhVZW7/9kjJnGN5nttIWTYiXTraA7XJhIu3NUidIQFr3wePoMm3ATp18WbRsm7g== X-Received: by 2002:a37:7fc7:: with SMTP id a190-v6mr17151430qkd.247.1533656325465; Tue, 07 Aug 2018 08:38:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcaltdHKNUjWVasClXwnecaklXWqMtwNAqDiUpUwPFY8m3AuuDhk+572evHPmwWmQT0FPAG X-Received: by 2002:a37:7fc7:: with SMTP id a190-v6mr17151398qkd.247.1533656324763; Tue, 07 Aug 2018 08:38:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533656324; cv=none; d=google.com; s=arc-20160816; b=IeZ8CS2mUn8NxDcY8TRwKRg/bj/yWlgYX7HGOhu5ZiYYe3WSuj46CI9ZGAjH9Cu2hd /wh9EpNAnAtphAgsppOoRBFus+wGVvtWA35Zy9DJSDj6ysGl5gnO26QP8octGAh0x7Gj 9WR9PrXYSboLVSOrswiBzq3eaGC/YSBGGj47OtZc6glxHV2PbY50Pzl04aJM6qcyXSNu HjNmUGfsS9jjv+Anp2QTAl8/PPDIZcqB4IDYp+AzyOza4Yr+IZLQj8J909VOj1O/agoh 8VKYbINDoRBYP2PZSq0rL+LXdbqLreoPREZcaZfqHAutAZfDIMwHBxORZNa4TjxoMJTE EEpA== 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:references :in-reply-to:message-id:date:to:from:subject:dkim-signature :arc-authentication-results; bh=2uYe2qDeYfym+/n7FbyMe2UtdLf6NUQqwQG95QedNIE=; b=F3g27L3KHho55c2ywU3+AsQW71aLiOvd0bRguEujgbwzDz0Zebp8P/YKqfSomkiw0G iEDChmDijNhgkOSU9iguQFbMk5FCs1oY1//sQ29P7uGOzbwrLUnwmcowbeDfXGXBuPo2 OBknhGAXIA86fTF0yvvEENj8MpUPJSBcMOEC5s5wGKPjSrX7e1Ibw15tJgm1aZHI/DjH gndxviUf6GMeUgyL5k5nirlhYeiKuqGpMbjOlKM7R9cVcqz3ZN9/PxmC8YSYl3ZlsSjX 6l2CyQ9RgIomxw4FNHsr7hgOjYDaHYy/C8LLqzyQeZP0iutlwQtnd9RjjAWFre28eooA fTzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=H3ZkR6BY; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.130 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0130.outbound.protection.outlook.com. [104.47.1.130]) by mx.google.com with ESMTPS id g9-v6si1704604qtk.14.2018.08.07.08.38.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Aug 2018 08:38:44 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.130 as permitted sender) client-ip=104.47.1.130; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=H3ZkR6BY; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.130 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=2uYe2qDeYfym+/n7FbyMe2UtdLf6NUQqwQG95QedNIE=; b=H3ZkR6BY2YtXy5QC5QYTbULVlgs/WojIMi7sbp3uqRnja9NfCXvUjkRdoXV2oXSySmGPXYIU8DrP2zxl16zTiNGAQ1OuGwgtivs0JEQyAKv/Vg/6NAMTXUarTyv9m7JJF9ojBcuYJ8V1ZlTmpg0cr3tSUw45uYKdf5TNb3Vylu4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by HE1PR0801MB2026.eurprd08.prod.outlook.com (2603:10a6:3:50::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Tue, 7 Aug 2018 15:38:39 +0000 Subject: [PATCH RFC 06/10] fs: Shrink only (SB_ACTIVE|SB_BORN) superblocks in super_cache_scan() 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:38:36 +0300 Message-ID: <153365631661.19074.12075476211623702890.stgit@localhost.localdomain> In-Reply-To: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> References: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1PR0501CA0047.eurprd05.prod.outlook.com (2603:10a6:800:60::33) To HE1PR0801MB2026.eurprd08.prod.outlook.com (2603:10a6:3:50::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 056f8490-5f05-46c7-fee2-08d5fc7bdafa X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:HE1PR0801MB2026; X-Microsoft-Ex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yiaZWopkgbrZ6+q4p40nNet92ygrfBaIrwSUGgL/f9yjfEhSOG0Pq7ceB76mxYl2A9DZIMq2mDNsfGs4l00CoVhfeRnvJGPYVAxlv9HRMwKn7M0V7C/UXKRV5m7Y0MIGjhQutMbUG02kBAcT7ZG6TY1VSqNjX51QziJiZ8Vr/RrUkU95rfB/dROz5+8/JcASAWlD4necYwD38HRPu/FaF7x6R660Gcqq+9wAfBU4AwdevmN/JAxaIxI18H5PkDxcENIGGeQhVAxeUyuf1Od3//kf2LNFZqKtGc71L+s46VC7hw1MTqFxVD3/NRQQmRNXuTX9JG9Ryr/Ym6Tfq0tHW4nDmhYCqJggVqox+PIoxgrlJ0QLNvCilPIDBof;4:TnDtMZqUN3B1lhd6NSFHVvabknAfxBAU1c2eSGk9eD/8NmHA2NAXDAMcLBoFXUYoVnFtEv+nwXDHZo1xPG+o8p6gPEhTnNlkB8ZqDT3UjONB8j5DfvjDmWTAw0x0u8mR8cw/Rv5ClP1S+s+pLCFzEJxCVu2w2S9z1z9uF4jjgveOyJTpY94BAWVR/QNuHc9VPbqqLp96sz+hrCATe4wn/FJDoEv1dZvinvSxTQBggB43XwK3PAMC21OljiL14GNO5G7Sm4VRLjK/0VhovaBcdQ== 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)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:HE1PR0801MB2026;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0801MB2026; X-Forefront-PRVS: 0757EEBDCA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(366004)(346002)(376002)(136003)(396003)(39850400004)(189003)(199004)(386003)(2906002)(6506007)(39060400002)(478600001)(58126008)(26005)(5660300001)(53936002)(305945005)(68736007)(476003)(7416002)(186003)(7736002)(7406005)(16526019)(11346002)(33896004)(50466002)(956004)(486006)(86362001)(446003)(106356001)(230700001)(25786009)(66066001)(52116002)(47776003)(14444005)(7696005)(55016002)(105586002)(23676004)(2486003)(6116002)(3846002)(97736004)(76176011)(61506002)(6666003)(316002)(103116003)(81156014)(9686003)(8936002)(217873002)(81166006)(8676002)(83133001)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0801MB2026;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BHE1PR0801MB2026=3B23=3A/Cf5r?= =?utf-8?q?QeRqQg9SjVZrooVhev/h+n8AIQ4g1brn5AAUqei+4W33v7D5sG0ncPM6HWLHC21Yu?= =?utf-8?q?0pTRRsb2NUWbbyyU4q5hGRd0tZmamiTg0keWnHuByBNWog7ZFIFp5XbCXo5VzoqWe?= =?utf-8?q?8hAZd7apfkWEWHeUGqJZltN3Ku7gmmw6JRcvJKGztLbQfop7wbtX5F8ddPqkkSaSZ?= =?utf-8?q?3IAIsuVKH5RVwKCtVSDRneY1sOpVjCk+zdXrl/FN4Muqp0ieYU5pzRYtdoPdw0W74?= =?utf-8?q?Y+5mWMKmVxCnZ5hsSQ6Zy5ihUY/WVLdrlSPR6h+5vIgfWawNLjOq7P9sDAR8cf5Nd?= =?utf-8?q?+ourviT/S/JmgCUQdyvLT/qPfDuAbZ9KvXpKTrPVoOVS+SqufGfjjXX/ibEd6zNhk?= =?utf-8?q?Ktuke9yNEZtfF8IgMevjS0Xzx/n9Ry3DuIbMQQXYaViekEuVSrAKvNdqqqIFAE7Wv?= =?utf-8?q?OQFfd44jHIvvZbhAZNed8R9Ps5AbVU5oI23asy3vEEDg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HmOrqQTXKnkSqBKfwK8/TaofGJuMyIAGqzgo/qzILAJcUaD/8x5kdApHTNxUBXQ35sTXGj4jvjc5tskzjjN+L4UAf80TknrBFnSlRErpV8G4CYrAy5vzXS+9e5nCXY8otUYUaVN4RC6Ex7z2usuFuH6oWYullv3nRzrkMephA3lBaL4MFjWfHVBDjQ1GvtSg7vtCV5s1hWyiCVq6dLxVEOiNS05yu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB2026;20:em2/RxsE9Sx2dneLAl/4rA2Bzjcuc7IOmvxmOSmXBP8nDMG5R6q3mZ5D0oRcIGBJZd83ljUI6CZY5ylJpm8BYceaORhxZf7oIkh+8nRDggOMcDovZNevxOcLRL3TJGaN9zbCW46uRcLaCBuMpCF++BMTXOdI0s9RxnkqbLK/IIs= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2018 15:38:39.2227 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 056f8490-5f05-46c7-fee2-08d5fc7bdafa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB2026 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 This patch prepares superblock shrinker for delayed unregistering. It makes super_cache_scan() avoid shrinking of not active superblocks. SB_ACTIVE is used as such the indicator. In case of superblock is not active, super_cache_scan() just exits with SHRINK_STOP as result. Note, that SB_ACTIVE is cleared in generic_shutdown_super() and this is made under s_umount mutex. Function super_cache_scan() also takes the mutex, so it can't skip this flag cleared. SB_BORN check is added to super_cache_scan() just for uniformity with super_cache_count(), while super_cache_count() received SB_ACTIVE check just for uniformity with super_cache_scan(). After this patch super_cache_scan() becomes to ignore unregistering superblocks, so this function is OK with splitting unregister_shrinker(). Next patches prepare super_cache_count() to follow this way. Signed-off-by: Kirill Tkhai --- fs/super.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fs/super.c b/fs/super.c index 457834278e37..9222cfc196bf 100644 --- a/fs/super.c +++ b/fs/super.c @@ -79,6 +79,11 @@ static unsigned long super_cache_scan(struct shrinker *shrink, if (!trylock_super(sb)) return SHRINK_STOP; + if ((sb->s_flags & (SB_BORN|SB_ACTIVE)) != (SB_BORN|SB_ACTIVE)) { + freed = SHRINK_STOP; + goto unlock; + } + if (sb->s_op->nr_cached_objects) fs_objects = sb->s_op->nr_cached_objects(sb, sc); @@ -110,6 +115,7 @@ static unsigned long super_cache_scan(struct shrinker *shrink, freed += sb->s_op->free_cached_objects(sb, sc); } +unlock: up_read(&sb->s_umount); return freed; } @@ -136,7 +142,7 @@ static unsigned long super_cache_count(struct shrinker *shrink, * avoid this situation, so do the same here. The memory barrier is * matched with the one in mount_fs() as we don't hold locks here. */ - if (!(sb->s_flags & SB_BORN)) + if ((sb->s_flags & (SB_BORN|SB_ACTIVE)) != (SB_BORN|SB_ACTIVE)) return 0; smp_rmb(); From patchwork Tue Aug 7 15:38:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10558819 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 06D1914E5 for ; Tue, 7 Aug 2018 15:39:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7E232A464 for ; Tue, 7 Aug 2018 15:39:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DBA602A46E; Tue, 7 Aug 2018 15:39:03 +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 551892A464 for ; Tue, 7 Aug 2018 15:39:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 690646B027D; Tue, 7 Aug 2018 11:39:02 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 668006B027E; Tue, 7 Aug 2018 11:39:02 -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 50A2A6B027F; Tue, 7 Aug 2018 11:39:02 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f197.google.com (mail-qk0-f197.google.com [209.85.220.197]) by kanga.kvack.org (Postfix) with ESMTP id 280D96B027D for ; Tue, 7 Aug 2018 11:39:02 -0400 (EDT) Received: by mail-qk0-f197.google.com with SMTP id u68-v6so17126220qku.5 for ; Tue, 07 Aug 2018 08:39:02 -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 :in-reply-to:references:user-agent:mime-version :content-transfer-encoding:spamdiagnosticoutput :spamdiagnosticmetadata; bh=Bz2w5fJXdWqMn1oOXDA+rfsXW/U99Vf7ljx+Ic1im58=; b=BDtgpjxZnKqZeFtfGFJDa501XXwVWpSsv8IDA4vftddSFuDGNxFkA+tBbCL4eWIMcV XY15Rztd8mQmvT5SQb5ZbRlLT25yx1sD4bs2LZsat/lvjdj87dY9JsWzMVHYunfLo8Eo Ie2R9R3zccg7PEuuvOCoOf1irt83082o5RWHcCoDKgPGOwI02KXVdWM0SiASA0vQyoeb Kh1Ir437Qi7zM+WFPOY1yZyoGLoIY5IxW7pxt2mPjmYZXUj8qgNZmp08j2Na1R+Migky 0gWgYNn5SNkojfRxMkZmyBVLvrawbk/TlBj72eEphia7F+6y/pAHXmsaFlG8OMe77kQN UeiA== X-Gm-Message-State: AOUpUlF85owMrIWkWltX8lShjr6ThYmxytSSatqj5FPkgHcw8la4zYZP FCg9WPqwVO7b3QeGvdLQATWVTT7CWYhcvSZxJBuwCpMSADwTEt2nWbSAPQ2yRhH3xhEC37bxue0 G3JKGl1QyGHUywBhGwXj/a9cFykMVF7IdwO2rGdYO3/Xy3DZK2vY4Ut/Jil3f6vNgHQ== X-Received: by 2002:aed:35f4:: with SMTP id d49-v6mr6055374qte.240.1533656341947; Tue, 07 Aug 2018 08:39:01 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyv5tWGYJAmWiy/59o8serVaBKKGNvNcVc0JM7tr3qleYTCq0xKJc0Tb5uWmSOVIPFTjvgi X-Received: by 2002:aed:35f4:: with SMTP id d49-v6mr6055333qte.240.1533656341310; Tue, 07 Aug 2018 08:39:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533656341; cv=none; d=google.com; s=arc-20160816; b=h6p7ZQJOGxugfoZm5uTFGL5d8G/TZReuMesuTsNOUe9qvIF+RCJmk0qjf8cC9YcSHm haFRA+Iowl/lfB8qkKRjHMS+R3sRWSn6d6LfC6SW4pjkNr4YE6SIN/0IdsCowhI6Ts68 CAwglumc7FnuvixlMPVre+oZLxy8cffZaZxlqczixwvhZQkBkMOKtnaVFroPEVqDPh9u XZ6uerC6Oq9o/O497FA0bL+f5YuV1ATO6rpaptMhnXtfkM28ApGTTtxLaN0IxJxKNY/4 7QQCUCtAznMq5pSfQTizec15TdVQFxzY0iyfpUWCDJ83MgyHcjjhTKuIVuzGquZC370V OERg== 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:references :in-reply-to:message-id:date:to:from:subject:dkim-signature :arc-authentication-results; bh=Bz2w5fJXdWqMn1oOXDA+rfsXW/U99Vf7ljx+Ic1im58=; b=dVzPHzggbgwQ/h/6cbpWes0sYooeIwBMp6aR2IKjUFCi/1VVi/EBnh6+Uv8kVk0vsx kYRroZbHxIZBCrvDwxcoIFQHrtAyyBRA75HD2jch8rSE3P7t8EhCzmFGuE0DrsCTHFNm zt9ryZoZt8IfkhNgrfEWMuCDBtptLWSIpnJyZ5+85AFAAQ6WwGwY33ftFjF9iU8vcLa9 PrebQyoSXjuLMyAT5TaitN0SxMDyz2SMNPVZ+kZuEhVmOFK8WJZ0QXCXdROdjIPSTipg t6GTiI5pPLk/o0QBRO+g5lLOXMcIXM3BiYilil8BJLj/DfppewBQE6i3/WRI1oIjNY5d xWSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=g1KuV9ID; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.5.115 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50115.outbound.protection.outlook.com. [40.107.5.115]) by mx.google.com with ESMTPS id k35-v6si265732qte.335.2018.08.07.08.39.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Aug 2018 08:39:01 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.5.115 as permitted sender) client-ip=40.107.5.115; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=g1KuV9ID; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.5.115 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=Bz2w5fJXdWqMn1oOXDA+rfsXW/U99Vf7ljx+Ic1im58=; b=g1KuV9IDx/Z8Q7e7z5x6BW558qmx4dGjg2apJXJkmqrQKp1Q4ncWfHUHuiOmf/48ejsmWh1/672OTERGcXviXkMxhtUXxnqkrcuIrnkqahbd47kN+uYZiSIrzLOfrDLXo/MdnGLtVgfu23/FALRxrMz1ePUCTGgfz1PEJXt0pTM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by VI1PR0801MB2032.eurprd08.prod.outlook.com (2603:10a6:800:8b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Tue, 7 Aug 2018 15:38:55 +0000 Subject: [PATCH RFC 07/10] fs: Introduce struct super_operations::destroy_super() callback. 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:38:48 +0300 Message-ID: <153365632811.19074.14026254201855676335.stgit@localhost.localdomain> In-Reply-To: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> References: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1PR03CA0056.eurprd03.prod.outlook.com (2603:10a6:803:50::27) To VI1PR0801MB2032.eurprd08.prod.outlook.com (2603:10a6:800:8b::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8fea4c23-9e09-4c58-c4eb-08d5fc7be4e8 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:VI1PR0801MB2032; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2032;3:AyMVy+6dGfOLA+zlBNLanKxbZ6YX0DxTnIci3l3kNDxmn/Xlzv4/t0QHVW/Ycs28tpOgkgUyO2P2dkYqqa1wrpZnNlS3Ugw+DQHFXtXNJfhdXoznPQfd8w+ka8WoyvtnQpddTRgJ0qfMlJ7FjiV5SWXPK81Ec0tl7hf3TS1bllxCabNPu2kUb4eVlvrO+WPoYYnUpoIYKACH/Z+wX3RZUbVokj6SFnRr9qbYgAxuT2c/gNQ3nQD2mB6AOP8GRUd2;25:7i+mB3K3yz1iqaN8lOW278iliL/ObXg8y6eNeavKR4HFyIXoJRqhAWFRrXwQN4MNP/x+MALZC2aDZ6WNmGfI0nyKi6CDDF0TH0uvlpZeJndIHKThZBdi/YxBZijpCjwBtRd2QzTvY8urcOGisE/uGB5v3X5I0t4SoJK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RQrfYlG1rd+5pixEXDqzYusfDrqpQdAMwDKdrMJb/qQg0FLDhc/Mc9SMoYL/UVe1jAaWNpwbLePeVBsifTKjtG5RrowRNyHX6AyPVsybIoWKVk88Ge+xJsgQSt7vK2p560jxCGRrsAVjKf/6mF5e0hBHQEVo+SKYxyO8hrpCmAhTUsxabWbNDMRJaBx9/cbctUi/HSjw== 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)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:VI1PR0801MB2032;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB2032; X-Forefront-PRVS: 0757EEBDCA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(346002)(366004)(396003)(376002)(136003)(39850400004)(199004)(189003)(106356001)(105586002)(217873002)(956004)(61506002)(66066001)(486006)(478600001)(11346002)(446003)(7416002)(39060400002)(7406005)(26005)(186003)(6666003)(86362001)(575784001)(97736004)(230700001)(476003)(5660300001)(16526019)(6116002)(3846002)(53936002)(103116003)(6506007)(68736007)(386003)(305945005)(7696005)(7736002)(76176011)(81156014)(8676002)(81166006)(2486003)(23676004)(9686003)(25786009)(55016002)(47776003)(8936002)(50466002)(316002)(33896004)(58126008)(2906002)(52116002)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0801MB2032;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=3BVI1PR0801MB2032=3B23=3AGnUg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6C7YB2dBvsCXw4nS3eSyPqZ9XH1D3GrGgdbalhqN08Mqr1El8DNL9KMbzra2zPusXSMFcbHayXMfYRUaGLNtGZWP11bAr7fLuQ/XBEnqA+jF/qgIWsK3nMKQDDHLBisBl4de9s/qq2XM6m+VENOZqg9/41y6NezBopMG4RXBGfTdvRzKod66PQ8M9YDFv/R2nRFo2yZBVczAOAvs5SMwjAJBgNnpzkQhDx+JgByQmuOsAtyGVTXAFPu9lKS0HIFn9WPXVuzoBs344jv5a9fiGP/9MreiK1clGSaAcJQ2eNQftohc+tIMePorvhVp/TozdTp1OqFksqDg==;5:h8XaS7IoNmTQJsHQYEFSt826TE5ctqmFbkwixP76qkOvgvBGp5D/TvpeWWoxODJYPUcCPSyGbcHDZYKgzuWPQqfN9iSLa9usFV7GDG4xlkklLzoOV8eOCVtfvzWvoCgfrXpt4t7+36nNEU2gfBcsRkO4UBmwZEjITI4nRMbVhLY=;7:wOGYVhyOpN/64bRXDkgPFn1honJYNFjp8kyoRPncZaeesY+WERxlUfHOzNgNfdBF2ZfKZzPayCy29mlEYBeW5XkdLuxX1Khwt9JPyzf7mBKL6AV7hZKbMWg7F2RSaIgA2+ZRyBIL44QNYkWLdftrImiLZl90OvX3paV/oPvyGN+U42L/g6r2b0uROo1bSPrb5lUPBNWI2zkCBNP9f4i5NHVERBT80+yJgiokl7hImF5jihaE9goG/vSdqmHuOAFO SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2032;20:LqLirqxTPbI5EkhYC25qng7zxJqHDgngQ35x/ExQi88oH59ErfsezBZeYyHW7VLFPpsC0ST1qfuzJ/O5r1RYenqQV6byLdI1Oyvp3ETQms07mD5YSiOzkr0mk2U0G2n6vqeg9dO1TyKgRCHzbBaYkA2MwkNrJ+iVxTZVYskuHN8= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2018 15:38:55.8789 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8fea4c23-9e09-4c58-c4eb-08d5fc7be4e8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2032 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 The patch introduces a new callback, which will be called asynchronous from delayed work. This will allows to make ::nr_cached_objects() safe to be called on destroying superblock in next patches, and to split unregister_shrinker() into two primitives. Signed-off-by: Kirill Tkhai --- fs/super.c | 3 +++ include/linux/fs.h | 1 + 2 files changed, 4 insertions(+) diff --git a/fs/super.c b/fs/super.c index 9222cfc196bf..c60f092538c7 100644 --- a/fs/super.c +++ b/fs/super.c @@ -170,6 +170,9 @@ static void destroy_super_work(struct work_struct *work) list_lru_destroy(&s->s_dentry_lru); list_lru_destroy(&s->s_inode_lru); + if (s->s_op->destroy_super) + s->s_op->destroy_super(s); + for (i = 0; i < SB_FREEZE_LEVELS; i++) percpu_free_rwsem(&s->s_writers.rw_sem[i]); kfree(s); diff --git a/include/linux/fs.h b/include/linux/fs.h index 842fde0f0981..33dfaed0a01a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1880,6 +1880,7 @@ struct super_operations { int (*drop_inode) (struct inode *); void (*evict_inode) (struct inode *); void (*put_super) (struct super_block *); + void (*destroy_super) (struct super_block *); int (*sync_fs)(struct super_block *sb, int wait); int (*freeze_super) (struct super_block *); int (*freeze_fs) (struct super_block *); From patchwork Tue Aug 7 15:39:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10558823 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 0AD0214E5 for ; Tue, 7 Aug 2018 15:39:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9E692A46E for ; Tue, 7 Aug 2018 15:39:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD42A2A471; Tue, 7 Aug 2018 15:39:17 +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 50C682A46E for ; Tue, 7 Aug 2018 15:39:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 559886B027F; Tue, 7 Aug 2018 11:39:16 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 52EFE6B0280; Tue, 7 Aug 2018 11:39:16 -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 3F8EF6B0281; Tue, 7 Aug 2018 11:39:16 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f200.google.com (mail-qk0-f200.google.com [209.85.220.200]) by kanga.kvack.org (Postfix) with ESMTP id 11C386B027F for ; Tue, 7 Aug 2018 11:39:16 -0400 (EDT) Received: by mail-qk0-f200.google.com with SMTP id v65-v6so16806855qka.23 for ; Tue, 07 Aug 2018 08:39:16 -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 :in-reply-to:references:user-agent:mime-version :content-transfer-encoding:spamdiagnosticoutput :spamdiagnosticmetadata; bh=ZoweZLAYp3KgFZo2uGoPuYqg3viLGocWgESzGgqHXy4=; b=EQ+PR/8X/lDjXQZna/NZz3TbVWEhMI1R9OcqirmoGxQsqeyd9Aq4YXplK7/MMQmoiP vri0Fo4YAsG/Kx8A4tx/GF5GRFoUyKAiksZ/3uofZFCDmxss84tpDZKYC+le0nle5J5u 3pX6jDcQZ8kxz8Hf0VAdzDYDTy/gCLaasZ5Q5oVOJiM3/YzNAeFLKK6DWZ/1Qlr/ULbs JounOXFNO1YORxxitSVvEUU1DccqOVDTdtHhz+NpUkCVzQpOiPddf8tVRAjJDhbxd1Bj yg3pZcVtW4bdjUJXScgYbnTrgb5p+3UMKKu7UIwSp5VjjPvpVxG6OeRCXY92/C21y0dO uO8w== X-Gm-Message-State: AOUpUlHtVyD2nQozYdQKKGAe4z87l8TLwhrthO+bhXVPKQ+4AtKcCQxD LIQlnL9iXC8wgPYdi08K7tDITl2INrIs9KdAs/ly3ZYdWPc93y2Qo+NZYMewaCIBba5HMtDDA0k WkA3KLNyMREioaKBp74sZv4hAPabwRSNPd6akvI1zx4z3u/7MgpLL7rNUtR/XqQlRrw== X-Received: by 2002:a0c:9259:: with SMTP id 25-v6mr17160712qvz.239.1533656355848; Tue, 07 Aug 2018 08:39:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdI9vSWWbe04KomMGVqgFsDS1tU5Qx8EU6sj4mXqy8yHUNkEtai0GkdDDV4KBLRRa2945LF X-Received: by 2002:a0c:9259:: with SMTP id 25-v6mr17160670qvz.239.1533656355221; Tue, 07 Aug 2018 08:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533656355; cv=none; d=google.com; s=arc-20160816; b=ojWrLSowULHkQSdEPA6Tpe75uUT5vUCV7mL6XHWZffK6x5ZNJecwneR9HPJy5o6swV Llua+OK5aPBDPmDBQzxSEkxbLi0clJsCDqD+8rw/AfB3X5JAs8sZG2+95iLQyyBbiCvg cZwnPMgiJEvu7v3hG5KI79KQvOeGdlCnNhiLq0FYIBnkEzZQ66ONIGTK2kiWwmmXz/Qa 8QAeM9rhlR0gcyrChjSK8RWsbgTuNX0PuWWBgYqz8gCyCexeFc/WrKhA+hy5aogj27Hm e9GtojpcC5SUO8ZjrMPUPQMERyIYG+/teZ/FHGMnQnzIUC3E1EknSKZLv6Mc0ojv+02g A46g== 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:references :in-reply-to:message-id:date:to:from:subject:dkim-signature :arc-authentication-results; bh=ZoweZLAYp3KgFZo2uGoPuYqg3viLGocWgESzGgqHXy4=; b=G/pVbXtaLHosG5uNWMEbeyyc5f7NhtYJdeok0aIYSnOFQGsgnziQjHhC2uNlaQtK77 O7xXWIkYPBJAmobhN7ye1tm8FWZegsg61MXxkDgGQ7M1WRYQgFtJWQn5SgPxeaR4Oh43 zJ3eZTtbZEeHiVgZzwsExD7lOcI+N1kDftxcKN/+vHpiiulPSCzeC7VgkLjJIXBhuIJF HNXYA/SZKb+qDgwGXPk6hSXXdzFFUbKdLeCIinJO2MfJYofZvemsh25hlNISBxsEELB+ a91lgSEDPTdDkVa665SFDkoqFQu9O9FRK4HlgdO2kFFNkV9V0d8ZdD+9QR/rJVYxQpSf T5ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=ehEpoLAC; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.8.137 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80137.outbound.protection.outlook.com. [40.107.8.137]) by mx.google.com with ESMTPS id a125-v6si1575984qkb.47.2018.08.07.08.39.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Aug 2018 08:39:15 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.8.137 as permitted sender) client-ip=40.107.8.137; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=ehEpoLAC; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.8.137 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=ZoweZLAYp3KgFZo2uGoPuYqg3viLGocWgESzGgqHXy4=; b=ehEpoLACvT4MSoIHIof2+EnXIgtOW0VGWaEzFeJR2z4akYSCS3lGlHBQNA9ghHD3vCpGm/GZOCq8KQXRjpgVNE5aR6R9WJfJcWbahEu2jKJOKaZlnMguX3slyF+QpRr5Rgzg471MrO0tUMo/1xDf7wTgclClBwOoeHOOTZPe2zg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by VI1PR0801MB2029.eurprd08.prod.outlook.com (2603:10a6:800:8b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Tue, 7 Aug 2018 15:39:07 +0000 Subject: [PATCH RFC 08/10] xfs: Introduce xfs_fs_destroy_super() 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:39:05 +0300 Message-ID: <153365634503.19074.14972123229522734895.stgit@localhost.localdomain> In-Reply-To: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> References: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1PR0202CA0034.eurprd02.prod.outlook.com (2603:10a6:803:14::47) To VI1PR0801MB2029.eurprd08.prod.outlook.com (2603:10a6:800:8b::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8580e0cb-9690-4303-228a-08d5fc7beb38 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:VI1PR0801MB2029; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2029;3:bKv/zYxfBTC32Bt4PdjDxkMDGkiEuoixu3UgMGspvfJD4FrUXQDu1xUrr3OJGRXSXbcHczsJr0Hwpp3S85XUayOJQXdYsKy4/K0utLj3STlyQqksli7EGOdOD528dq4AOXVmfr+vGs8Ago30Xvy0PntPO3jS8Ex5JOIckZeJ5TpOvZJW7ion+aS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7a3lfwGq04K8CVndbXYyaJZtP/rEDieoLrnPIIKv5kmz2IDF7/3cJUg0IeNQsU/E1CVtvHGFuqrNudf146OBj+8e97VZNxFXtlVEPcuskTmiHwZyWjxNMWKVkR5PDy5jkERLOhRtdDBhZ4fsg9cXSPKSHBKJYVcI6kJOywr4sxKKB3SjlO;4:fo3mvZA5p8bXyVx+BwDz9KJ5RokYwm26xEuW9P8xol1kPPyuCgsEquT1xZiOa6SWlcIiDVH41WSJBpSZljicUMbQWhtrJPDLTrN7UcRZTZyinVOAEfeJbksMLhEcG3nYDk9YYfJJEAhNJt93R+ZBRwdGSL/1Yzj2g/JSjZUHb23Q62rauVHysTfN8mVDMk6vYATlB6MgWvFsyFMsBVJozZQg7E65GA056NdFvXyZpOXzQKFz1arIXO19vGTGqOZ6m5YgLW0H/bP2leDxnZJbpQ== 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:VI1PR0801MB2029;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB2029; X-Forefront-PRVS: 0757EEBDCA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(39850400004)(136003)(396003)(366004)(346002)(376002)(189003)(199004)(486006)(230700001)(53936002)(86362001)(11346002)(956004)(2906002)(5660300001)(476003)(446003)(14444005)(7406005)(7416002)(16526019)(186003)(26005)(55016002)(217873002)(3846002)(9686003)(386003)(6116002)(6506007)(8936002)(50466002)(478600001)(23676004)(47776003)(81156014)(8676002)(81166006)(103116003)(68736007)(58126008)(316002)(66066001)(7736002)(105586002)(52116002)(76176011)(305945005)(7696005)(2486003)(33896004)(97736004)(106356001)(61506002)(39060400002)(25786009)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0801MB2029;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BVI1PR0801MB2029=3B23=3AtLspv?= =?utf-8?q?pg725frnoozu+jchTvwn5IhWezARy2DQAWX+DhMLUABWBg9qjRqLPL5q0m7Mcvb0u?= =?utf-8?q?tQRQVEQnfCLqnUxXFnjkFSpqFQSMznij70BaElLDpdkNGAyziz7m464RbkvM8aiNa?= =?utf-8?q?9N3sCJEJFWaBc6n13dZsXXW2ux4gSUIIcr3LNnUkZWDqxUIQhZueUBlYy3PijXivm?= =?utf-8?q?clHd6OcYruquVTL1qnqbTvzp6PnGywBQe6TMwAt6Dy+aZ8rHTokxVpLXbUlq6xor0?= =?utf-8?q?JT5XyTb7Ir5liOmYKLbjlkjMAl3swqEgE4tiA49maE87C2pojeE1QIb94l6Whm/E5?= =?utf-8?q?5k7QXPJXevHTCcvX6Ilu1ONZH0x8GTlxCcKaZZzxXBOF/YpNS9+ige4i8PanRUnWL?= =?utf-8?q?M4k+l0oKGMk6zRlgmzAMWZQuBgaEjMO5G6q1T3V7uCQDyyuuigQHtLqK6h6nGGbWW?= =?utf-8?q?FdXEbnjwEcrTL98ato314w1z0r9LtlEVjTealdYWazh5+sbUy1EdYEjhK0+5U7iwI?= =?utf-8?q?Imav4LfWhpm+FhO56rh9HuaUfkRXZD1kRRvFFHJndSDLsqetqvXcPLZjNRXHBieuH?= =?utf-8?q?bWtabbb5W9ark3qcTFgcoEKR7+BNmFTQs/Eckek/8WZgNTM7EE3tIhKAKbpxEfzen?= =?utf-8?q?HvrweMPCVfFL18zOReMxyX0+3NDzEbVjF79CgyTn2yTpen67OghrFV0knj2YffALp?= =?utf-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fVYX4n+qfuvA4cgzDcC7Sjtjo+CMtqqSC9P6Y+QP1MyrxGYFbjS7sgEEWnQuL31k1L2VdqI5z3MltTn/hZeREMTUZNeD832GAm+x426hJ2s/r/hviy8OHid2h/VA/CX/IkjKj23YxsvdRlH2P8gg9UKBXE= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2018 15:39:07.7794 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8580e0cb-9690-4303-228a-08d5fc7beb38 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2029 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 xfs_fs_nr_cached_objects() touches sb->s_fs_info, and this patch makes it to be destructed later. After this patch xfs_fs_nr_cached_objects() is safe for splitting unregister_shrinker(): mp->m_perag_tree is stable till destroy_super_work(), while iteration over it is already RCU-protected by internal XFS business. Signed-off-by: Kirill Tkhai --- fs/xfs/xfs_super.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 9e2ce4cd98e1..c1e00dd06893 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -1774,11 +1774,20 @@ xfs_fs_put_super( xfs_destroy_mount_workqueues(mp); xfs_close_devices(mp); - sb->s_fs_info = NULL; xfs_free_fsname(mp); - kfree(mp); } +STATIC void +xfs_fs_destroy_super( + struct super_block *sb) +{ + if (sb->s_fs_info) { + kfree(sb->s_fs_info); + sb->s_fs_info = NULL; + } +} + + STATIC struct dentry * xfs_fs_mount( struct file_system_type *fs_type, @@ -1816,6 +1825,7 @@ static const struct super_operations xfs_super_operations = { .dirty_inode = xfs_fs_dirty_inode, .drop_inode = xfs_fs_drop_inode, .put_super = xfs_fs_put_super, + .destroy_super = xfs_fs_destroy_super, .sync_fs = xfs_fs_sync_fs, .freeze_fs = xfs_fs_freeze, .unfreeze_fs = xfs_fs_unfreeze, From patchwork Tue Aug 7 15:39:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10558827 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 352DD157D for ; Tue, 7 Aug 2018 15:39:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20B7F2A46E for ; Tue, 7 Aug 2018 15:39:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13D592A471; Tue, 7 Aug 2018 15:39:30 +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 CE69D2A46E for ; Tue, 7 Aug 2018 15:39:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AD6866B0281; Tue, 7 Aug 2018 11:39:27 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A87056B0282; Tue, 7 Aug 2018 11:39:27 -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 94DA16B0283; Tue, 7 Aug 2018 11:39:27 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f199.google.com (mail-qt0-f199.google.com [209.85.216.199]) by kanga.kvack.org (Postfix) with ESMTP id 6E74D6B0281 for ; Tue, 7 Aug 2018 11:39:27 -0400 (EDT) Received: by mail-qt0-f199.google.com with SMTP id x26-v6so13833852qtb.2 for ; Tue, 07 Aug 2018 08:39:27 -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 :in-reply-to:references:user-agent:mime-version :content-transfer-encoding:spamdiagnosticoutput :spamdiagnosticmetadata; bh=Bg2f3sHd7KK1BJ0cbD1TUjK4ril0zWlzMyWwFzFD/WQ=; b=IeUPHkWPGx9TwkgQTXLP/Hf8dG7/GA+m1ao3kBd0EOFInSO2zDDmRaI3/A+IqW36sq uS4newos1OmketssFQ+Z/Yz3oBInHCTeA4PhiChJK7XiCwe7B5SfDKM8l77aFJXooLw4 8Z4ZnpDbp26BBqdliRSg6HR5MB8NJTRJ8Ldxngw0jZctabXE32HGyuaFgwP9psBD8elO U1wjPrf1UMxTrh36IWdubJHZAN/7s63+LAEH4OSkdlfRn9MNQadEcu9FnLYhYdi7tAer +Y9vG8S5Qwu0bmRlut0bFSEsuTeVWMY0Kf2LJtnt6CORdZri3k1L0OJv0iU0nMoEXNyi GHYw== X-Gm-Message-State: AOUpUlF9ue2NCsrnzyQ54hWsm9SvXRwzUxElal6akKSeZu8mIgzQA+xp egAEVuLFneKo66wiPN+PogbG3rWcZsL0iA9fB4/V4suk+BnyrvjsTUqywXsEJEnmzxxMSuaCVT3 7fLH7fT/SgUTRoY4GA97pVpVXeNfT7udATsXmwGLd6LlHB+vkGgGlbvs9mGiqtNXcmg== X-Received: by 2002:a37:8786:: with SMTP id j128-v6mr17024472qkd.32.1533656367193; Tue, 07 Aug 2018 08:39:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeEnyYkFShvehmzm3Kv76xC8+rz6aQ9oQSKBNKl0tKMhAaAhM3eWtFTFzBgkmBb+2vUF4pU X-Received: by 2002:a37:8786:: with SMTP id j128-v6mr17024440qkd.32.1533656366487; Tue, 07 Aug 2018 08:39:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533656366; cv=none; d=google.com; s=arc-20160816; b=KV+rhaWAoZEWZSfOL51zj5TiD9yuiQAleNW/t3iUsglA9dJB5NKnAVbxGPuWwPcf4f 4Ce3wx8umzQbChwekU5KG1HGxhjxXHsh/hkAnRT4J5adb0hF2/9mS08AQth6cQlQ2Okx P76IYZhz/V6LYpXAKdxDV4e7n6/qGtUk+1gPONRZc4KInjDN/iGRGLjolkA7UZ0aykP8 fQIR3denTuDVR6OK6uiR0sGGib3KN4Isgrbmz3nvhPU0akUe1IzBE5VDasJSFr5i0YuK 7hWTL7rFUIk9yIN7u1TqVhgeXrQHN56w/5e+uWUOHqN4J2rkQKIv2WwbhE7LlGY/ssZ9 7smA== 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:references :in-reply-to:message-id:date:to:from:subject:dkim-signature :arc-authentication-results; bh=Bg2f3sHd7KK1BJ0cbD1TUjK4ril0zWlzMyWwFzFD/WQ=; b=KBSsIxqNmB1b4h/bAOzyD0I1jdx56oMUUf44JzT6PtpZoEhkJMEK+KBtP3Ys51xPVv MCro8P8ZHqVf0FKFp1wmZHNUPkK4c4fhmZKVfqy2L1MLNELw7ebKoeT3u+yewRWjN1k6 /TPQS1WAfj4vV5cwBJY/2vqLajK1udhfs1KuE3irmckIXxFaDQ1IJSMcgZ2rbYiSGrmk GWu82s6tJP6zVrchQx/ZXs+oF5Ga7Qu4zxAZKpgmW3UR84UgSHST2dRxLtLJ1mrANJyK XIvON6aoGGOni+0kOTba1nzhYOLLjbbTfwrtWJz7+xfKrxXJZEg9wm61nUsSA6FtLN7D uWyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=GPDr44Tn; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.4.102 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40102.outbound.protection.outlook.com. [40.107.4.102]) by mx.google.com with ESMTPS id q51-v6si229545qtj.66.2018.08.07.08.39.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Aug 2018 08:39:26 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.4.102 as permitted sender) client-ip=40.107.4.102; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=GPDr44Tn; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.4.102 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=Bg2f3sHd7KK1BJ0cbD1TUjK4ril0zWlzMyWwFzFD/WQ=; b=GPDr44Tnx7Yz3WjoerHJjJryCK0MChpRbchqf77gkUN6D8LAZ2YKv6rmMjRvDX+s+yP6gqFb0zzQuVTzgNkKcwuJM5gKViHBb1W16gePdhvxuzGjJcm53nd932zGwto9XD+SxH0rQsl67Jx0qxCSlZDsQKyEBQVLTw8jTIIGujc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by VI1PR0801MB2030.eurprd08.prod.outlook.com (2603:10a6:800:8b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Tue, 7 Aug 2018 15:39:18 +0000 Subject: [PATCH RFC 09/10] shmem: Implement shmem_destroy_super() 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:39:15 +0300 Message-ID: <153365635538.19074.16684830171993560909.stgit@localhost.localdomain> In-Reply-To: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> References: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: HE1PR05CA0133.eurprd05.prod.outlook.com (2603:10a6:7:28::20) To VI1PR0801MB2030.eurprd08.prod.outlook.com (2603:10a6:800:8b::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 227d3eae-996b-4c9c-b285-08d5fc7bf261 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:VI1PR0801MB2030; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2030;3:wM4LiZZYmPpTsig59tCi4wpjdUT3odeDnfEGBKsWz5WF4G+bWqsuYLHqY5LdROqkcFI4/bxITEFE8eqytlbvDSM/j7f+vZrh3PZkl1FBy01h6JRqZSsqFEaeTSo1BC3Ne/EkWu0PDcvb5mzWCCRCULqiFne6LwdkE+AkaFAjjyBOBHN9UOr2kxAHHRbGCNxq8Vxk0r7JX/HjTjYtvMNRij6fWZ2zdKgBrMx5kLl/QmEupQjrdCMrqNPa8mZxxSVH;25:bKwWAaq8kv4+WK9LK1WsoYwRa5hmjaUstAATuQElWrLeSV3oPzL4NlCOtev15UvC6y1IVvhSsuJauXx20/fJs8W09m3XmHcRSWNFitn1zKcxvqLpFU6TCPUmwRs7wf3BDBtwmkKwCvg6b4PNamBQsXTbPKbimQC0YTqlDrUKv3I3Mjv3HAw5WnSROWQuHadPxsgkAYWeimHSsO4b6rIPi0uXuF75dkI3CveYvHgKBY1K0w+AqXGGLv72zx73uisr/QEHWbRMiLfF9TqROZr08qaYcAaN98FDI9f72QXOjIkiSXvloJnwWS40BTrYaglzoi7rwaPekEJy0SQFNokBgg==;31:0XRHVd3k1ucJHT9frTCtfMqHM7M7IOGrXmTtgUTlX7wODuhRS/Ixp+yOT4nWM9dqbKRhtg7AWJfEB/WWYssXiPze/U1SgNpZcOytyvyc14UhTQZ4c+gWcUqBSbph46O17f4Gky4mg14r9+i9j9gL76Ipgp077HiQhw9mvB25iOzDuXCo4Lv+Qyeg8OXMTubyWFdQPBQccZ3X3egbE2Pp2nnCsZQBfifa8yuUqDaMSAs= X-MS-TrafficTypeDiagnostic: VI1PR0801MB2030: X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2030;20:CisEgI9gP53Z37pqt/0p/Kzhsp5uuZmrQ4ipO4pQakWazg1uhJvd5glquir24aAP/bUyOjoUX7HwAgnUT6y/3RySkFBWftFcbjVC/phNW9Zs14YzEa/G9UQe2/Hf37MgxISRS7/Lcjt/v6KBfgV/+4z0cJCd4Fmw2YLsZ2zPZoUSUeJBfegF/GOgKHVqjtg4iMQUv5W9M7vmBf5wHf0pVUOOhBTDmgE+IuqOeSUuXKVFE35WGx8NigQ2V81SZVk32WV5nbuofTJaZCm9TpxFxzfYqsXR7xR3CcccbNzkK2JbfLzHunvklO46HSLmDhtPtYVFEAc5Pty1CFdmxnGuHNqfb1l7CjFLKlaFEFcMQxGWlJVsJrY48Cj2vlVDQe5zJgvkqDK0qP8tEmdEwE78eH87jfWIuaX/2CQ4ji//80corYk0zse3+3Tumrl0AXlQDPxSY08DgMQSqn5aYmivLpp/YLzfZgCk5jIPf8NIh9GXhuDWCHSmr4Bo4JNX6/OS;4:CyXEkGdW3NLEa+0spKkEPWDi02O9hEHAVRsFRqJpHhEexH0jTA3S6ON5OoaU3ysPQLvDrabikq4gcyijhN2CIPmH2Jv3EVFZuK4rSFG+VfCgXSLwUeueodHg4Y9Mi6LP8MwPcPV25LADSWEfTIH70LmJWyB/xtO8l5uUJVJktsk0hyy6rjXJh3sUIk9sf2cD/LIfrmelz3rRgTyCdpaHIltQPHnJ+QaF9SZiitJuU+LjqYJZ9Vzczw36XhdpIuPWFGrkhmB5M82YZbYw1zARfQ== 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)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:VI1PR0801MB2030;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB2030; X-Forefront-PRVS: 0757EEBDCA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(39850400004)(396003)(366004)(346002)(376002)(136003)(189003)(199004)(6506007)(16526019)(386003)(6666003)(7406005)(7416002)(106356001)(105586002)(5660300001)(97736004)(47776003)(66066001)(61506002)(55016002)(9686003)(217873002)(26005)(14444005)(53936002)(39060400002)(956004)(486006)(2906002)(25786009)(11346002)(446003)(186003)(476003)(33896004)(478600001)(50466002)(305945005)(3846002)(6116002)(8936002)(7736002)(81156014)(8676002)(81166006)(230700001)(76176011)(7696005)(52116002)(86362001)(58126008)(316002)(103116003)(68736007)(2486003)(23676004)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0801MB2030;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BVI1PR0801MB2030=3B23=3AlbncD?= =?utf-8?q?zHQmJH0AvJwU1jCHfjkPXRK7yPj1G1nDF3EO2tv9q2kLM2WAGeffWyhht0vjBkybh?= =?utf-8?q?7p6fih8HZ9LYo7oD9+HBY0x0UKXHKlk96Z4mTtlElxeGZmqD45pJuZvUbNdb4rY27?= =?utf-8?q?ZB4edh+wwZmq8IhG1KGc4qAguzxyaSzjfA8wn6XGG73qNvUHLJ+b4TJRTrxXLXAYx?= =?utf-8?q?73NgbiBOpZPjEXUdTWsI+rNYOW6tGRZ/xg7F5iHXp2qw0nx8GyDZw9oXAmzgOjcGm?= =?utf-8?q?x14x7Wbci4QANvWXbLO10mvRvNdptUuIJTzMnG2eOKDIE1VOE6CkJ5f6ILnCZYJ/9?= =?utf-8?q?pdnTUH3fLvMD8Q9XIsMLtiPJ/XzOI2JYvHDhzkYYBJk4d+LG1eJNvSbvVuFPFQDtf?= =?utf-8?q?XfcJsHvGf1CuSo3FYB64m7gQB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zrcmUgUTQsCHhSrn2JU=;7:I135MyI5CPpmz/JTWjOuLXG860YuRDmOMpHtmYFHf/2Vvp6x6ZpYkjOjepoXZOWh3CIYOM3drkVj8duRjTOG8FFMmMlgZwP76gYsXX9e2zFe2TI8zCbtWaYvhMuBzIAde9/w5AFhFJB4sXshMUFQXtQZiL4O3ZHTaYfg6Fb0zfxoiUmQHp3US0JLEA5y1iBtgb6i4NCoCSYtjo5DqRNLMhoBaR9XQMcVk2hzZJUi4sY1LZQtXls12Ez5cLETFz9B SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2030;20:KUpAFL/t1fg1kF2U4kWOfITPEQD3vyA77xqygMc8Z+tO3yueNozCEpcbYEM+qcqBSNlpWHL+1ERWINuak7wEE/oUhVwA0WGGY0zTXAX2iMr3kquf4ERoWG9SCvSAErGzhJSBqLlQ46PNMN3PiADRrn/0YgRWiXgT+JQPZVmUpEc= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2018 15:39:18.7221 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 227d3eae-996b-4c9c-b285-08d5fc7bf261 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2030 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 Similar to xfs_fs_destroy_super() implement the method for shmem. shmem_unused_huge_count() just touches sb->s_fs_info. After such the later freeing it will be safe for unregister_shrinker() splitting (which is made in next patch). Signed-off-by: Kirill Tkhai --- mm/shmem.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mm/shmem.c b/mm/shmem.c index 4829798869b6..35c65afefbc8 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -3427,6 +3427,12 @@ static void shmem_put_super(struct super_block *sb) percpu_counter_destroy(&sbinfo->used_blocks); mpol_put(sbinfo->mpol); +} + +static void shmem_destroy_super(struct super_block *sb) +{ + struct shmem_sb_info *sbinfo = SHMEM_SB(sb); + kfree(sbinfo); sb->s_fs_info = NULL; } @@ -3504,6 +3510,7 @@ int shmem_fill_super(struct super_block *sb, void *data, size_t data_size, failed: shmem_put_super(sb); + shmem_destroy_super(sb); return err; } @@ -3630,6 +3637,7 @@ static const struct super_operations shmem_ops = { .evict_inode = shmem_evict_inode, .drop_inode = generic_delete_inode, .put_super = shmem_put_super, + .destroy_super = shmem_destroy_super, #ifdef CONFIG_TRANSPARENT_HUGE_PAGECACHE .nr_cached_objects = shmem_unused_huge_count, .free_cached_objects = shmem_unused_huge_scan, From patchwork Tue Aug 7 15:39:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10558831 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 53D5414E5 for ; Tue, 7 Aug 2018 15:39:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4036D2A46E for ; Tue, 7 Aug 2018 15:39:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33A132A474; Tue, 7 Aug 2018 15:39:42 +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 8BF162A46E for ; Tue, 7 Aug 2018 15:39:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7EF226B0007; Tue, 7 Aug 2018 11:39:40 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7C79C6B0266; Tue, 7 Aug 2018 11:39:40 -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 68F946B0269; Tue, 7 Aug 2018 11:39:40 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f199.google.com (mail-qk0-f199.google.com [209.85.220.199]) by kanga.kvack.org (Postfix) with ESMTP id 3F14C6B0007 for ; Tue, 7 Aug 2018 11:39:40 -0400 (EDT) Received: by mail-qk0-f199.google.com with SMTP id d194-v6so16852729qkb.12 for ; Tue, 07 Aug 2018 08:39:40 -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 :in-reply-to:references:user-agent:mime-version :content-transfer-encoding:spamdiagnosticoutput :spamdiagnosticmetadata; bh=NpY6Q6iqU9qbYbRcjvh1dP1lXspTE+mMdqm0dAmnulA=; b=nY9DvxLOtokGns0Xecq+PUHQZRQACQbyFNL57vAyL3qVxg78r0FFyDfptVHHGyDUzj D/gIIFdaeXqZjoLdp/YEysvJlfJQk5BGfOXoLddcqJ/tFbO6U4Z9kxBx+kOqs/cqqAsA inj26kg5m/OXdyYqYx1nrO9O0QXSz49fJiwkMyqARlBkfOA9eEI64gA5yaeuisrzMy30 aYI2WQiEGaENau15Wj0B1JnwZPj0zkARYnEqrPmCBFNO+BTjuDMzmEx/WTpdaHYzDLvM 7dYaRkJzsthdrORla42nFN20R21axvnUH8cfpxWSHimohgDTcjqOOwP6BHS84VRLsrxO nMcw== X-Gm-Message-State: AOUpUlHdZxfR7XWR1rtnfYv5QyndPgJgUQYY/hbLAA9imluoMv868BQt ck91Il9UJ5FDBvyguV8/kY6R6d0n5u8+vRkmOPTfcij7DmHTipDXTyYTvP/Bcr6jftBoqQXibQF wSZ65sPUcZ7Cafg8VWFgRzeTE/sGZqGC8tVBrUc6dmamoGq8mj+2dWv3KhCC5of0gWQ== X-Received: by 2002:ac8:29f6:: with SMTP id 51-v6mr19251110qtt.200.1533656380026; Tue, 07 Aug 2018 08:39:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfPvSdyfY1jBZmfQrIbk9nGSkvnBzS9cM7iEaOTGkfva/5YBjOcGRuZjxcXuBnGsozDAkH4 X-Received: by 2002:ac8:29f6:: with SMTP id 51-v6mr19251055qtt.200.1533656379226; Tue, 07 Aug 2018 08:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533656379; cv=none; d=google.com; s=arc-20160816; b=SX3aKdTydASCQVZH33Wds7f1nexN8U35CtwV5NpXhibaL3BkepHTbqVtZRe2cgMkQL 6h8GxGirwviEPK6hzJb7mO24Q6cSZqmMiw01VckolRdpT6/fhBfXW+XOnKVO0uzFzU2r xWIRSjDbDuY69E9I5VnMoF95Os1pxj56o/4a47nhTcUmmprKZIrUO6tQLAvuIkaQmoC6 bP7h0bQFi6HRIB3KhZy1M1DOWcFpMgySBcT8Pbu+wRTpYse0IUdMd5+Ywmo0rQjSgKF8 TmzurzGvaNHV8LYwNbkUo21fsj2IioewjPoWYvIeTT2ZmneLgCVWoOhWKQX1BaMZrKLe YunA== 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:references :in-reply-to:message-id:date:to:from:subject:dkim-signature :arc-authentication-results; bh=NpY6Q6iqU9qbYbRcjvh1dP1lXspTE+mMdqm0dAmnulA=; b=aF0PF3sbC3qba0v726XLpB1oFAmwnC0Ti6w3yZQ8Mnkoe6Bn5FimWAEbJcD4TzbSmh X1xo/+Z3fi4HLqQuSuylEdSRS/PK1S2j4w8wI5TPtSFN0fm8ileQopDhC4c3N8nl55F3 jLsJcu/o6TsX7e5cBkepJCrotcb7lx2bk2XomqKJtZAV6MCioSjQ9qqV/4lmVuH7xl57 3ZlTOf65lrVMH0Gz5mqeN/jj0xywhReCjA3kCiC+W2T7O8BRkB279roQRU/BTc4oL6JB ZxxqxdkqHgiEUw9ZzZuhzmqy2EmLfNprmZjWVqGBYrw1Lz4FA9ObogFI3EMAiuztzPMN 1OBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=bh3tIYe7; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.5.122 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50122.outbound.protection.outlook.com. [40.107.5.122]) by mx.google.com with ESMTPS id k8-v6si1047747qvi.241.2018.08.07.08.39.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 07 Aug 2018 08:39:39 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.5.122 as permitted sender) client-ip=40.107.5.122; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=bh3tIYe7; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.5.122 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=NpY6Q6iqU9qbYbRcjvh1dP1lXspTE+mMdqm0dAmnulA=; b=bh3tIYe7mn/XKikdX7iPR4xUD2MqA8MwCRVFQrCi0LAxqodUptKjcnpU8YTD/krgYhFe0R89zX1jhKF4SvX1px8WzVgWX9neRmYDWxF5yvak4O9oFd/z9mMbiV6yWk8Gik97Ncx0pJngRQjy3usFkpjqa9o2yo9Bxt/SUkQmTI4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by VI1PR0801MB2032.eurprd08.prod.outlook.com (2603:10a6:800:8b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Tue, 7 Aug 2018 15:39:30 +0000 Subject: [PATCH RFC 10/10] fs: Use unregister_shrinker_delayed_{initiate, finalize} for super_block shrinker 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:39:27 +0300 Message-ID: <153365636747.19074.12610817307548583381.stgit@localhost.localdomain> In-Reply-To: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> References: <153365347929.19074.12509495712735843805.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: DB6P193CA0016.EURP193.PROD.OUTLOOK.COM (2603:10a6:6:29::26) To VI1PR0801MB2032.eurprd08.prod.outlook.com (2603:10a6:800:8b::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7a61e6cb-96d1-4380-78ae-08d5fc7bfba6 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:VI1PR0801MB2032; X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2032;3:4wpi8thsO3hOYWfZpFCW84iglbdEDdwzm1tkrdT5jhMCXzH7pqBkjpx9FUdCSM7wdCwAMTPpwOVmD5mrGSDQnjY8YzrTu2eclUc32KAMH5I3WXW8tnqz+krii18pMuX9QTQY3UUaR+0InJce9bqGlEVMIHxlSxIiq9OV+BgF9u/GqAKhuAUTG6YVpF2PCeWjdSl3+h9y1ku0F043z8mxYDX2FA0xLyK6qrf2kMWX+9AMp3FSwkh8dv/zrORJA4ta;25:30igJ9Zj39XwMENlc/Wr4zBKarlPlL+ki7yBJZ5MpWc4C5K+R+Eyv/b5huuBl68+ZcTHICIyFVvaPmIO96Die4rjAO13Oean7Opntdm0YEdZvwG7Mg0AXvMbcIPY9wOdgPhHkLKNxAzRJrye1+WHRfd1NgAMMGwHoci83Augxc2sZZRGydkK2b3MoHKccQWM0vLl1SIJP/JdONd5z3k3hpR6oHBXwfaiR80SwEZb1oMhTcRJ7UL7Xudpahtu7TroAnQksfEcM0E7brrb2GdaoCTveNWvpXZkzwK2NUWTqtwGPjUh/jiq0vtHtAChfy/pfs5hYyzGYXdD4bpOwERNSg==;31:zD87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5zJZpw== 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)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:VI1PR0801MB2032;BCL:0;PCL:0;RULEID:;SRVR:VI1PR0801MB2032; X-Forefront-PRVS: 0757EEBDCA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(346002)(366004)(396003)(376002)(136003)(39850400004)(199004)(189003)(106356001)(105586002)(217873002)(956004)(61506002)(14444005)(66066001)(486006)(478600001)(11346002)(446003)(7416002)(39060400002)(7406005)(26005)(186003)(6666003)(86362001)(575784001)(97736004)(230700001)(476003)(5660300001)(16526019)(6116002)(3846002)(53936002)(103116003)(6506007)(68736007)(386003)(305945005)(7696005)(7736002)(76176011)(81156014)(8676002)(81166006)(2486003)(23676004)(9686003)(25786009)(55016002)(47776003)(8936002)(50466002)(316002)(33896004)(58126008)(2906002)(52116002)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:VI1PR0801MB2032;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=3BVI1PR0801MB2032=3B23=3AC+F6w?= =?utf-8?q?cqNwjT04he5iZERmtP+13A7muZVzNyhH3VhbxkO1BfjSeCjEr5IwOSJjGGcgntwiA?= =?utf-8?q?pLgqV8TgjNfgKCAAiYaWY1kh2xnb26NrQGiZYHXWsSIWdcTQqZNgfg4TuEgOoqNk5?= =?utf-8?q?+3estAclrovAl1dN0UAxySiVd0pN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kKhc1WX5ob2l6wJlOsKybn9lTeJ4bMtzpPpwQlDN0TJojufDpGwaiS/My5+j0gJ3y2tfXCXkllPROlCfjOmnQn/82gcaRdNM15XTsuS5LXA83bo6cc5JkMkbH+oojvQEmj3l/bqRCozm3phlg==;5:YfYMhqdkZ3Op8IjW74IHO2d50UhHuqXPGZ4uVwJyQVBJ93IAgLDh0pvfTfpo0EuSf8rdnqzbEjYMhAxjcsJNjS4IM25eZx4egctcLqSLctmRXiyppkHBXdX9H48UJRphAakfHbmVzG3bihCyex+DGhoDvelJeTdqocmZqJSKn90=;7:jmnjxCVhobgFRlAE20T8RgDhCUaDMUMlT8FPI1qmHe7k88XW5AIvRS3aW2s4Rofb3pARVjK26KNUgsB5X5DRqGEA9UEKfTgKilPmUDHESJL1eeRJXpax66izN0zNt6R1yVnu7bA7hCYMCRWHJf6iSmSeuQlvJJXDRF/dvbpQJDOFpVMQTN4P94OB+cHyGEMJHbVy6M08y7hoa+lRnSrId+A2NkMUXD4DmMcYOjkTvOlLtAZfviWIBBGiuxfZ/QuD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2032;20:umyMl2BNKxz61NYa8ZIs42Emw4BgclTsfxCVNiA/Xh6iaKmJyU6INIkWaf5IHOVd7xF5cjdVv5e//vR7twU8oS7wKKK1EJQlmWUp1dHQovH6eMmwdqBUjYpcNBvnXB12E+tjTN4hazLwxG/rm1SxTmwvW6wIH5pyTWfXep2iOu0= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2018 15:39:30.9644 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a61e6cb-96d1-4380-78ae-08d5fc7bfba6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2032 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 Previous patches made all the data, which is touched from super_cache_count(), destroyed from destroy_super_work(): s_dentry_lru, s_inode_lru and super_block::s_fs_info. super_cache_scan() can't be called after SB_ACTIVE is cleared in generic_shutdown_super(). So, it safe to move heavy unregister_shrinker_delayed_finalize() part to delayed work, i.e. it's safe for parallel do_shrink_slab() to be executed between unregister_shrinker_delayed_initiate() and destroy_super_work()->unregister_shrinker_delayed_finalize(). This makes the heavy synchronize_srcu() to do not affect on user-visible unregistration speed (since now it's executed from workqueue). All further time-critical for unregistration places may be written in the same conception. Signed-off-by: Kirill Tkhai --- fs/super.c | 4 +++- include/linux/fs.h | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/super.c b/fs/super.c index c60f092538c7..33e829741ec0 100644 --- a/fs/super.c +++ b/fs/super.c @@ -165,6 +165,8 @@ static void destroy_super_work(struct work_struct *work) destroy_work); int i; + unregister_shrinker_delayed_finalize(&s->s_shrink); + WARN_ON(list_lru_count(&s->s_dentry_lru)); WARN_ON(list_lru_count(&s->s_inode_lru)); list_lru_destroy(&s->s_dentry_lru); @@ -334,7 +336,7 @@ void deactivate_locked_super(struct super_block *s) struct file_system_type *fs = s->s_type; if (atomic_dec_and_test(&s->s_active)) { cleancache_invalidate_fs(s); - unregister_shrinker(&s->s_shrink); + unregister_shrinker_delayed_initiate(&s->s_shrink); fs->kill_sb(s); put_filesystem(fs); diff --git a/include/linux/fs.h b/include/linux/fs.h index 33dfaed0a01a..8a1cd3097eef 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1902,6 +1902,11 @@ struct super_operations { struct dquot **(*get_dquots)(struct inode *); #endif int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); + /* + * Shrinker may call these two function on destructing super_block + * till unregister_shrinker_delayed_finalize() has completed + * in destroy_super_work(), and they must care about that. + */ long (*nr_cached_objects)(struct super_block *, struct shrink_control *); long (*free_cached_objects)(struct super_block *,