From patchwork Thu May 10 09:54:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10391553 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 A29CD60153 for ; Thu, 10 May 2018 09:54:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 90E9D289BE for ; Thu, 10 May 2018 09:54:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 82C11289C4; Thu, 10 May 2018 09:54:19 +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 1D60B289BE for ; Thu, 10 May 2018 09:54:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 14ABC6B05EF; Thu, 10 May 2018 05:54:17 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 0FBB96B05F1; Thu, 10 May 2018 05:54:17 -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 F04D96B05F2; Thu, 10 May 2018 05:54:16 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f72.google.com (mail-pl0-f72.google.com [209.85.160.72]) by kanga.kvack.org (Postfix) with ESMTP id 9D4F86B05EF for ; Thu, 10 May 2018 05:54:16 -0400 (EDT) Received: by mail-pl0-f72.google.com with SMTP id f35-v6so972074plb.10 for ; Thu, 10 May 2018 02:54:16 -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=GxUUVkzyfzxekYFSXH9ZiF1N0xg6ECCmVx/5DgTypbo=; b=hHB/+CTYHcYdMI1KlP6e3YBvbGzPIcj4ATFGVxT2pGysQMg59ZzyIPv4vzaDiF4EJC 67JEHppYW4bx+9cG0HSBleqpkhzlFTguZOFg7TiSnOQ+WeflnUrkL9W3PMJ2syBlcLBB XcwxSD9EAuKH9YcfUe9JH2g/i5Gmgvm4MnJ0kj0JiN9QmXOzI9PmdG0Mr3zvu59oPV6G Oif+VMrtScYyou3b5LKiHvSWx8IqS3Opj+zUiLjip7O4s7vf8CPWlvrn3fzCq9ZISFQI mzu2BcVyVcMdoEiybTQFdbP+qqZLq7PyxKO2+1iW+ysr94fW43CujvORtp6bi3ZenpBK cC+Q== X-Gm-Message-State: ALKqPwfTrVJI1FMR+uzGE5kl7RnqXfgtqnsVtncyK38dcQkAG4E06d+g nyK+Sr1b9M+a8AW5IW8zQ8HTnRB+MJ8ogvZA5B+u6VOI4Vj7dNdesU4DFjLNb7pDDXvdx1qK9je tN//4hMBeWAr4W7cmOwbdX33gVIhpufn3gESyEz52A+MbTsyENWO+vT73SjANy0KQuA== X-Received: by 2002:a17:902:2f43:: with SMTP id s61-v6mr709451plb.99.1525946056314; Thu, 10 May 2018 02:54:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqOcT4+SMfzXzitY7c3iF7ny/LciteRRVF9Tm49OLj+mO9cBVhjNTWfRLVR/GuXZ+CpEeST X-Received: by 2002:a17:902:2f43:: with SMTP id s61-v6mr709426plb.99.1525946055459; Thu, 10 May 2018 02:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525946055; cv=none; d=google.com; s=arc-20160816; b=chkUDREBz5miYmUAy5WCduADHAGZ6ngOHFIaqb32Ao562W0OB774JHZeR5sVBHdS9f w0VkXCn1vRHbd6ev9c3MJ00VNzVMYGNpe/q2E4cyEFmIedQmGGsDoOof6dbQhfgMTvoU RZVmmY7uEeHru9QDi2hCI8jjbFB+uoI+U1lLMxarGo8XzCJpQC38If+xiit2i7EytOOC 81CGw+fexGUvEsexyOK7+zE8ACGlGGwv5SktnwK+pPByNl/IQapXk7KEqnCEcQwNQJW4 RyswgMvwROc48e5dxGSp7kL65EiifhKNOfOm8z2VVGRxWBW29clHsQRy2VbxixSn3wEP CiRA== 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=GxUUVkzyfzxekYFSXH9ZiF1N0xg6ECCmVx/5DgTypbo=; b=FtLF0oNjUZVHmMD9Qow3KP1B3ykI5AoZGmooa4f37G8zTwDA769TgR4R6Vj/Ae9U/O 5fhxshNxRLvp1gCl4nXvur60Fw8rVaGkPIuxvAKI5SuCle2spr/6U/Q3Ee5JKgHQN99G Ewx1WMJmZXBMGv3MIIvaaafeGv/vy+li4gkPseJOCwmV0Ss9aq5RR3Ps2o5SQL/OPgJD y7ZL+cbHnhbK+P5oe+GENW6ZP28z3x9WqA8vnAzdCICiyRbc4kwSJvjDUsv7ZRjEe4df +RTHCDWOv6Jo2hac+RsQpl6ciYXKFKqrc+Cz7h5zm3B9A54UNZJGE3V2h8t/3ECGoR60 f1vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=OQmkT8x6; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.0.123 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-he1eur01on0123.outbound.protection.outlook.com. [104.47.0.123]) by mx.google.com with ESMTPS id u2-v6si376543pgv.246.2018.05.10.02.54.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 May 2018 02:54:15 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.0.123 as permitted sender) client-ip=104.47.0.123; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=OQmkT8x6; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.0.123 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=GxUUVkzyfzxekYFSXH9ZiF1N0xg6ECCmVx/5DgTypbo=; b=OQmkT8x6zY9TXcNWIQTuS7Bq8uCnRjECcBD/nGETVzTuJse4lycX3a7+ZnNk58z+xM0lFubyGlkjNJo8NEjb4zsf4yLxNkwbeo4wL8R7MAbSzO1tDRMagNSfm+cduEaC7T6AiZRFpsXiUikhJ47C3cP5gd5TCMm8PKcbAdJ+cXA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (195.214.232.6) by DB6PR0801MB1335.eurprd08.prod.outlook.com (2603:10a6:4:b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Thu, 10 May 2018 09:54:08 +0000 Subject: [PATCH v5 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: Thu, 10 May 2018 12:54:04 +0300 Message-ID: <152594604464.22949.13100629516136544648.stgit@localhost.localdomain> In-Reply-To: <152594582808.22949.8353313986092337675.stgit@localhost.localdomain> References: <152594582808.22949.8353313986092337675.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: AM0PR07CA0016.eurprd07.prod.outlook.com (2603:10a6:208:ac::29) To DB6PR0801MB1335.eurprd08.prod.outlook.com (2603:10a6:4:b::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:DB6PR0801MB1335; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1335; 3:1of641lO+l5FWzIXvh9onfASEabATpWDMe+cH12Bev5abYynSzSC9sfsVbmRRMXvmNOi+2sWKjrqbzyAB2ru4nZRjvJuGpWJ7KpaIo9qGQ9N4oqN3EwVPBP1aCI4AeZ/WkFgH2D1gnB5f+yOWxEhbIZ0SiT5EZ5o+tYyz+XbBLEH5pWwhmkNO9lWKk93K9+Z+3F9VG15+n82shv2mUrCjUgIkd22j09bEVu8LGo8PykvVk29nWeuew0/h3R/19gg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Bxhv9meLcqMh3rzNNDEgLyUOgTsvE3vvsfgktmVFuUgQlZd1gGaDSjuDOkupnYmnaYWjxU5n5K/42NyLXGGEibY7YneiGdFv5EiOxT; 4:uzbyIGx0DsMCHbRV0zlUBS1nmx9AIP4wh5H30evEeqbz10q9zQR94rrroWCxWvIr7p54jzbFDePR21YWSGYtdWbnYYeskVp5iD8e1ZKfunrY3BUB0qcv4o3n8gzM3JUPy6JCHGUHtUC9ltVkIf4Tanyf2EXkk8s6AxTm12TUQDduGOBAGc18qjTjr7MtuHmjVqpJiO+zC2rCkXxd42pVn2qvn4GS1DmwzD/SVNxvTGMYHVSpVj8ZCnQ1kypOaBcxvQgcxWqvCH3VTpCE/cx1jQ== 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)(93006095)(93001095)(3231254)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:DB6PR0801MB1335; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0801MB1335; X-Forefront-PRVS: 066898046A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(366004)(39380400002)(376002)(396003)(39850400004)(346002)(199004)(189003)(105586002)(76176011)(186003)(16526019)(230700001)(55236004)(106356001)(26005)(7416002)(2906002)(11346002)(446003)(81166006)(8936002)(50466002)(33896004)(486006)(476003)(103116003)(305945005)(7736002)(316002)(956004)(59450400001)(6506007)(8676002)(386003)(58126008)(81156014)(61506002)(68736007)(6666003)(6636002)(9686003)(39060400002)(97736004)(478600001)(25786009)(7696005)(66066001)(55016002)(47776003)(575784001)(86362001)(53936002)(52116002)(6116002)(5660300001)(2486003)(23676004)(3846002)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0801MB1335; 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?MTtEQjZQUjA4MDFNQjEzMzU7MjM6YWFDL0UzdFREZGw0TnVBTEN1YVFBUVg4?= =?utf-8?B?SmdrUlBQc1hzbGtQUjZneG9kRk9ZZ3ZSZ1NOUGNZNkNPTVJNQ0Yzc1E4dmha?= =?utf-8?B?VnNDOTFHTS9iNWlwVXBVZUpZQzA1VW43UDhCTkZ6elI5cHhnbkZpWlkrQXVH?= =?utf-8?B?Mnpqc1FnREFnK1Iya1lwcXJlQTNPVFlkbWRvUkZxSE5CWlpFU0hXTG1BV1Mv?= =?utf-8?B?UkQrYmJxRmhCa1ViNFlhT1pZZW9EK0ljUlJkUlhpTU42TFc0Z0tJRUFNT2RM?= =?utf-8?B?NWJZWTRUY3dXd0xQQ2tKQlR5SmdwSlIvOHdOQlJvOU9OVzRBWDJaUUIxYWU0?= =?utf-8?B?L2dHK05oSklsejd4MjJJNmlBU2RDbmV4eWx1ZUp5QjJ4NEQ1cHlXUkR6bUhG?= =?utf-8?B?WitnZEFDNHpTSHowYmQ4RmwxZHlQckQ0cnorbTFna1cwOU0xRDJsMW11eEdU?= =?utf-8?B?b2NVTTdDZkFOV3lTUnpNTElMS3dWZG9CZWdYYnQxMy8rdkJWTXFIU1JITnAw?= =?utf-8?B?MEdTTitLS3E3SVRiYjFpd25MQTBjcERrVEM0SUpTN2RRZHljamsrcGNxVHlG?= =?utf-8?B?YjgyV0UzL0kyN1VjbC9oazg3UjcrVWtRS1A2MkthQXUyWDhGRHZ1ZGxydTN2?= =?utf-8?B?TU5BOU9iemkvOWF6RDEvRkVMOEMrVW9YM0pVOUtBR0lDTW4vTXlMWVU5MStD?= =?utf-8?B?TjZ5Zm02dENqUnZPblZyYXd1UTc3WC9kU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NA5nCcECgyyBOAG0okY7TBMbR8Q76gDsYrlLPKknemHiuvZ08q95en5rYGwPfjMxtA/hgsVEkZ890O6avpD2ov82BKIzxpmI7QJVN6YC6lWPnCDsScbNv+nY=; 24:rUw1nFQzLy3WutCAWo+NReU4kWsSyC3ai7B/xl17TCVi3XWBX+Ee3ynZS7HAwLBJoHG557clO5lsl2vdOClXedpfpsEaQFHrT5EATYP9rmI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1335; 7:KNmrh3bMR9tBIULi/Q821NIusVJ08+0oOxpj4LfMs/5GJ8Khn7onHgXtxbR+LM5VgcQOwk3/AKOMITB75uP+4IzKjIcH9GJEJaZuTW93wFW7SFONFumUyVDYfyU13f4fVUIw54s3uNnj7eqelZUTBd9ahRWkg20AOLdpBJVArZQi7XjFyFhwZTI28BekrJOJb3ISyGTKTiAc6PJoeONd8cEXiJ2JCiL0mk2Ogpc8aX2wq83vc+VVXdgu7VxT6N6r; 20:KbqY5SLu01mcVY36M/cpU5Hzg2aaf27G7ZsGyNRV/3ghtEUhM/h8Ccgt2EtdLzoA8898WSgzAu/Zyr4+FjBr4d7d1cfCjw62VqyK17Kot7eEWhN4BpR/tdZLP+8Q2zNfxO2BJD7bcqJm6Nb5HHs/ISRbpbI1QwgFxKO0yFaV1hE= X-MS-Office365-Filtering-Correlation-Id: 83377715-e519-4727-8256-08d5b65bfa37 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2018 09:54:08.1200 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 83377715-e519-4727-8256-08d5b65bfa37 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1335 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 dfa85e725e45..3cad04644329 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 d8f3fc833e6e..82ea5012dfa0 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 a2e38e05adb5..7b0075612d73 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 da720f3b0a0a..e731e21a9fca 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;