From patchwork Fri May 18 08:44:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10408803 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 50279602CB for ; Fri, 18 May 2018 08:44:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EDBA28887 for ; Fri, 18 May 2018 08:44:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31F6D288BA; Fri, 18 May 2018 08:44:31 +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 7E3502888D for ; Fri, 18 May 2018 08:44:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A26D06B05BE; Fri, 18 May 2018 04:44:28 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9FD5A6B05BF; Fri, 18 May 2018 04:44:28 -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 89EEC6B05C0; Fri, 18 May 2018 04:44:28 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f197.google.com (mail-qk0-f197.google.com [209.85.220.197]) by kanga.kvack.org (Postfix) with ESMTP id 602F76B05BE for ; Fri, 18 May 2018 04:44:28 -0400 (EDT) Received: by mail-qk0-f197.google.com with SMTP id p190-v6so6214304qkc.17 for ; Fri, 18 May 2018 01:44:28 -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=pZEIKPJMNER2+OPwDROMS4u39DjnCMBJmadM26RI6pY=; b=ElkNZs055pT7dFzRVcjDV2pXCPv3kA5w/NhWs84Hlrj+l2a6aMnkuBf21RWMb1gqdQ 4CdyrIW6OfRo/FM28URQVIXpa1A+FT0HATzBuJ4cM5SmF+68J3BzMPolmniFyf1gzqgP XV6OCP1fH6L08BDwZmEh1h/AI79vTSWA/KdW3WJW5h79egNX22YGbbyk8ixBmP2Ud7Kh ZbVRAzaFuX5iKyK24VqSwAl0nA0PLdluJOvwRzc6GxxcqjXRTweQJXDz19KUXkynPfFv yva5g25AhjEz0V884dxWIK/OqAQ2HmtJXfq0Uu6FlQFwDqn8XKjdTXRsb3fe8n67m4K3 HEow== X-Gm-Message-State: ALKqPwfZTnsvCLq8Yrt4SmKheVFb/EhhwcMDD4F68epWVZA+yaiTwdp7 UfPmuU4EU4hqpeiBa4OpzHrwL8EcyWld8gQI8f9t0gfGHKL9Kc0gEoejCkBqdMXIZwNqJ8WZXP9 YVIBNJqHNoLoHaztA7JOOeSUGb0oMpaiR3Ys+SuY535IogsjPBJ1HPL44GT/mN66b2w== X-Received: by 2002:ae9:d8c1:: with SMTP id u184-v6mr7828417qkf.310.1526633068162; Fri, 18 May 2018 01:44:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrNowD4V6QmThk9MJjJenPIH26t8souqaYcAgs0ZnCiWpmull+1gb6costMZJYrunCVwt2S X-Received: by 2002:ae9:d8c1:: with SMTP id u184-v6mr7828398qkf.310.1526633067522; Fri, 18 May 2018 01:44:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526633067; cv=none; d=google.com; s=arc-20160816; b=g0wMymu6ZiznrfsIAgBmwe4fF/gfKMN8wA82VgHPMsjZSDcfFo4RTmJ01azBxwwJsg RsrcdYdYbh/bTmIJwfAUA4G6GjM97nm1sktKeWJiCtxrZAJEpAGkEFS77A6aN7ZOOTXZ /EvZLiODw2x3v3lL/k3VP+ogMRsxFd3LWg5+mOBY4pKCW0wb+CVj64UajI6hrlHrZs/T 5JOlwgH8FxqFc+/I61s7TEX7Os2Rtv+/m4UGVSDOI3PM5aMwIATNGnVGhzy1fjQTRcSd rmLh3UDQvlClOl4F9fI7HgzkdvXc4MSMo3T+qUtLn237yikE+zVomPoud2E0UKcFc9I6 6TEg== 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=pZEIKPJMNER2+OPwDROMS4u39DjnCMBJmadM26RI6pY=; b=WPhZM5wc8Dl/2v4cS9HJtXPBkSIVmHsnao6Hsmzs/EDK/kzHU618gAET57HPP5UpPN Jj3Scxaa27iJ2H68QrV27+canCRwlw7UBUm3Fzxch7j1sRio190iVVxkMTEY/Q/bbFNQ euNGra8uP/QldoZxFKiUBLr/MhCpqy7udWAsaUaVitY1YhcRCXi1u/R2V9bGyXVG++1+ E5iULkCAhX+Yuku6tqDLeW73iS9bITNkRKo+Amx2S/rWyQOp/bLyH7VzxOpQ4M556pR3 kTmioDljErIt8Mc0AlPo5S9mJXay2YiICwAm2K7FPreZhCKPe2Z+okX9KiqJkZCE4vfQ wV9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=d1cudF0E; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.111 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0111.outbound.protection.outlook.com. [104.47.1.111]) by mx.google.com with ESMTPS id n141-v6si5381358qkn.32.2018.05.18.01.44.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 01:44:27 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.111 as permitted sender) client-ip=104.47.1.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=d1cudF0E; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.111 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=pZEIKPJMNER2+OPwDROMS4u39DjnCMBJmadM26RI6pY=; b=d1cudF0EDxXjYIWdiyRJrZ82Axq70qpLN15EvHSgZPZVUEFk45E08fq8xyiU3ifS4POI5j+0XT3wOk/0t5JYF6ZAOaRE8rPbEzp9kW6MiFvQm1+OHH5C4tYMr51U59NvQ4J7JGNsBu4/c3i7coSzs0JJuvtkCAJlgYpMrUh4sCo= Received: from localhost.localdomain (195.214.232.6) by HE1PR0801MB1339.eurprd08.prod.outlook.com (2603:10a6:3:3a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Fri, 18 May 2018 08:44:24 +0000 Subject: [PATCH v6 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: Fri, 18 May 2018 11:44:22 +0300 Message-ID: <152663306223.5308.4934186553719870551.stgit@localhost.localdomain> In-Reply-To: <152663268383.5308.8660992135988724014.stgit@localhost.localdomain> References: <152663268383.5308.8660992135988724014.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR07CA0046.eurprd07.prod.outlook.com (2603:10a6:7:66::32) To HE1PR0801MB1339.eurprd08.prod.outlook.com (2603:10a6:3:3a::7) 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:HE1PR0801MB1339; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1339; 3:S4pkcA1HngBGcecZLYBf+WTM6QK6ER4afILZJ9DmXvztHfpxjAmm28n2Z/rxtqKGXGDxjuX0gospM89y6mtoxn834TEKMfBWwiqDn17QkcJfgXZE/aKs+WEwIcit3FUtuCJP7c2P7+o+V4NSlc2fOykxyHaZ5SDpk/6Ki9+0/yk+My3SJz6FMKrDfW7M6AMUp4sCR9NvlOVrblB3ceMHrK/RWqIxYJjjcXeVcBYsRXsRtR6BONd/jC4dj1P9joD+; 25:1P+G9utiWxoV9dqyobAgGdWu88f1pB4PEqkp+VT7G63dRR8eU7KbaUizwjwCtjyFdWJo36r5wglbidy+xXE0iM65sllvWvakcCO+7DqqeppCh2SDU8XD1qK2q/i0ty6pzKcphQAAio4ktYRijlDdYfgAT5L+cur01oWTjVRAHXWKKKr/s3LP28TcDK7NFL1lNN89trrf6ypQi+T/aV8VdnFD89CGrQ2qDh22XZ4ceOb/mNEfDNv2Ij0X6d/HWWfiaaeDrKCVFsP1Z5RwPqi19INysw7eJh9mqCw7OV4gLhSC/eOSdPVo58XJ58HUJFggLhwENqG10+Qwybdkn2xs8w==; 31:zND2jjhoGNHWQeQCIgf4R1OX2ZFmaKnEqBJmnmS954wNrUOaQPO5QJLA7npoQrHm2LnCPIzf+6jn+SkLIgcy4eSD/ugDaEfWIkzK1wPMjnR3P+w0L69MzBZDoRBi1GEJ9YvQJuu2W/MzaQNvl3PGECOtBj/8PMY/80hOMLuIgo+l2SJ8AFhuBHQnv5DCsZoaLpWelAU/cmGIxjNFFZC2M6eamgMVBd431iA0LtAdxMc= X-MS-TrafficTypeDiagnostic: HE1PR0801MB1339: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1339; 20:rJEut3Yi//nMv+bK07Z3km+UO5CDHaxGMV65IUQuEgCNHpXabJQV02BHa5PW+FeE8+yxq982kWdoGDiflQCjgpIWbpwpFyMN0d0OlkWczbxbrLQtQXQmwIUNul+nuyw3iyRn95F7PmYsXZk09AgGhzZ6CdDm0j/E5gUjuTYlieWCmdQZeyVmmXmaVPlc9BxN8McDIRPPZrYN/+ZMRb2x0rmyyrIjH16s4q8SFqSFFnoPsKSU+YSfvqmlZzmIhMpGUQmK3/vNaKPH1uKL0j5oNJXxasoCALZjnpgGwAH655iREhxhO51XkW7ojU6yimvxJ3kJAjX9L6w3SiCdayhcdZ1+XBOXODpOE9q3Mf0xABLAyMN+mscGYFwGkEcPaVhWmAW9veew8D5YJVRaXMiAxJqsuE9PODXXfn5CzB/WU1UONzXLiPIOuwduvlwPnDEUmXmkZ1SWXlwYeXQ06e1fhiDc1q7AGrbU46LBGrL7tYb2NE/1WT20eAp4DhtOuxax; 4:kAM0CyRqAtWwrO7XLRU+oXZFeu8/r19Gsk/gmp0olualMTGrBuA1Ko1mzoSNkvISN62Do7tgQu0c8+oj3bXE37KdQIoDpiy742eAuTQr5uwj8Yow4gTfZdQ+XwPqorr1cKStgq88BznpZqTYJ62E0626HMoHgAcOld6mXop/yJN7xFtZnQNFFWhpqbPR9gLjPJKOCevqf3grfimds51AZP4auK2qklFoNxq0n3QgzVpgT1XGv3Vm0y8LOjoTDDxj7lblGTW37GyHH9PLfjFSNQ== 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)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:HE1PR0801MB1339; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0801MB1339; X-Forefront-PRVS: 0676F530A9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(366004)(346002)(376002)(39850400004)(396003)(39380400002)(189003)(199004)(230700001)(97736004)(386003)(6636002)(6506007)(316002)(58126008)(16526019)(103116003)(7416002)(5660300001)(186003)(105586002)(106356001)(52116002)(7696005)(2906002)(55236004)(8676002)(81166006)(81156014)(68736007)(47776003)(575784001)(53936002)(8936002)(86362001)(76176011)(59450400001)(39060400002)(25786009)(23676004)(33896004)(7736002)(26005)(478600001)(66066001)(2486003)(956004)(446003)(476003)(50466002)(486006)(55016002)(305945005)(61506002)(3846002)(6116002)(9686003)(11346002)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0801MB1339; 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?MTtIRTFQUjA4MDFNQjEzMzk7MjM6bEpuZDMveUlWb1pFTnQ3dm43bGc4UW1t?= =?utf-8?B?anFtWFNOWGpVRWpDM2RkblBXYUROL3BzYmk1L3VPVkF0bE84S3pGeXNxRTlX?= =?utf-8?B?NktzejRMcHQyM3VCTGI4ckgzMGZrMmpyQkZybFlFMW0yRVlkZzBGZkE0a1U0?= =?utf-8?B?L2RpZy8yanJtMlY4UjlNY0NHb2FjaEEyMlM2bjlHcVZYVzVWV1o0blV2V0JK?= =?utf-8?B?b0FRcUJDTGFaRTI1bXFtMG8wVmNCNWJmY2RVbXhXcTJ1YVpScjQ5dXVaZm1H?= =?utf-8?B?dldWN1VmVTR3V0tyTFdHMTFWdWQ5ZjRqTXRzN2FGZXM3R09xKzQrQTExVkh5?= =?utf-8?B?bVBBVkQzRmNRZm8wdi91TjJzcjlBSmlYUXhEVjZNeWZBZEVxVzRNejZ6b2JW?= =?utf-8?B?OGxUTlBwdmlzWk9wMnhSN25yWnYzT0x0RTNFaGFZeFR2Ull0VS9MQ3ArV1hM?= =?utf-8?B?YTc3ZHlwaXFVT2RsOGtYWm5icFR3WTcvTm03WWY1OG5oNGMzS002WSt6dVZM?= =?utf-8?B?c2w1YTR1OTRZQ052aEZpQmxDZGRWcmg1WGFidDlKVmJqZ200b013bVMxbFg1?= =?utf-8?B?Y0pzTks5T2diWC8vVDFRUlppQU94c25nRVFWMEFST2JMY0ZiK3RmaHdRMEh0?= =?utf-8?B?YXc0eS9oN1NoV05CQWFKN3BQNGFYbFNCSzUzUWlJMWNDZzdOVVU0bjVuMGFi?= =?utf-8?B?YjRQSi9mZzVLRktOTnFLbk1tTkN2MnlobmhBQlI3OFNNcC90dXYxais4cEUw?= =?utf-8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qePrxmAbGFcsxTVBWCCXvL7MfB/GY=; 24:/P1XEJKWJMmRvyQYK1jPDnXAALO6efXCgisTNPIYhNc5Wj7MMRUFci8fmLx793aiUnxBlpS+p6jCTKvO5aiHKeL4yLnL+I7JU071m3N6ldM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1339; 7:2g69ZRsZbontyvkjD6ozfGjzmJKMYfxg39AbcM2G9lTPtjX0O2aKYaKY/l+gcojD4Skf7Dxu2gGReASZmhPRQ9M8+0479ZZTbD2b61gg8gqkdY/yNNuAoqmGrnqapBhtOw94OZNEs+vdptWgSZC3uk9djkE6ebxs8a1MVg/dXsp1m36U5as2jp095LA0looJFhemG9A1IyFbmHXSKBrVRaPW5EJ7zyHkngkV2HZRskpNGKzKmvNu669OZW7IlT89; 20:6wCEEI9oM8XRPslmSu57n8nrGav7HQ6W3D//B+Fm1AG7pK8IP4u6fUb5+JFJN3gIFF4eiLE74OZzbbG/LMlYjd2fWoa1Do8BDxIpAMp9ivcDOWQ55gb4CUpywAo2MHRhAe68p/b2cFKPu3XoCHcOr4/Pmo/Z9PQC8EySu0yEzLY= X-MS-Office365-Filtering-Correlation-Id: 56954916-a812-47dc-c8ca-08d5bc9b8f57 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2018 08:44:24.5203 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 56954916-a812-47dc-c8ca-08d5bc9b8f57 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1339 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 f1d23e2df988..6639d1e7b6a6 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -456,8 +456,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 @@ -600,6 +600,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)) { @@ -647,6 +649,7 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid, { struct shrinker *shrinker; unsigned long freed = 0; + int ret; if (memcg && !mem_cgroup_is_root(memcg)) return shrink_slab_memcg(gfp_mask, nid, memcg, priority); @@ -664,7 +667,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;