From patchwork Mon Jun 18 09:47:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10470575 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 3D3B76029B for ; Mon, 18 Jun 2018 09:47:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AA0B28474 for ; Mon, 18 Jun 2018 09:47:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1ECA92899F; Mon, 18 Jun 2018 09:47:43 +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 0E47C28474 for ; Mon, 18 Jun 2018 09:47:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07D406B0277; Mon, 18 Jun 2018 05:47:40 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 02CD36B0278; Mon, 18 Jun 2018 05:47:39 -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 E38216B0279; Mon, 18 Jun 2018 05:47:39 -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 B56916B0277 for ; Mon, 18 Jun 2018 05:47:39 -0400 (EDT) Received: by mail-qt0-f198.google.com with SMTP id p12-v6so13597700qtg.5 for ; Mon, 18 Jun 2018 02:47:39 -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=h3I8sAUCxEio5mBazdf6Wc3d0pfy2mz/2jehuekL02s=; b=qvPW1Tcpg0vTMO88ouF6q+3XP0ITJEOLUaR3+cli7U6wjz8kw7o8exBxMVqXqRL2UM Ay2R9OBc+1SiWjoptmj0oESXTcpSgvc98W2/jdbDeoGXFyk/718WPChW8n0kOZmFNee7 nzryceUy4jAtaMiysokLcbA41tGf5kuqSD9DjVYuJ6RtJWCBaDKqKxZFBWxGsizyLTn6 gnCbCvQN81dcjaoOm5lVEP/n4USX8UPvWEvlMiwkZw8erXU1w/OTb2AEIP/j25dZ8Jrm B9eMrM8KEwlmiH1aLgBphyGMRkcL0HQnlM+5jio8ZxKHjdnQKOsiTv8HF1x9NIpt2k/s egLQ== X-Gm-Message-State: APt69E16/BfuBQkv6uhVZLHvUgBNm8Z9MxKimokC5chjioULjzbRPwUO vE7WIXIacLcQV8bAS1/nGfL6T/2iF9Q/7aL1BGPcYY3dam2yg65sphCbNFbNlz7XprfpdzgmI1L QHkMX9omweseWI0s4lQoRTeEEA1NNNTBNIQi86I3n89FDLnEHc9TZ1UuZK/ZfK3j8iw== X-Received: by 2002:a37:c01:: with SMTP id 1-v6mr9710854qkm.118.1529315259515; Mon, 18 Jun 2018 02:47:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ1ZxlviwH0H8ynDnA8Ee3xPm8ZoYBO1mCm0HKQMuAPZOxCtwmGAzMMuwDWr+aJZKPlD+4R X-Received: by 2002:a37:c01:: with SMTP id 1-v6mr9710824qkm.118.1529315258667; Mon, 18 Jun 2018 02:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529315258; cv=none; d=google.com; s=arc-20160816; b=UoTakTBon9v9FfS03YNVT8m37F9J4N+VWvPXE0+9OlmMUUxbyV9jifPmVTf/NRmMfb Icb2Lgomd91hmFNt5oKaCcKepxIZXKmQg6G0HpN2ewRT0qyQmx6JlHO5p9BskQWsWbUP fv8KwAgjyM1MZcF8evMJjE5QWKOlvCsn13yQDO/UfYHm1lrOmJrKGLRGQDRd/mYgntif bGE/z0LJB6pc1UO1vZ/1i9wQj+kyyAR0JBF/cOmbbPSn7RgetNUZaRqhAwgd2K0MflIO POlggPG7wqzudHbzQV1DtPFmb4WO8H1BTLaNbICGeZOYybXWeLtE0feAnft9CowbY4Y8 dtQg== 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=h3I8sAUCxEio5mBazdf6Wc3d0pfy2mz/2jehuekL02s=; b=EQukw+dkL20Q7KXeCARv9C4hB0EsWOmlltXWiH7aUewVoD5d3p6PRM/boUBJF41nr7 X4LohRt24GH2taZBdUqOFma+Zp7ozyz/kvVDtJZxCSP0MsIFHvO+5ahG4QThEchI6DUu b2u8LWhMiZvEV9uywYjaJXsgt8/G+rSwtgQ6gAEIvgBK0xUwy7AivdE8N1kgcuaqCAUO WMDxBiMpsp80nz56/CQoH77AaeFe2YGcq7T5PRzhKhOWSCcgkk6qVrjUXbcFcea1n1LP XZtTnxKdaL+6ZFsf0zq3PE44w512rgtZk8wwoX0orQJGSVx2HfhAAaK6rHI43RYvzOuX 84SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=LJQzBQc7; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.3.125 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30125.outbound.protection.outlook.com. [40.107.3.125]) by mx.google.com with ESMTPS id t66-v6si8914961qkt.164.2018.06.18.02.47.38 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jun 2018 02:47:38 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.3.125 as permitted sender) client-ip=40.107.3.125; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=LJQzBQc7; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.3.125 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=h3I8sAUCxEio5mBazdf6Wc3d0pfy2mz/2jehuekL02s=; b=LJQzBQc7yDvnvoDmaKRgtv+lkicq02r2leh1WXFsWLq5in5SvZThoZuOej9yoUE3VFNeNgC6nSfjG3t6w2AKDG0/kzVpOVweqtHmGbpNwlTaI+3HRn4Ked88DH4DSFCfcSgeN/31p7/HaR/cdfKzRvtGpokHIp68h899aBelyXo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (195.214.232.6) by VI1PR0801MB1341.eurprd08.prod.outlook.com (2603:10a6:800:3a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.14; Mon, 18 Jun 2018 09:47:32 +0000 Subject: [PATCH v7 REBASED 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 Date: Mon, 18 Jun 2018 12:47:29 +0300 Message-ID: <152931524916.28457.12974705300364778836.stgit@localhost.localdomain> In-Reply-To: <152931506756.28457.5620076974981468927.stgit@localhost.localdomain> References: <152931506756.28457.5620076974981468927.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR05CA0239.eurprd05.prod.outlook.com (2603:10a6:3:fb::15) To VI1PR0801MB1341.eurprd08.prod.outlook.com (2603:10a6:800:3a::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ebd9917a-848b-4a69-70cb-08d5d50084ce X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:VI1PR0801MB1341; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1341; 3:E8D2rUN6WcmcOxN4FAMUuyvvrd7+RYKpDWttkpsFVlnqjfjKrXLNDmpbeN00dtLaM9LANk/t/qhrBLVMZ+kzjnzjkdsvPpdUi9L6fQG3FgXZoshAjcMPiBfLTpxH7RxUXjer1Piftf2TKeWqzceLprBe+DHxv4tdIsDUZ+3S7jT0fAv7eE6jNzL9vwhhpc0nh4KBbi03uJDQdy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p4WuUwsJp0G+n8TiYZ4f/i0wEiXhsUKDbwEZkehaGZraXSY+YNoQs1ahv3RDmDLX6SCzQ1KOfgI3P9Nndykko6JlWiQxEAEdMRgF0RvFBRJrHxV/h613x+L86VO2jYmzGTJvzG5Iiny/wpx5bJ7xSu7RN; 4:wkCbukVVq+tUutIJ2i0FwaN0H3r4r3gHu3PvYLOKs3V+GiZKCASr3jlm0CmKNp7oK7IkUwCeWjrNoNX7Kj3tMR/ECGMnEX3qaF7qmfoZ+SOYjIOhytVUJPjEJFAaDZShA+0t2EVIx6m5QZuLuc6V7OtQrsqMS14LmAoYSjsDqi/FscdUP9G6KTkxbEkxOpBk5ABEnt4+hE3a8g81ihA2PGyH4X76nETGPPdLTouQaXa/h4TqNbFdSSgvuCzdeQWRWQWlKqXHeDW0E8M4otLsx2et0Xg/DOQvY9Dct+o2IENGYhaM/GPe3JP3g2aaLEziDtrZFqrlf+8/UsiZUCM4DcqXyzc4R0BfKeipWAkiWdIr3kXWjSsdZhNcUPhzzuyp 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)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:VI1PR0801MB1341; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0801MB1341; X-Forefront-PRVS: 0707248B64 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(39380400002)(376002)(396003)(39850400004)(366004)(346002)(189003)(199004)(2906002)(6116002)(3846002)(11346002)(956004)(6636002)(478600001)(486006)(5660300001)(86362001)(61506002)(81166006)(25786009)(575784001)(6666003)(39060400002)(446003)(97736004)(476003)(53936002)(81156014)(106356001)(105586002)(9686003)(8676002)(230700001)(6506007)(386003)(8936002)(59450400001)(50466002)(47776003)(7416002)(55016002)(316002)(16526019)(68736007)(58126008)(26005)(186003)(23676004)(305945005)(66066001)(55236004)(2486003)(103116003)(7736002)(7696005)(52116002)(76176011)(33896004)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0801MB1341; 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?MTtWSTFQUjA4MDFNQjEzNDE7MjM6YU5FenVCMDB6MFVqd09DZGdtKzhuNHRN?= =?utf-8?B?UjlFZy9CdnRXaUp0M1NIdmgzZ2xMVndSajNQaDFwblJWM3JoU2ljVmRPTEFZ?= =?utf-8?B?a0EvQXN5NEY1UThkQ2JUYThXckVjQ3d0N3hhamJMVzU5U2JLR1AyUlEya1k2?= =?utf-8?B?VXJqTkEwbGJmeDJrMThvOU9qMnFYOXRqdnB4ZFptSWZRaXl3VjBYQ09tRFQ3?= =?utf-8?B?R0FlZ2VadlNBanNYSW1STEhzSzBub0twV0FWOWNIZjMrK0lLQ1M2QXJCWlJS?= =?utf-8?B?cWttTHhzY0pacnZJbTJkMzl2dXZQWGlmRmhGMjJ0amlIL040anVXRjYzdFND?= =?utf-8?B?b3Z5bmlSa2IzNjh4cTZVRUpKdmozU29TZUJNaTV4VlRqdklHV0VQbXhjQ0w0?= =?utf-8?B?TVRQeVhiMzlhaEh4Wmw4Wk1OT1NKOFNHclhiVGZMZGU3eExjRXZ3eCtCWUk1?= =?utf-8?B?VGtUL0ZsNXo3R29TbnYrL0RrK04yZTIzMCtxTU1TMlVEaU0vaHo3YUZ4b25R?= =?utf-8?B?UExJY2hUUVNQK29WNzZ1bUx1OHRuNHFpZUVRS2hrcHhYditYV21PY3FEM0l6?= =?utf-8?B?N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pW9vD7XwZt1jxdRy3P/1wkvEXt8aiurG91n1kOvqBqcr3cPBXrI5IPrtXj6rgdf+27VGaNSPjLEzl4UAnY0Fze8WmpYGQHYKBw626yzHe04TPcUUeyl5xLk0oqGAd0wxAl8mlJ4NpzaPl3mbFEdMcEnrxdue0gO38zFk+vDe0QilCV9pX7QU5/oGy3ukW1UucQs7v941jBtyjoRunalF01CHOExfSflJCcHxTiibqwVdKJ2O22RaG08IeboghGed+3UhSvlFn6+phmRiVaQQ==; 5:pFKnRjmAErV83kVlB7j8hI3WKNjYhdYv6K26s8PeqgFyrzKns85wm+Nk7a5bAJxen0RjIlzligcweQv3wfrU7836+1hXHmSebmmUZLp1crpKlQ11ZX5z2Q4tmLu8OEvY5rie+2Fe0D+zPL0ssIY7xtbbZmI+W/3kintx4YfX9CQ=; 24:YtWheGdTaEnLqVuXFdW7nf/iRbuqYjppX8w3BHQ9XcCwkKkmtZP0IzW7makV2t+sbZShb2ixhVVKPIqcQN+0qNUiJjBkwv84KyVVB58GZ+I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1341; 7:M4MtwyzlEWFpIAaH1j4nOqPBrnkDiALNgVxw3ijAz8M9EyxkSfLC9+TC0ph7dbH1MGeOtgyaRemKqPJOpfUyc4ZVFLTqcJ8YZeWez8/0YdJYrpi6HTcadJbf3xrA9v1o46bJ9MFpqdnLoFktcNr7Iv3KIjeHzV+kXdmhI5YTs6colXW3eYJ/DnRItZvWM/bSeqmIeMbk1rWpNZL94hh7o6OBEJXpunyb/Y72eB4RXGMOMxKsRgk22AalYIU6/j0S; 20:jkNvFOSRGRN+VhTjVYulRRHFMtfK2hAzPvKqzvzoncXkdGHp6BCy18awhL2OPEGflWmC46+uX56bhf4fJqd2I3HoArNQnUqEEqsq97MpgXnUC/5xWvaFtpt0X1MpNeTzTR6B6x1ODqWHXww50XSiiqwhu7FgK2Vk/AHugaAPxYg= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2018 09:47:32.9596 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ebd9917a-848b-4a69-70cb-08d5d50084ce X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1341 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 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 1518f3c613f5..d24a3e16ade2 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;