From patchwork Tue Jul 3 15:11:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10504355 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2C6B560325 for ; Tue, 3 Jul 2018 15:11:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 168B32852E for ; Tue, 3 Jul 2018 15:11:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06CC5285FE; Tue, 3 Jul 2018 15:11:52 +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 550CD285D3 for ; Tue, 3 Jul 2018 15:11:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 034316B0290; Tue, 3 Jul 2018 11:11:50 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EFABD6B0292; Tue, 3 Jul 2018 11:11:49 -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 D4DD36B0293; Tue, 3 Jul 2018 11:11:49 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id 582A56B0290 for ; Tue, 3 Jul 2018 11:11:49 -0400 (EDT) Received: by mail-ed1-f70.google.com with SMTP id c20-v6so1056415eds.21 for ; Tue, 03 Jul 2018 08:11:49 -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=NhY7pptvrdQUeAPyxm77YPIKeedaC6A5DJ1M8SDYr7A=; b=ltu31iMDoiotNOE1U1K0NZuHIT5iR87DZDBvAgVqjFvJd99LHKR3VjqGMgdjLScZ3+ X++ed3lfkR+FGIuyJujWucEMJ7wKSh3C6NaFY2fZ+fE65m3G2JACqLdB4YCj0uTnz0fH tRXnPfCR7OUwddj5yeSIepvpDa+paPz8PO9ZdD0ccOoAWiyyeBmt0JnIeTOcUxWxPYJW hqmorN/r9q4EWocQqVIqKKE2Iel8aiflzvY7TKspgLZF33+HZ/D7XtAy7hOQuAUtCRVC mrDZUn9Ur7dAVG9fvOMZCh/HSSfW4JZeHqwg/KvvETehZIUs+WDLlM/FE0ww5RBZ2y7d XhDw== X-Gm-Message-State: APt69E3KQapLHII2TEas/ill6jt5/WFUZSjtS5eG3QeVbv6yds9Wpx+D J7936Fq9oZwoW9XJTkF95qq6MkmSGuHqfLuiumgMWYpq3pqEOdQIcCaMP4vzrUel+PSjTt0C4PL 1Tux+C+9lsXoI1TZVvHOeLyPLrsQfpK86+l/yLw487ZFhDm1f/1YxQvwjVToJcMDM6A== X-Received: by 2002:a50:8c02:: with SMTP id p2-v6mr27742722edp.282.1530630708893; Tue, 03 Jul 2018 08:11:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcRL6lVD/PR9V3XxsgLeWsCOIRNMUyXFqLKMvHWvRty7tH9re58zOwhdWklx+jd1IC/yb3G X-Received: by 2002:a50:8c02:: with SMTP id p2-v6mr27742648edp.282.1530630707610; Tue, 03 Jul 2018 08:11:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530630707; cv=none; d=google.com; s=arc-20160816; b=CzvbCllTmDB0UUDK6q6uYqbKC9GYFzzNugjPpDgX2dAuwZMvTPTRkMwxu9/eTgWVj0 TuuIfHBgf+OBGFv0AL16xtxQsnJBFwdyAzmU0CLW+tyPos49a+CeZieW5csrbbUpj7zB 1QB7bfW7hpKS+X0UOVBOl9ZskigAqnYjjIgRBmKHltg9pOrzuvthxokYYhftzXZrgW9M rRc6paqZToMBW6qBdGa3vicJdedSxBHnFFoPsQ0v81t6Gbymv9WM3HM/DhzaASt/cR4W sbVdrRohamy5Ez+lsD6w1UfLjnGofEMkXtRXsfoSYhLTwjSDWpcqOkv8QkWYIB+ykT4T E1+Q== 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=NhY7pptvrdQUeAPyxm77YPIKeedaC6A5DJ1M8SDYr7A=; b=IlZ9TQcJppfYSGLIC5fcWOyF8dhv1gPqYGxPVUd4GSYiu5TcEQrOdx5WYy/21SsveW ED/YEKG79wutFvLbXGSdnBtPxfOmoOScJ1unmg4joyEQ9+kjfU1PiFUODq6SqowB0x33 0C3daf2Vv0V9WHtHTuMU9HqbnvPJKBy0fcI0yR7RVEgk70LYtFqFFjXHAhjr2SEEG5Tk Ud1NwraOsLWdCl9/NGtxnuTFO3aR6OYAdb/cYgpGFmUnUjiuMXMQ3AqkN6xWeiijIHI6 A2ET5jHY9JZGgIe8uBK9JDVt6nbJhraMFkjfk5N1GiWth6xAVr07XfQ9+Cn2GEk3Ok6q xcQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=QEjGmspf; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.1.124 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10124.outbound.protection.outlook.com. [40.107.1.124]) by mx.google.com with ESMTPS id l63-v6si1411452ede.449.2018.07.03.08.11.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Jul 2018 08:11:47 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.1.124 as permitted sender) client-ip=40.107.1.124; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=QEjGmspf; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.1.124 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=NhY7pptvrdQUeAPyxm77YPIKeedaC6A5DJ1M8SDYr7A=; b=QEjGmspfSYb5kbUYL6v631ZXxu5++SN5Vv8eVKY9sY/FB6+EkgfKAUa7S2FyFRoyn7XGEmuVcgVEaOGOLaaTRSXYa9AxP16OwM9rkIbqd38Skwe8UfBmvZUaH8hfm9+ySOWXzyHlRk95b1wmKKGAg95YhHRjQdHIbE3egFz6vkU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by HE1PR0801MB1338.eurprd08.prod.outlook.com (2603:10a6:3:39::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.23; Tue, 3 Jul 2018 15:11:39 +0000 Subject: [PATCH v8 16/17] mm: Add SHRINK_EMPTY shrinker methods return value From: Kirill Tkhai To: vdavydov.dev@gmail.com, shakeelb@google.com, viro@zeniv.linux.org.uk, hannes@cmpxchg.org, mhocko@kernel.org, tglx@linutronix.de, pombredanne@nexb.com, stummala@codeaurora.org, gregkh@linuxfoundation.org, sfr@canb.auug.org.au, guro@fb.com, mka@chromium.org, penguin-kernel@I-love.SAKURA.ne.jp, chris@chris-wilson.co.uk, longman@redhat.com, minchan@kernel.org, ying.huang@intel.com, mgorman@techsingularity.net, jbacik@fb.com, linux@roeck-us.net, linux-kernel@vger.kernel.org, linux-mm@kvack.org, willy@infradead.org, lirongqing@baidu.com, aryabinin@virtuozzo.com, akpm@linux-foundation.org, ktkhai@virtuozzo.com Date: Tue, 03 Jul 2018 18:11:35 +0300 Message-ID: <153063069574.1818.11037751256699341813.stgit@localhost.localdomain> In-Reply-To: <153063036670.1818.16010062622751502.stgit@localhost.localdomain> References: <153063036670.1818.16010062622751502.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1P18901CA0012.EURP189.PROD.OUTLOOK.COM (2603:10a6:801::22) To HE1PR0801MB1338.eurprd08.prod.outlook.com (2603:10a6:3:39::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b81fc3f9-e750-4c97-4083-08d5e0f748f4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:HE1PR0801MB1338; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1338; 3:U8+KieqN1Q7+wqSrJMm3F4+sGlKvpQxAKd3/URcNVY0LrvLsjXSz2WxxKD8lQjv5hVhQdYNkIUOCBdLu7VD0qhsApYPEplThdjo3wg3/fyNyFHNDIgovJXn3rt3goxQ+9R/QrG05LKSX5XHmxb9J3BjMOkxaf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1hi4x7SFgP46FPMGxX7WnbXgsyHWWl2X+DsiXv14CNuK64nTLtrdnGbekVIzQ2mxDs6nnJfe9rTyNAOCyw2brY5T8vPNMszwegDhIYiJCd5iSz8SPc6bN7waa5v1V2I445UQS/B/EYk+2yqqeiTmB0ezUAzxTTSYP/u9HhidgojAOvb8w0tRYs2oX; 4:rAI+6upW4So9ZQ0iQDX635IcylZHlt9Up7k/nWLQatD9QHpp5owqaIUwY4lYjpapJ4hHXDn0GC504u1jnVi9rrRC9eAbvxaiF6Z/3HzWQNJcKbOGC6t6TFWJb1egh6e1wRcrxh19K2OvdrW59E/3FqxNVJAHeAomaXTUw169YTcU4NobNXexGGpGLfOWVCcAsu4UMkKuQIgU/wG6KW5Ae/erP+FspnxO7PcKkl/VhVZ9uF4dlqCOwt5ELWpNhHYhluddJWb9BhDqVa7m9vExFtRS0Tn8s5F+UiwG0yU/b/DluaKZ0qKBx2Z8IvSTaW2267TQ/FYH/FNI3kys/FLz5dWLPzJnKvfCQsow7YcEiqwb+TcvkYTDT0lBz8fvH/Mi X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85827821059158)(211936372134217)(153496737603132); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:HE1PR0801MB1338; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0801MB1338; X-Forefront-PRVS: 0722981D2A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(366004)(136003)(396003)(39850400004)(346002)(376002)(199004)(189003)(7416002)(9686003)(53936002)(2486003)(23676004)(7696005)(52116002)(33896004)(478600001)(76176011)(186003)(55016002)(25786009)(26005)(575784001)(86362001)(446003)(11346002)(14444005)(58126008)(956004)(476003)(316002)(486006)(66066001)(61506002)(16526019)(39060400002)(3846002)(6116002)(47776003)(2906002)(103116003)(68736007)(97736004)(106356001)(8676002)(386003)(6506007)(230700001)(81156014)(81166006)(6666003)(8936002)(305945005)(7736002)(105586002)(5660300001)(50466002)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0801MB1338; 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?B?MTtIRTFQUjA4MDFNQjEzMzg7MjM6dG5TQjE4SFYzZUJidG4reitiWFhNVENm?= =?utf-8?B?ZHFjNzc4Zk9tVUh6NXBQWFMvZFlIRmNWeXVmS0F0eDRjNDd1M0IwdEhMVm1O?= =?utf-8?B?TlJJUGtGb1ZTRXVIYXVUalNDbFFYNGVvZDNTVFFBRzlVSlNWdzRwSlFRQTNK?= =?utf-8?B?TjBVbVYybE1pVDRnYml4MmtlaE8rNUlkbXI4USt4R0ZGNVZ3djZkZElLdlRS?= =?utf-8?B?RlZPT1RCYzJyL3RxSEtTbWFHT2sxQjkyTEoyK00xNHdpZzVsMytkZGhNK0s4?= =?utf-8?B?dnYzLzdlck92MTkxYkV1SHJzY3J2bCt4UzBEN0pOV051ZFFYUDVzdSs4OHBa?= =?utf-8?B?OEszY0NuSzlVd0JXYTNoRUpDcGtyT0dPc0FWT0d6cDVLcmF1Uy8yZU5mSkZu?= =?utf-8?B?ZlJjanRHYlFSVkk4ZElxNlh0cWNkMjJxd0hRU2F6cDI4amJVVEtibnRlYUQ0?= =?utf-8?B?d1RkL2NhcHBpbFhERlZZdEpFbTl5V2tUUXBwSWNqWFNwcDZRamxiMGJZaUs1?= =?utf-8?B?M3lZb1dHQUFBOFRSdkV1OExWVXVSVm1QUlRVSEMyZU1zb2xyZmFRalg5WFlU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A1/CRc6jIW/cg4sUKPq5IYaeKpkyhrj/yKS6wBAClaX55YewSa+WwJbLYuE6lLgeW+Zcz28byaFHZf+/uzuK811ZYG48d/ouF6QN1RBS7yGWAQdXhAQHZDt7uMQQOtkRK9yMsjqEXzz6J9suOkhXGdwXtcBOxiP/ULTnRBrsENbBCfMZ91kbsjoJdwg==; 5:JaIqKbTjmmd/ooikBjKZKZiDhRppyvZRAW4uGCcbKc3U25sY57CZGdLNduu/IgCUO/FVkD9iWVtvk+i9LIJa0FySMupfIG6Xjibwi9YewnqzfRxHjLqGrTvSfZCaLUbqZKFdCqVI0GEgyXp+IsCd/4Osjn56Bj8JZUaPxd/6in8=; 24:XP3x/f5h89AHbskOR8kfYfrQS1Vk5zZDLoQfc7Hm5Njkr9/veJQr84rMMgHla5h6QSJ3qxtYrFNT+d3vW4NKRwCsZkCXYrISciMcpnCW7J8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1338; 7:cruQ6W0iNUeCezpCAnXdoc6gPnAkUTCYraNpP3eBBxPrFbEVzxaVnsYagF0U0hzEBNyj/M1jczV6J+cNhDUzkjo7JHlbgr6NVwScv/cVtXlswl2yAbaTp3qsFeoPDG/wE+6mVrf+U9xjCXDBL21zBAY+15hilZcc3ZOIwFOkodKpEEDnH6FelyQy8YMwcj6LvtHuL1dB6SqwBHcHPB4ornVbU//Zm96/2MYNHW73W0KChSPKinQdqihF0u/7lT7a; 20:uDfpUbDd9Dv6rA4vj3NAHtZya8M12r1lg92CfzTiHjXKCtzwfbD+a51pMihuwzXW30CckwjSQFJnFRPYCA1NBs1FCq/TFCqA+FYH1aDuI8RlQUc/GINVANtKA2Vz4SFMRL8yZeva4boaLwwUFj4zKTpQRuKRiv1NaBQWVbfg6Eg= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2018 15:11:39.9084 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b81fc3f9-e750-4c97-4083-08d5e0f748f4 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1338 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 We need to differ the situations, when shrinker has very small amount of objects (see vfs_pressure_ratio() called from super_cache_count()), and when it has no objects at all. Currently, in the both of these cases, shrinker::count_objects() returns 0. The patch introduces new SHRINK_EMPTY return value, which will be used for "no objects at all" case. It's is a refactoring mostly, as SHRINK_EMPTY is replaced by 0 by all callers of do_shrink_slab() in this patch, and all the magic will happen in further. Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt --- fs/super.c | 3 +++ include/linux/shrinker.h | 7 +++++-- mm/vmscan.c | 12 +++++++++--- mm/workingset.c | 3 +++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/fs/super.c b/fs/super.c index f858178f74fe..00b0154487df 100644 --- a/fs/super.c +++ b/fs/super.c @@ -146,6 +146,9 @@ static unsigned long super_cache_count(struct shrinker *shrink, total_objects += list_lru_shrink_count(&sb->s_dentry_lru, sc); total_objects += list_lru_shrink_count(&sb->s_inode_lru, sc); + if (!total_objects) + return SHRINK_EMPTY; + total_objects = vfs_pressure_ratio(total_objects); return total_objects; } diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h index 7ca9c18cf130..b154fd2b084c 100644 --- a/include/linux/shrinker.h +++ b/include/linux/shrinker.h @@ -34,12 +34,15 @@ struct shrink_control { }; #define SHRINK_STOP (~0UL) +#define SHRINK_EMPTY (~0UL - 1) /* * A callback you can register to apply pressure to ageable caches. * * @count_objects should return the number of freeable items in the cache. If - * there are no objects to free or the number of freeable items cannot be - * determined, it should return 0. No deadlock checks should be done during the + * there are no objects to free, it should return SHRINK_EMPTY, while 0 is + * returned in cases of the number of freeable items cannot be determined + * or shrinker should skip this cache for this time (e.g., their number + * is below shrinkable limit). No deadlock checks should be done during the * count callback - the shrinker relies on aggregating scan counts that couldn't * be executed due to potential deadlocks to be run at a later call when the * deadlock condition is no longer pending. diff --git a/mm/vmscan.c b/mm/vmscan.c index 39f0ba75f7f7..96279b5f1f6d 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -453,8 +453,8 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl, long scanned = 0, next_deferred; freeable = shrinker->count_objects(shrinker, shrinkctl); - if (freeable == 0) - return 0; + if (freeable == 0 || freeable == SHRINK_EMPTY) + return freeable; /* * copy the current shrinker scan count into a local variable @@ -597,6 +597,8 @@ static unsigned long shrink_slab_memcg(gfp_t gfp_mask, int nid, continue; ret = do_shrink_slab(&sc, shrinker, priority); + if (ret == SHRINK_EMPTY) + ret = 0; freed += ret; if (rwsem_is_contended(&shrinker_rwsem)) { @@ -642,6 +644,7 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid, { struct shrinker *shrinker; unsigned long freed = 0; + int ret; if (!mem_cgroup_is_root(memcg)) return shrink_slab_memcg(gfp_mask, nid, memcg, priority); @@ -659,7 +662,10 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid, if (!(shrinker->flags & SHRINKER_NUMA_AWARE)) sc.nid = 0; - freed += do_shrink_slab(&sc, shrinker, priority); + ret = do_shrink_slab(&sc, shrinker, priority); + 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 diff --git a/mm/workingset.c b/mm/workingset.c index a682306db49b..8350b6ec76ce 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -397,6 +397,9 @@ static unsigned long count_shadow_nodes(struct shrinker *shrinker, } max_nodes = cache >> (XA_CHUNK_SHIFT - 3); + if (!nodes) + return SHRINK_EMPTY; + if (nodes <= max_nodes) return 0; return nodes - max_nodes;