Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4934875imm; Tue, 7 Aug 2018 09:43:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdYJBbHhHCvLmVtgj6iUAB06N/VuzfPYlscA2JNmUXgY7VfQtZsDMf89U9s8H4A9FiWHXHM X-Received: by 2002:a17:902:8541:: with SMTP id d1-v6mr18873370plo.81.1533660182323; Tue, 07 Aug 2018 09:43:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533660182; cv=none; d=google.com; s=arc-20160816; b=Q32JMI0bZyuhQY0JCpFBiBHyhukRd93mz1FrHDui8OfViIfxeXpd5IkOP1AepSeZ70 ba9CIC5o7cKudk26QeAqz0XJElcm0oKuaU88RWu0F0NQABskzAvNye8QcKjSM8LsosiW B/L1awrZjTOkxXYPGdXLhn0NT+FF/fRh7abJr+p4a9APlfD63blBMRNTR8J2sN7D+z3a 2njSykHSzZ/5hBH6jvYwDUxuw01YGNPKFUk3KK4dVUfRpyj5JDoGVFDkXlDN/4XuqSzK Ss01AsBhzkva9DVEBFOB4hvMHbOaH8bObg85U3o3SNebSOWiB65pKOPP5FLUkWBYn2zL r+gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender: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=xRISyoFZe/5ZOfVADFB/54OJ2ulsMzXvVpV8wyICZoO4/l1garY/a6wG1ybhk30c91 N+jURyMzjzb12D6/D+83CM0fjNPwZrIzRXGEWZmdyyxHJvag9Ps3UTOExsw7nsP72mEF Oux2D1VqAxUCJNRXxFvnflOvPm0DLyk9U74wl5bHZdUNl/QxWDeJS4Z4UNPIM9DiXQ2E xp9OoiEdNacoqdAGQ8b1+LrGypNZUNOFD3as19Ph0RT88Gk9mWaced2L2dvcXWqxxBFM E8fx8xFmmXtBRAl34lHMYS6oY6FTBIu9yef5v8PLW2QDqqAQnnpQfL7+XKoucRFi0pjA dylw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=H3ZkR6BY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x32-v6si1346100pld.330.2018.08.07.09.42.47; Tue, 07 Aug 2018 09:43:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=H3ZkR6BY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390046AbeHGRxj (ORCPT + 99 others); Tue, 7 Aug 2018 13:53:39 -0400 Received: from mail-ve1eur01on0136.outbound.protection.outlook.com ([104.47.1.136]:7872 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2387578AbeHGRxj (ORCPT ); Tue, 7 Aug 2018 13:53:39 -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=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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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-Exchange-Diagnostics: 1;HE1PR0801MB2026;3:Ep2J8WJ9cstVkVfzYUct6fQuXh0K+MQaR/vRNrwpDOGF7IY9hgAwvH9kvuTRadeVLVafVBVLofD8x+87LW+W4SLXitAMMhh0uA1gjReWxOmIR/AZ/lFbZNq7R2/Ll/n80/I+BkP6/GVqD2gu7QZfEXdamfmsG6y5Kro+hBS3+cr4yfJqev56fFiqVleR3dIzVSLuw9PFzs8L1iDpXs86iKY/SKH9WgaW6LqVE3QJIR03tdNj+Q8NXt++3+XHGbzE;25:k2PMV37nlw386iO/+KBiciYAp74HxzwctN5AxYSZwF9dmyzM/uGPRFSSUGbWu8IzTtdFP42pKyzmouy8EygTmtVIzBIlj0SJNNl3e9CtSASxiXfNYiWoQsoFg4Cbg2Oq0FcT7eSHBRYencfCdbmEvd009OtrzRiXJrF+SIc/LUKvfbvqebkwE/Xg2Ysv6WCfesw2Gq65SO/IkL/5TXMrKhJySqucdFGG00UrQrEQrFTFZ/yujdfLTkAPlOsX2eVRqbxZyTRFwTfw8jh0v/CSFJQwjkMFbVcmjRW6SFkrw7wb769bfDg+fL8o6uE4CtAftagsnV5lzYqRLw42UhzhAQ==;31:rg/q8LmsdKDM/JgXMcQWzdK9u0Oh0au0/wbPRyNkTJbkqK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RVS: 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?B?MTtIRTFQUjA4MDFNQjIwMjY7MjM6L0NmNXJRZVJxUWc5U2pWWnJvb1ZoZXYv?= =?utf-8?B?aCtuOEFJUTRnMWJybjVBQVVxZWkrNFczM3Y3RDVzRzBuY1BNNkhXTEhDMjFZ?= =?utf-8?B?dTBwVFJSc2IyTlVXYmJ5eVU0cTVoR1JkMHRabWFtaVRnMGtlV25IdUJ5Qk5X?= =?utf-8?B?b2c3WkZJRnA1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TknrBFnSlRErpV8G4CYrAy5vzXS+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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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();