From patchwork Tue May 22 10:10:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10417885 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 235ED60224 for ; Tue, 22 May 2018 10:10:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1175327F90 for ; Tue, 22 May 2018 10:10:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 055CE28BAB; Tue, 22 May 2018 10:10:12 +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 5830A27F90 for ; Tue, 22 May 2018 10:10:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2598F6B0279; Tue, 22 May 2018 06:10:10 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 22EA96B027B; Tue, 22 May 2018 06:10:10 -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 0F7D26B027C; Tue, 22 May 2018 06:10:10 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qt0-f200.google.com (mail-qt0-f200.google.com [209.85.216.200]) by kanga.kvack.org (Postfix) with ESMTP id D02826B0279 for ; Tue, 22 May 2018 06:10:09 -0400 (EDT) Received: by mail-qt0-f200.google.com with SMTP id x30-v6so18475054qtm.20 for ; Tue, 22 May 2018 03:10:09 -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=epAoOWS3Up3BXRN2vT7DThvnsIoWFe5vZFurQUYB+MI=; b=FN24qTtkkgx0zdDG7ZgHJjJXNZab59+2U7nxFEfuQU3LNcRTd19XoYCXpAkVFZokmi 2kEC5fDGmc9WC8YehHRdW3ZmSUQEOtdnJDiV0nYXVgVR/thF4hSGxLeHVKlWglH0ZTmI Z6LT/D5D3XlJRtH33+Nt1MUeWnPQFc2HED4tQ8sTQPnw1XxtvQC2mvSvTOgZPWlVAZiS PquQ4TTx9l/GIKg3fVUZD7fBjH5x4IsP3OXwwNUsK226ZM3XaUCSP4mg1zNl25gQOC9k WWAo37d9XB4jx8VFmt9uiT2ac43fLHW1HFGttrsf9p7DkCU1x2iQ1ADh1g2PRQkXDUVl a9wA== X-Gm-Message-State: ALKqPwf0iSII6m3DrcIFTYiJ7uNU8mOP6QYvmRsytGPTUOZYDAU5+1Ko ahkH6bkk2ilgOh0rPt1cuV+vN7DDZZs10Kj3RhuId8AywZlByW2b5UoXYsD5hyjCCkNKPfIP+HI TDLIJ5WgjJDqKwTX0GSfd3gWIG8lSeWxYAi25yH7ia6HSbsokPkDMvT5/wnJ09wTe/A== X-Received: by 2002:ac8:7184:: with SMTP id w4-v6mr22699269qto.67.1526983809631; Tue, 22 May 2018 03:10:09 -0700 (PDT) X-Google-Smtp-Source: AB8JxZql9oyTvrC6XQH7FzQnXIaX+nTk5Plg5v+S4/tg7KrHQacV2U7piz4A8qW8u4XVsF8ZBXjt X-Received: by 2002:ac8:7184:: with SMTP id w4-v6mr22699244qto.67.1526983809046; Tue, 22 May 2018 03:10:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526983809; cv=none; d=google.com; s=arc-20160816; b=p1MaTzDhjG0Kw3Jm3qeUd/+mQ0RBcX3jNG3P+5tnL1S5vkx6FEFmA9qpckSpTiRvcr 5dwtYJfvV9qi8ky6JTXxxQ3tkgFIsCFIixnk1Bw1vAX32vL9HanXV6L2aWVMj89sVC5u 4EcLxSm0VL8nGWqOR6Sx1/ntXFQFAzLEZXLjZzd5IRrxX//TcuvUnWsLUlKbPPGbeFJ9 6lEOzzCcUj2f11F0ID5mwEKJprdkC4dkhZTYV4V6x3IUuPrbUm0bj3wR5FjmcxpAbesq Ymmv7fIaXywkuS4c+zaqbE/balq8+A8EItu7du+noOn1S/GzWBug59sY1hYkubLBGRXh tjew== 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=epAoOWS3Up3BXRN2vT7DThvnsIoWFe5vZFurQUYB+MI=; b=vo1GH2okdtKa5shzpy6uZQpeGeYIpx6DbiXp+CLUMaEalwfR+xOYBNNeCkJ8x7Obaj xJBEtV3qhE3aZneKGKPzHKpCilWHsXXpWBJfCdFIHt6M4YFQNtin6fXlvWkw8aznNsoJ jXN93oXpbe9nqDXmNsORafVFxnWjVwSK/8fW3p4Nqg6/FhSl2+cgSgkTD5nNqGBV9vE7 Pvwf0HKYUeOBwAxvxGqwKXtLq9iMGXb5yi/Vhctg1npB0EmhbAT17nJH7c2OvdDW+P4Z oj/M3O/L+3c/wAr14ibwj+JjhloP+UWeakH94/UBhBlGxjQ84YzMWlg3SoNA7bs5Lnni 7WMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=iD/32pJm; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.0.109 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0109.outbound.protection.outlook.com. [104.47.0.109]) by mx.google.com with ESMTPS id 188-v6si1420145qkh.352.2018.05.22.03.10.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 May 2018 03:10:09 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.0.109 as permitted sender) client-ip=104.47.0.109; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=iD/32pJm; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.0.109 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=epAoOWS3Up3BXRN2vT7DThvnsIoWFe5vZFurQUYB+MI=; b=iD/32pJmOJRdB6J68Mp694leYvePxerQvd6g8Ld4FDQHwTpFb+gKLOwMW48S19gK3FuqbiQx/ormWgomo8yD/UOhNMQ/r07nptdzfJSsnE9DYZ5AQ1omoBKknTuO1fddltg25NzPJ7A72GlFB9nnUXCePVHDIdmIszIVC5pTLl4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (195.214.232.6) by DB6PR0801MB1333.eurprd08.prod.outlook.com (2603:10a6:4:a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Tue, 22 May 2018 10:10:03 +0000 Subject: [PATCH v7 16/17] mm: Add SHRINK_EMPTY shrinker methods return value From: Kirill Tkhai To: akpm@linux-foundation.org, vdavydov.dev@gmail.com, shakeelb@google.com, viro@zeniv.linux.org.uk, hannes@cmpxchg.org, mhocko@kernel.org, ktkhai@virtuozzo.com, 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 Date: Tue, 22 May 2018 13:10:01 +0300 Message-ID: <152698380141.3393.16556787145139503288.stgit@localhost.localdomain> In-Reply-To: <152698356466.3393.5351712806709424140.stgit@localhost.localdomain> References: <152698356466.3393.5351712806709424140.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: AM6PR06CA0016.eurprd06.prod.outlook.com (2603:10a6:20b:14::29) To DB6PR0801MB1333.eurprd08.prod.outlook.com (2603:10a6:4:a::27) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0801MB1333; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1333; 3:QH2vPWgGcWAVmr9RkHGGXRQlfWvkuKgoAIduYFDvEiZm8f4Tdx8wukeoBA7aR0MnYhct+uqseSKFSLd1Niw0QM4KqYnGCV9bsP04OG4mmySfjRErseIt7bRsR3eKDcCc7eMWCPxNqKn4HEpoQpIOy75K2fvSv9QuIc4R6iZouKY3UViH7mqPB6SldIooaDk3KH5MmEQ+7U08/uG98VtHSuDkTFXtGBwBxXAnJ2w+t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H6fE/RDNLO9RwmPbmW06Eqf4NHzSw0hnABi6eGDtMCgfMMpZhrm+r6fALZvo5fOFNhQ1mbh5cGpcRF31ql1f01os3JQlr9IRLtLIyTnHtCmoy; 4:rzJoXGrJKa74yAbDxNBCrX/gvvjDw9rjocUk2Yr5/Dc/86hgXJnQGoGfsrTVzbEFogVgP5cNcp5Y/bfvEe5lweJ7o4wktF0ZEjzIXd6qCWsMy0kJ52OOJPfFluKRzqPRWIHAzDgYqmWuN90R4zZQG/fK9LvxAP6wbyZOaNguclnNi0fErlsyN7xDXL4RIl77Yeao6ahYC3b3pz8NPgVNPhqikBoTaUIK7wo7u2wrSsZneutZPnxPONYFCDYok4Ik63PHy3vIG0v5OJdOnFM9qw== 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)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:DB6PR0801MB1333; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0801MB1333; X-Forefront-PRVS: 0680FADD48 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(979002)(6069001)(376002)(39380400002)(366004)(396003)(346002)(39850400004)(189003)(199004)(446003)(956004)(476003)(486006)(11346002)(186003)(16526019)(76176011)(6506007)(386003)(55236004)(2906002)(47776003)(33896004)(7696005)(52116002)(59450400001)(66066001)(7736002)(305945005)(2486003)(23676004)(68736007)(61506002)(25786009)(6636002)(230700001)(58126008)(6116002)(3846002)(39060400002)(86362001)(575784001)(97736004)(8936002)(53936002)(8676002)(103116003)(81166006)(5660300001)(50466002)(316002)(81156014)(9686003)(26005)(7416002)(55016002)(105586002)(106356001)(478600001)(921003)(1121003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0801MB1333; 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?MTtEQjZQUjA4MDFNQjEzMzM7MjM6MHZqUGdUbHpYM1VUVkdvUzYwZWgzMDN3?= =?utf-8?B?SVRvc05ZbTlEUFFsZkhMTG9LTkRSR1hYOUR2R2lCNnVSazNldXZWY3AxZUxt?= =?utf-8?B?S0dnU0R3cDNGbDh3OEoxbEowMk1tcnAxMGFJcVZOL01rVXBiUytVbWhjd1ZZ?= =?utf-8?B?Zk5zUlUvMU5DQ2tqc1d4eU5CYUJTTXhlRlR4OW16S1JOTkYwNXYvSHg4aTEz?= =?utf-8?B?R2R6ZFNwbm9CZnBkN2dJczNxK08raWgrU053VWhja1A0OWVpUDdhUWFhSkhq?= =?utf-8?B?bWJnZCtOcDVLSWd6UklnY3BlVGhhcUZJekxUWTFtbHZtZ2JtVk9OYUxnZFNY?= =?utf-8?B?SUc5d3Y0eVdoblI1NTNvV3B1V3JYdG52dDd3bmFaUjNySjdsalUvMDRiYnVZ?= =?utf-8?B?dXNhbUNHN1FDY1lBZFdrUFJmVTEyKzJEYU5lbHNRdHFCR2NHbHdJc3ZSb2xP?= =?utf-8?B?NmVybFR4QzJ2bVdxLzZhdk1MbUNWT1kxYjk2Q2RUVlUrNTFhV0RIb0tBN29m?= =?utf-8?B?RG9JZ3dHeWh5N0FXdWZFQjJ1VmNLRzFMR2dtQm8xVWJCRis1ZFFPZkQrS2dL?= =?utf-8?B?OUZZMTJxRVB6Q1JPV1h5WWc3dkdlb0srUW1jRHhqaVFxTmJtMk5RNHdGL3pV?= =?utf-8?B?ejZQWk00WEZNZ01LUXAxWW9hRWV3Ums5aSsyZUNpQjFmK1VPMCsyUDJVK1ZQ?= =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AIQiKzFaYUqFxy3fCPWDBuDIKL/0D9RAkKWqFn5Rv/l4OI/f2HlbqG7Li26EUBoHMU+T2qMh/wcWIhJbdahnTIBWGLIiVq+HbWc5Oh2sB2b+iWObaDG0e81wKr59N3Tct/wu12O0fQ==; 5:zqsmyah+wd6+Ciq970c0rgna0VRTMHh0d1NLDuJsX/rI/njYGdOY0GqB8YtYRtNqnmdHQz5u+xtcETZK4f7sWLVHT6t/7fybl2gzt8cStBhvDGe6xm5fru6tLozbtfTtahrnYXL6zgk+L2FR+eJScFJoEwqORfSJryFwwK5TAJ8=; 24:arDaMKzM4SOhetkV8uONRrp8nFldhZ5tl6NEwpLdeNlY0yaXKsFwOgQdYV7C9Xd9lknrwc0IKnehrZTJDmtnd9gh6p78BJxbi48aoLYOpeE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1333; 7:n4YBybY/8+u7lkw0gax6QInl+NU3ojb9tNoBV5mThpgGd2WVmiuLbQARH6WjnIGdeaUXt0t3VS4t12W+L6VXLZy66ifEw59DJe/sTzrQSDnMNpz3T1FaZ4kzFvDhGnnB+tyFfN2mE2IcfA59XxtzYKhjDuQ00k+IvHO+h6aSEQXuHTsaAppY5VnOsolPLWYs7MIIDpfsn2+Crgf5bMClMnUb7qbgAOsCv3xfH1hkdDTHeoCRGOrIJvI6+mwAZuTY; 20:xSXtWk+gMyrmQ6cHI1wraSIOLnkiKKzNozg09BTT9r8qaMTC4C0nfMkFyXc8mgJzk52iKqjRAPaogNfmB+pDsvjHg7HgOM/fc3frnWxeMU8cLXqKApmY2JBbdfyi+m47TqN4CT/lMLAEmW2fpAWl6f54RfwYogLSHPIeOZ70v7w= X-MS-Office365-Filtering-Correlation-Id: 6cd48045-7a90-4a95-ae48-08d5bfcc3059 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2018 10:10:03.1022 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6cd48045-7a90-4a95-ae48-08d5bfcc3059 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1333 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 --- 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 f5f96e52e0cd..7429588d6b49 100644 --- a/fs/super.c +++ b/fs/super.c @@ -144,6 +144,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 6dbc659db120..1425907a32dd 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 79099bc5c256..3bac1b2f649a 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -402,6 +402,9 @@ static unsigned long count_shadow_nodes(struct shrinker *shrinker, } max_nodes = cache >> (RADIX_TREE_MAP_SHIFT - 3); + if (!nodes) + return SHRINK_EMPTY; + if (nodes <= max_nodes) return 0; return nodes - max_nodes;