Message ID | 153365634503.19074.14972123229522734895.stgit@localhost.localdomain (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-fsdevel-owner@kernel.org> 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 9183814E5 for <patchwork-linux-fsdevel@patchwork.kernel.org>; Tue, 7 Aug 2018 15:39:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 812562A46E for <patchwork-linux-fsdevel@patchwork.kernel.org>; Tue, 7 Aug 2018 15:39:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73F942A471; Tue, 7 Aug 2018 15:39:24 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13E712A46E for <patchwork-linux-fsdevel@patchwork.kernel.org>; Tue, 7 Aug 2018 15:39:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403854AbeHGRyL (ORCPT <rfc822;patchwork-linux-fsdevel@patchwork.kernel.org>); Tue, 7 Aug 2018 13:54:11 -0400 Received: from mail-eopbgr80114.outbound.protection.outlook.com ([40.107.8.114]:45240 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387578AbeHGRyK (ORCPT <rfc822;linux-fsdevel@vger.kernel.org>); Tue, 7 Aug 2018 13:54:10 -0400 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 <ktkhai@virtuozzo.com> 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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+aSvfxJZfw09qqOpeaEdi3EajEOzkAPtnMFyL6Wkfpr6SR7N9vVy9onuYFGUJRt/IG8AAqLBTKzl;25:oh1uESEP+TeKoUJiAfGC8rRuibEGj883mXYMzfpELkdGlWi9Z0Dm3LBsuzZP2H6wbHCx+lIZCYMm5VFg0morORuwUt3BXTscJ1oiHZZDM+Ael/q9TOi3RQrOwpC0/sIMcBivLxzoWRBOycrU6UZVrO/E1IUs0ktp1NiHe5+f9s1igadTHQcQz2fiiDgUDxeXM6VxlfQ1s7aTuBhBWOyiKPqrUTQVarZJGAC8UaP+nZ3qYw5VLovPihDuZKiRXVXLKxJ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zj2g/JSjZUHb23Q62rauVHysTfN8mVDMk6vYATlB6MgWvFsyFMsBVJozZQg7E65GA056NdFvXyZpOXzQKFz1arIXO19vGTGqOZ6m5YgLW0H/bP2leDxnZJbpQ== X-Microsoft-Antispam-PRVS: <VI1PR0801MB20298CDD97AD727AEA04D65FCD270@VI1PR0801MB2029.eurprd08.prod.outlook.com> 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+jchTvwn5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5eT3wBCoKjEiMe9+R6yKs0o2RBIbUKbDkf+wVrxdlj1z1Btg9E8V1JGxdAAyp2/O/9vf0FXSLfUX01xN0IMbr2golq2MeeBEAH1BswUkMJAeO9QgXJ+VvilWoqc5inECF+nEn5MS9hUG/W+eCnsGPYbRCseviPBxB7oGXvp6QQS2ysBvoDCyvBSFQeRocoR2xNaSUNujIsud0qPOswdsp/hQPR82abZyiy3VOmT0bReBwNMS7bCwx9beXXPR33DHiX0A==;5:1OeBnTehfk/k7s9bClNF8qSP2Jk8w+w8J9v7DD5VVVXzOlOMFWpypdUc1xLvNkEtz3fOif/PPNosKC4waNoFayZc5iLh2H+TS5Vfe7SpWtv+st6LrFoXq1iPYYGs9pA8tQZ/WZ4+2Tgt4DpE+qukACg2hHY92lQs/HCaaOHFinU=;7:/F2DbzJW7NW5lx0pErAqcWWQTC8LmiWciQZUBFW1eeL2vU/aLLfnb7Zx+ZK7wxquRfY/hR8x/Y4yQrf0bXDsI4xGMqaD4I/z448N/GV9sPxiq0fMuQXH7cxcP7gJXuxBb3XnE3ioxfVWgiYUjAZ39rSPaUAEQT1hBXUnC7GLUmcjCW4NKMZfOH0IbntvAz4I7TIINrFrgr3C6xw2ig8RPwtIP4kEi/U97Mlat3G2GaIOY8c+M2Nfm7KJ0vcr06Sp SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;VI1PR0801MB2029;20:wzUR5MiLoJ2LdUk+9fVYX4n+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 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: <linux-fsdevel.vger.kernel.org> X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Introduce lockless shrink_slab()
|
expand
|
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,
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 <ktkhai@virtuozzo.com> --- fs/xfs/xfs_super.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)