From patchwork Wed May 9 11:58:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10389291 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 CA61760318 for ; Wed, 9 May 2018 11:58:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B779E28C59 for ; Wed, 9 May 2018 11:58:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ABE3C28EC6; Wed, 9 May 2018 11:58:58 +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 6CC3328C59 for ; Wed, 9 May 2018 11:58:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 34D186B0509; Wed, 9 May 2018 07:58:56 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 323316B050B; Wed, 9 May 2018 07:58:56 -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 19F946B050C; Wed, 9 May 2018 07:58:56 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f69.google.com (mail-pg0-f69.google.com [74.125.83.69]) by kanga.kvack.org (Postfix) with ESMTP id C722E6B0509 for ; Wed, 9 May 2018 07:58:55 -0400 (EDT) Received: by mail-pg0-f69.google.com with SMTP id m4-v6so5589792pgu.5 for ; Wed, 09 May 2018 04:58:55 -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=2BVaPoyhHU271CdITwsMBsYRlNgU/KGymBGpX44Oftg=; b=aIVFVmdomHW9YkKbllGAZYA2SAScwGThLi9pF6tb7z8HK+zMS2Bcwar5BgbHzRegl3 msLwlKfFDzRpfS4WuXcoCP0JkmG/0KtQC6U2mKDLqTUivi8PMCZ2NEzD5zhgA23cvZdw r/zxgyGEtuDbXhH21QmI55TImoUL7y9Zfhkkv18tGUNkkag7T4SdZr2Pom42LApNDToU l35I2ubSM4ryyZU7M4GqllQhfaBK6ytSJ1+KZtSW6is2JvwtrH1I0aY01fgnOZvhfbqz +UepFoBbjrP44FscW3NrqqRe5HjeUqSRDCMVE8Wy9B0gPuct3saenlB4q5miwbHGHXq0 4cDQ== X-Gm-Message-State: ALQs6tAlUMUxXdda2AYtjeyCaGsWc/WOGXc5SN9a2MNF7DOO6bUibX50 GqTXaGJ2SyVZlKoTvr+cUNinwG3z+d/tfj1drArxbRaenV7CgN+VUQ1KMV7x0FgjFu4qnqniZLz xJ4QxkS30r7+EeAF+ViouXjYGIdmT31O2NkqE2tEKcXCX8EX11JjCZFP0i125B7EDoA== X-Received: by 10.98.192.80 with SMTP id x77mr43577129pff.67.1525867135490; Wed, 09 May 2018 04:58:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpEuGVYtSUQfB3Mu4oOMuODtWXK+jzplpa3jvP0QrpexZYOQY+ywkwVccNq5Z5wiyEci6YF X-Received: by 10.98.192.80 with SMTP id x77mr43577086pff.67.1525867134585; Wed, 09 May 2018 04:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525867134; cv=none; d=google.com; s=arc-20160816; b=PzMjp0B1TWz6/uJ/N+xc9eCU/MdXKrTGrly8cMhKBf5+ab5NY16BI1jfAojwzZPzmG xUaUIx816PGw55jAd1P4lxY9cCKsNMWzX/s2ivc2x5rNWMySWNvYtxc4tuFx0+zpRxQz NOIJv4SGJM+oYoNzPfO4c7V6GT75mePzC/n0c5ClMZGdMS1xrUdFuzHWquJA75BjpeoA yJvR3JCJOl4oWzMQWbzGsLKBYDmfPW+ydbGeg5CYluk3XQoMybeKuAA7scjnNSVwCdcI VdiA0GG92hBr3E8m7LqVxuWABRoGC2RXTRsl2BU036hBVSw4MpuavfLaSSXSVu25De+Z tM0g== 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=2BVaPoyhHU271CdITwsMBsYRlNgU/KGymBGpX44Oftg=; b=Fwz9G5UFpOBlLSGLFH9fXyb4BSgtXWAbM4zpstASfXZvMwYbASXdFxL6yZ02ayKW8P Q4wysnTqaAEZ+CZ8+OPhem7oEK+G6ItsWids8312jhs05B0rWXeismXxvbyReldgFlOV lSMvCI08XW8YgWuxvExj3DV0UJF16g/LDxYxI9vswDnP4WNtTQoFVmUAWismX8cCF+C+ b/aO/7TT3kK3H0C3TOV9MWhkbbzQd3cQ4JB6fFoDQSOIRHH1X+Ltgz4QI5UzXkzOqrzS oW13IjKnxL8GynH6Zt7EllEic+UKYOsTVCKn0SHm8agYmPm7J5TZmBWj4Mf4RR9hT8FV 241g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=fG7wJhDg; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.0.93 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-he1eur01on0093.outbound.protection.outlook.com. [104.47.0.93]) by mx.google.com with ESMTPS id a96-v6si19595116pla.169.2018.05.09.04.58.54 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 May 2018 04:58:54 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.0.93 as permitted sender) client-ip=104.47.0.93; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=fG7wJhDg; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.0.93 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; bh=2BVaPoyhHU271CdITwsMBsYRlNgU/KGymBGpX44Oftg=; b=fG7wJhDgLwOf3s52T5vAwRFJx4CyqEav0pV3PJkxP6n9txIhkhOyKN32PLOMsnqYZlPhlhpe7YPKhjl40XbiqyFv7nQEhVVUkoii6tpMA+hDg1mHM9sg1VfbGBnnU1RQ7xgPj7waZq9/l0Sb6um0DmXH7WveTCFqIplHtVfWzAQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (195.214.232.6) by AM5PR0801MB1330.eurprd08.prod.outlook.com (2603:10a6:203:1f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.755.16; Wed, 9 May 2018 11:58:49 +0000 Subject: [PATCH v4 12/13] 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: Wed, 09 May 2018 14:58:46 +0300 Message-ID: <152586712683.3048.16055139533907163272.stgit@localhost.localdomain> In-Reply-To: <152586686544.3048.15776787801312398314.stgit@localhost.localdomain> References: <152586686544.3048.15776787801312398314.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR02CA0114.eurprd02.prod.outlook.com (2603:10a6:7:29::43) To AM5PR0801MB1330.eurprd08.prod.outlook.com (2603:10a6:203:1f::8) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(2017052603328)(7153060)(7193020); SRVR:AM5PR0801MB1330; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1330; 3:x1COdh7Nq2reBvIs5KD+iIYZMY9XG2QHEKUjz2sgD9FUY/sJf1GcqBssappLz6YOLyG8gxPRNAUceO1WGqpwg4oUdle3WYG6PWAKvWVdgI4nS6B7Mvqv9DGtRJR9OfQSpSz6kY5Nknmdcf/3Jkvcds53Ns6cbyhrn0KDU6OF0w1OTt8V55QQAZU0MKUqWVp+m6s9kJ5g91/HsvOYDGrjYWPXQIYfVkwiCPNi48HUFOnqvDHppQvdKDZl+gE2p8h0; 25:6jvUjFyBhI0sscpo4Y+Ezu1ByK53Ig1pdiUOnVLY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EjngLkZykwnEhcTPYwyObs5oXADAa7pAanEMTGuPL; 4:K4tzurn2pi9N2Rp4POkVweLxgnFk6sgoOiWYkyL3+TsJ6vr442P1Ykr5gOfnPOilKhbLnJGeKjVRE4k7ACqQyMeCaUbS56P3K6yknp30MnsBW8GoobI3KfF0wdVVzAi637d07FSpUL8KHLe6XplBSTQ70D3MEIfq79H/gfU1e92MsEZ/hs1uGySj4EysuFbF3Du/VJySvRpunQ4n2khRJ9q18zyIsj/sL4YqEq+OOmubI7Utusj9Zh1PTMihc5XGHOINcwGA4P7mgi70PskjBw== 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)(5005006)(8121501046)(10201501046)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:AM5PR0801MB1330; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0801MB1330; X-Forefront-PRVS: 0667289FF8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(39380400002)(376002)(346002)(396003)(39850400004)(366004)(199004)(189003)(2906002)(186003)(230700001)(575784001)(6666003)(305945005)(103116003)(86362001)(6636002)(7736002)(478600001)(11346002)(16526019)(58126008)(53936002)(476003)(6506007)(106356001)(39060400002)(956004)(105586002)(68736007)(5660300001)(7416002)(2486003)(446003)(25786009)(486006)(61506002)(316002)(97736004)(55016002)(23676004)(52116002)(7696005)(81156014)(81166006)(47776003)(8676002)(59450400001)(8936002)(50466002)(33896004)(26005)(386003)(9686003)(55236004)(6116002)(76176011)(66066001)(3846002)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0801MB1330; 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?MTtBTTVQUjA4MDFNQjEzMzA7MjM6RmQ0NitZTDcyVE5Qa2V1MEJZdkUwbEgv?= =?utf-8?B?cGtkRmR3aXZ2RWpwQm5hUXQ4MXB5N3hnUnhYdlN6VnB1WThCSUV5M2VCUlNE?= =?utf-8?B?c1lua3lDQm5mS05WN2JIbDNXazJzdURvbUNjcGR5MDlnZEk1eFNNQUxJZk9m?= =?utf-8?B?M1hpOVJZNXErOC91SFN5UmVXUllSKzJldjM0endCRWpKRE9hSVAvUm5GbEVo?= =?utf-8?B?QnI5MEdpZ084ZjRSTWJXdGtzTnRvUnloc2JqeW93cmMwRW92eEU2WTFrMmZx?= =?utf-8?B?d2JIMHkzVHNlZVN4elBQZkp5Rkl1dUV2OThUU3hSY0pCR2pHUjl3TTIyVjBO?= =?utf-8?B?YzdYWDlHb1hoS3ZSL05ZY0pBT2hkYWVPSCs4UGk3cEFlSklOb2FhbFp4Rldh?= =?utf-8?B?R3hGMlY4WkVwSUpSUkRCdDdKWHFzaFRuZzhxZVUxYzAyQWpWSWN0a1dFcDV4?= =?utf-8?B?dUMxcjA2V0hUdXE2TkFMWWQzU3BYWmx2ekcxV1d2UWtNMWZQT2lZWWFjT05X?= =?utf-8?B?ZEpzb0REbnNIbnRCRkFNZjhCM3l2dWF5eWY5azFpWThMa1libGZOVXVUWkQ4?= =?utf-8?B?eWpSNkFrUE9iRlkzNjNIcVN3RXZqdmgxeWM2MkpTSUwwQXZqa1lzQTkvSGhD?= =?utf-8?B?OHBGRnYwcHVtWUJoK3dRcmhHT2xlaHZwUUFRL0FiZllzUXhnZlNVelVXRmZW?= =?utf-8?B?VXh6RUNkTDNOdXl3VU5yQVpNZXFMbTUrSXJQSFdtaFU2UWVoU3hxWWo3RlpF?= =?utf-8?B?ZG5LUkpKcmh0K2VMNlpiYmxPWjZyaGdvTHds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OFFBKgMZkGBlX8A6XSMSidUXghD/evo=; 24:asrJSy772EDV9olPrXvHBUpB4AjGksaV4ZODplId1pbG77jckPqaj5JFg5RzybGoL9Jjy3TAQn/9e7DjtF+YFhTm9t0iIuFys/Cl6JNOWtw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1330; 7:uK7H6G8y8oPFVIgMid8DLR6ZpEohBLy1sVSTAwhK3zwRpZjwX8dX3BKoAQ+NnCEpd+SbXMmIkJSBDc8m+qzsiC7aAvlMhb3A38MycweiQSL9ScLOxPFxdSpo079mDNatpMihltMhQs+tQw1b3yaY8wN0OBSRkqdA+6IEh0h/JIvgDYJH3T2tGIeqCNGFEcbmNpZ83fKjp3QUfA6zxSkZa8rqZB1YWKUxKcIYCRAArFFPGTcu+wWkxsN3GipM5xFd; 20:F8IDhf0UTQFdjStsB+ooODAE3orUDNqHxOe8RRtVi7l18nEs9bbRg33XRPoimVAwCcjrcODfypNHIElz3p5JENLOzLILi0J09ZkyrrTJkk2C2KI64ckHKYSOH4ZzIips0yOBcAJFYuJbgQzrrpNwtn0I0kNmVDWeLNJJ5jp3AkU= X-MS-Office365-Filtering-Correlation-Id: fffcb9b3-fbc9-4cfb-42de-08d5b5a43ae1 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2018 11:58:49.2864 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fffcb9b3-fbc9-4cfb-42de-08d5b5a43ae1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1330 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 c9a6ef33a98b..9a10e44d866b 100644 --- a/fs/super.c +++ b/fs/super.c @@ -134,6 +134,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 a9ec364e1b0b..4081016540bf 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 648b08621334..80743878576c 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -446,8 +446,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 @@ -586,6 +586,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)) { @@ -633,6 +635,7 @@ static unsigned long shrink_slab(gfp_t gfp_mask, int nid, { struct shrinker *shrinker; unsigned long freed = 0; + int ret; if (memcg && memcg != root_mem_cgroup) return shrink_slab_memcg(gfp_mask, nid, memcg, priority); @@ -653,7 +656,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 b8900573db25..ae0555169b22 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;