From patchwork Mon Jul 9 08:38:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10513957 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 39CBA603D7 for ; Mon, 9 Jul 2018 08:38:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2272128A58 for ; Mon, 9 Jul 2018 08:38:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1619828A5B; Mon, 9 Jul 2018 08:38:57 +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 6E51128A58 for ; Mon, 9 Jul 2018 08:38:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 665316B0294; Mon, 9 Jul 2018 04:38:55 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5EE426B0296; Mon, 9 Jul 2018 04:38:55 -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 466B76B0297; Mon, 9 Jul 2018 04:38:55 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f71.google.com (mail-pl0-f71.google.com [209.85.160.71]) by kanga.kvack.org (Postfix) with ESMTP id F27806B0294 for ; Mon, 9 Jul 2018 04:38:54 -0400 (EDT) Received: by mail-pl0-f71.google.com with SMTP id w1-v6so9573482plq.8 for ; Mon, 09 Jul 2018 01:38:54 -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=8KV3MWILoQz12kP+iXeNvS3/kLviPBnPXXzBSnu+9hc=; b=RLJ7FEZE2zjKCzXDT1w8OwEAh2dLvQXK6n2awr6R1+FTwx/KFhFcwGsmxEwpLDC5IP FonLgL/BCTe7hyP8aNeFsWYww0JEXAS8EQJ2/aydu2hVnOzXU21WmQ2YI2Oj0HIQWicj bzK1/5f5Vn8JEuf2SLLAxDzHDLSDAVrJg1PKxOB4hkc8M6wboSsKHfJWl2Gzny9AS62b EOV4UzIk1aBhr1Ekc4dVomim/mhn1L5glifIykNBqWKobYnxr2UHqlSKg4RkIvsMs4Xe ak/y4K6mHyErBoqbM5WP+1WtgNwAxEFnWdACEEsg3Vd4yUpj+9sBXCPNChvFbmlxWAzS LsuA== X-Gm-Message-State: APt69E1zKToOpWsKFtdum8Xa7PsAU1EiD7ACrbVHzCVhXnj/SGNayum5 bZ3gALEAT7frHaniUyoY8MYNRUqP3+IX/4u7daDrcxFVvTutp0J1/3aIqMly0hZPJofYp3prr8O 5VV1hU+OdiveYplKs8fpaeIQ31zELit/1+I/D+ywOx7tOJ9tbgA3HYW6EOUsdxIydnw== X-Received: by 2002:a62:1358:: with SMTP id b85-v6mr20548288pfj.238.1531125534658; Mon, 09 Jul 2018 01:38:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcCmxbiX2FElcmzIyQK/En3Y7fmPjUL1DIN2nRRfvdvOMZFh3KPrd9gkWOaC6Q3yxqBcvWk X-Received: by 2002:a62:1358:: with SMTP id b85-v6mr20548242pfj.238.1531125533657; Mon, 09 Jul 2018 01:38:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531125533; cv=none; d=google.com; s=arc-20160816; b=hTjSgKw2dHCREBlzSH2+WlnFiB8SfRVETuVE5CXPZcSgr2EJEuXdW17AUoMQV4ajJT AHll0SchREIgHgYumANVJqmUePp4mZn0d+OsgMVpdNk8QNfc5+B6586KudBQOCUZn7/B wJOa9B6GU82lSUiA41RUHRWm101m/7dtrT6HjpIYAweyvGuzfpqbb32FKl4riTCJvrpq JnjdemYZCS2jb7myQBey7fXUx8eyuaDmfS+poYzbnCQHi3Cs9pE6ew7Ad/mFp3ZKzYS2 EivtxKwuF4FoqsUpsGF9gUP4wVZdGlRrgHvtLdmvV+vl+kD+2Ni7F/3NPUkGxhNmK8Z5 IrKQ== 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=8KV3MWILoQz12kP+iXeNvS3/kLviPBnPXXzBSnu+9hc=; b=aRzlwHx0XJohFVOFwrTkH0QqMZSvm7DYrgLDxkvTGbma4x0QsGWd4S1PpEojymL6i9 buKW5VNyFbNBi0Iqpr99kI9/PXDmy8nt6USbsdaCOdlxZvdrwcLUcBOxMY8Cf3mrwsVS hAf4o5VNwAwn7SmLE3NtQ38ho9uVOdC0I9OCCInP6U/M0dXjqNlOS9g0J+ZYZGzzf3Em oruiaV0GsQ/Fyfpdm+awUM6OADS1cV3jJT00yKfOzVYlZpTc83eR+3m6pYAJj8vqX+BU LergriHzCYU8h/hpL1wEoh8jsbm8WqEqy5igQoAdeZ6VIXIXulzX69AAmkDtfMJwtvrj OegA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=K89EAX50; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.2.125 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20125.outbound.protection.outlook.com. [40.107.2.125]) by mx.google.com with ESMTPS id m76-v6si6712361pfg.323.2018.07.09.01.38.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Jul 2018 01:38:53 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.2.125 as permitted sender) client-ip=40.107.2.125; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=K89EAX50; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.2.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=8KV3MWILoQz12kP+iXeNvS3/kLviPBnPXXzBSnu+9hc=; b=K89EAX507homFWRyLYa3h9V1PkxJ6F2/K0QBxpo+kPKnLMYUj8OtsQBIVGi6q4pWGMk5ftFun7Cc8YOW44UT0bhuVZTmOUwGr7DtmiOXLhfNXsK+6LKoQ4JprDpO9HMQdMqz4bUSZU1nc3Bo4ROZ87iYtWp+YzdIUO/FNOtHoAs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by HE1PR0801MB1338.eurprd08.prod.outlook.com (2603:10a6:3:39::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.20; Mon, 9 Jul 2018 08:38:45 +0000 Subject: [PATCH v9 08/17] From: Kirill Tkhai 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, akpm@linux-foundation.org, ktkhai@virtuozzo.com Date: Mon, 09 Jul 2018 11:38:42 +0300 Message-ID: <153112552271.4097.14161701828315972494.stgit@localhost.localdomain> In-Reply-To: <153112469064.4097.2581798353485457328.stgit@localhost.localdomain> References: <153112469064.4097.2581798353485457328.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1PR08CA0115.eurprd08.prod.outlook.com (2603:10a6:800:d4::17) To HE1PR0801MB1338.eurprd08.prod.outlook.com (2603:10a6:3:39::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1f0efc00-fef3-42e5-18cf-08d5e57763fa X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:HE1PR0801MB1338; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1338; 3:uQRf7Jke3CoujQyTygtrqZOEmHPRSoQSBP+dcHtoHZSLfPHa2To1iAHMHgPO+ySjc1A8xJLB8ryDme3hf2/4S1TeTNRZ31+E8shc5MjmlqZ9+gjEiBq7bHJtzLNA1WD+hf5VGYdiwlF1cldS+hr+jaVDRr7D+cBT6yStj3PsDSUpy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ZneObo/r6aLWsko7R29nRRG2vfjd6/xDtPmmiWmN4HVjBliX1ZHC+xoeK1oT/ExJhwRp7vCRphpk3ZhV/SJezhUt2jxdW89Iq47dg/ioieL74l+aYHPdcdYX+5hxm0pxFJVvSTQa9OzstKqsDBV4GEy4JNClN8UxFhQpwJd; 4:5YFGBz+UTbZC+qKxvubxHx7CynO8YyDFb9gaCWonxwS84Svrlqu6BolERGXPaYuba3RpawNmSFJf35KdLExay+JVvWclA8VfmWZZuYYBJtRPySMNH9W8aUxbmsXLqvsg0OCGtYbx8F7X/5car1m8dYLzKG83mslwPZ8120krfJAE2Mr2U5Sc88/zojtcTXuhU5ZOQhycWL1dk3JRmJ9w45WbZ3i2BhY4rqcZsPR88E7lRUBcDdkJI2maD2BSAogD95LSyOCepou02aGOENLI/D2P3zU7JHDx0CfGNcdXnLUduNRSigH1zMYxHMu+BX7+du6eYI9I5nXnQCgKwhvXiy1LNJT65eD1PGZtgCNatwvr8CdZpjJkmOpMJ5x+910s 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)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:HE1PR0801MB1338; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0801MB1338; X-Forefront-PRVS: 07283408BE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(396003)(136003)(376002)(346002)(366004)(39850400004)(199004)(189003)(23676004)(103116003)(478600001)(26005)(9686003)(76176011)(50466002)(106356001)(6666003)(3846002)(105586002)(6116002)(14444005)(6506007)(66066001)(53936002)(186003)(33896004)(55016002)(47776003)(68736007)(7696005)(2486003)(52116002)(316002)(39060400002)(61506002)(386003)(230700001)(97736004)(16526019)(8676002)(7416002)(5660300001)(2906002)(81166006)(86362001)(575784001)(8936002)(81156014)(305945005)(7736002)(486006)(58126008)(11346002)(956004)(446003)(25786009)(476003)(921003)(222073002)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0801MB1338; 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?MTtIRTFQUjA4MDFNQjEzMzg7MjM6Q2FRaHVLQ05aT1M5TTkwb3lPRzhQYWJC?= =?utf-8?B?dHZlZU5tY0hqN0cyTG93VjBVeWFJc0pZYUJxY21Ga3JvTVFCLzJIN2Q2Z1NU?= =?utf-8?B?Tlp3L2dIV21xbHVSakxGMCt0cEQ3RGZ5OFdONGZ2QXAxVEN5SVp2WDlqZHJ3?= =?utf-8?B?YWdXdG1GWmxhb1J3SkhUTWVGc3JrUmY5SWhOYm44cHpZMDE2bUpmZFdpaXM1?= =?utf-8?B?elV3ZmJ0TkpBTWgyK3NKVkdjNkhXZksxM1Bvd1FZcnZnNjhoTldZUVVmUUpU?= =?utf-8?B?VWpRb0xTWWxPL25hNTZhbEwrUndVQ1dJSHk4RklTc1dxaEE3T0ZDbml4ME5x?= =?utf-8?B?QW1YbmpGYjVORmZ1YmprWEIxQU9Xb3hGaFpHa2k3eXJUVWZCalRGNlNuU1lV?= =?utf-8?B?UjVuUndFdFhjVjFhRmFxMmVoR2RMREtNYXJmbGg5RjRaNGhQbE9RNzNSV0Yw?= =?utf-8?B?aEk1b0Y4T2ptVHExLzBDWWIwS2hrVXRjZ0Z6S1R3dkRlZ2NOVDZQY1V5ZGhD?= =?utf-8?B?SVJJTnlpcGVXQTVlcEwzU2c4K2tiV0pWYjlRY3I4Z3hGZ3Z5KzU4NDRGWFhm?= =?utf-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VSG2+e0SiaKGZS816iDMxtxUxuzadMsqAXf6oIkXeWLlj+0OW7xkZFcqUOyCAo8LVT5O20uKHerZ+h/NekSUMfu/x7D8zI3DqJA8TXdf6r3iO0TDAdqKcTVko/7oluWshK98DLrv2aQ6Tf4oMx18K/TSn50lUoEoRNdo1fBnNuM54qwYMLsm80GTtG25yv6KNAE2xnHrFSGsrp8S+EbR2FmLuGl8Z1nGCU4QzU+t+A==; 5:i/VjH/mDHmzzktOcIRV1OMdg8Fcu3l0iybcqjWipgFa2F/j3e+pa3SOz2vtz3JBD2cpZgns+whuYYMr5PdCkCbXj7CnCPh8urQJmuBB4fPhG4S/EJ6WSGlpiu0EooKZsi9VIvZ9KECpn+It4LQ4sZXOwqSN5Ux690a/k3QGtSjc=; 24:TIaw5FD+hRUc4UHK/2IMYNT0hzGFQZfLe/DbjglF2HllJAZifjGr//w/29kExoAVOXxaxgMKXsxU6PxWTF8Zz04YiGoyBa11siM9ESnmN08= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1338; 7:TtYgBLvzRl5sUg301PXL+5tV3B8sXJXnEUfMXK18aDll1+oCDOpgCpFpn2VnRHaE2c2pa5Mbmztz7kFX6QkCXEYbIC5BvvnWtE8P8A+5Xn/XD96E8tdBFJ5gT+l9fRYxUlSpzWZNduMz1scfDxJ2JBT/jcUU8eR3MwJr+B+NSDU28PrfZiTEyN6zAvH4yjtE6cGMunJ5+jSxch+vjPanKGODufeH0cb0qzkw34O2UY2br9klHrkdLkTObRoMFLuy; 20:jl4m2F99QO3LxlYTRDOEoQC6b0NeXwPkNrKvXF75vwUgNnk4IS4dHj87DXPdwfy6j200I7W40TWE+S611oYw5ThyRF4D1I99cnri3LqKuLnZjtsdSEMn7IhadPIWxcfmzgUakMuOQGrdPk+cCPgvPZeNPe96P/HuBE1TsjQximc= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2018 08:38:45.4912 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f0efc00-fef3-42e5-18cf-08d5e57763fa X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1338 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 fs: Propagate shrinker::id to list_lru The patch adds list_lru::shrinker_id field, and populates it by registered shrinker id. This will be used to set correct bit in memcg shrinkers map by lru code in next patches, after there appeared the first related to memcg element in list_lru. Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt --- fs/super.c | 4 ++-- include/linux/list_lru.h | 14 +++++++++----- mm/list_lru.c | 11 ++++++++++- mm/workingset.c | 3 ++- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/fs/super.c b/fs/super.c index 78227c4ddb21..f5f96e52e0cd 100644 --- a/fs/super.c +++ b/fs/super.c @@ -261,9 +261,9 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags, s->s_shrink.flags = SHRINKER_NUMA_AWARE | SHRINKER_MEMCG_AWARE; if (prealloc_shrinker(&s->s_shrink)) goto fail; - if (list_lru_init_memcg(&s->s_dentry_lru)) + if (list_lru_init_memcg(&s->s_dentry_lru, &s->s_shrink)) goto fail; - if (list_lru_init_memcg(&s->s_inode_lru)) + if (list_lru_init_memcg(&s->s_inode_lru, &s->s_shrink)) goto fail; return s; diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h index 2d23b5b745be..9e75bb33766b 100644 --- a/include/linux/list_lru.h +++ b/include/linux/list_lru.h @@ -53,16 +53,20 @@ struct list_lru { struct list_lru_node *node; #ifdef CONFIG_MEMCG_KMEM struct list_head list; + int shrinker_id; #endif }; void list_lru_destroy(struct list_lru *lru); int __list_lru_init(struct list_lru *lru, bool memcg_aware, - struct lock_class_key *key); - -#define list_lru_init(lru) __list_lru_init((lru), false, NULL) -#define list_lru_init_key(lru, key) __list_lru_init((lru), false, (key)) -#define list_lru_init_memcg(lru) __list_lru_init((lru), true, NULL) + struct lock_class_key *key, struct shrinker *shrinker); + +#define list_lru_init(lru) \ + __list_lru_init((lru), false, NULL, NULL) +#define list_lru_init_key(lru, key) \ + __list_lru_init((lru), false, (key), NULL) +#define list_lru_init_memcg(lru, shrinker) \ + __list_lru_init((lru), true, NULL, shrinker) int memcg_update_all_list_lrus(int num_memcgs); void memcg_drain_all_list_lrus(int src_idx, int dst_idx); diff --git a/mm/list_lru.c b/mm/list_lru.c index c5217d84c6e1..5aebbb9b2f5b 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -546,12 +546,18 @@ static void memcg_destroy_list_lru(struct list_lru *lru) #endif /* CONFIG_MEMCG_KMEM */ int __list_lru_init(struct list_lru *lru, bool memcg_aware, - struct lock_class_key *key) + struct lock_class_key *key, struct shrinker *shrinker) { int i; size_t size = sizeof(*lru->node) * nr_node_ids; int err = -ENOMEM; +#ifdef CONFIG_MEMCG_KMEM + if (shrinker) + lru->shrinker_id = shrinker->id; + else + lru->shrinker_id = -1; +#endif memcg_get_cache_ids(); lru->node = kzalloc(size, GFP_KERNEL); @@ -594,6 +600,9 @@ void list_lru_destroy(struct list_lru *lru) kfree(lru->node); lru->node = NULL; +#ifdef CONFIG_MEMCG_KMEM + lru->shrinker_id = -1; +#endif memcg_put_cache_ids(); } EXPORT_SYMBOL_GPL(list_lru_destroy); diff --git a/mm/workingset.c b/mm/workingset.c index 4e0b2523aae2..cd0b2ae615e4 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -526,7 +526,8 @@ static int __init workingset_init(void) ret = prealloc_shrinker(&workingset_shadow_shrinker); if (ret) goto err; - ret = __list_lru_init(&shadow_nodes, true, &shadow_nodes_key); + ret = __list_lru_init(&shadow_nodes, true, &shadow_nodes_key, + &workingset_shadow_shrinker); if (ret) goto err_list_lru; register_shrinker_prepared(&workingset_shadow_shrinker);