From patchwork Fri May 18 08:43:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10408771 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 1562D602CB for ; Fri, 18 May 2018 08:43:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04D4C28445 for ; Fri, 18 May 2018 08:43:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED0DD28462; Fri, 18 May 2018 08:43:16 +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 4722528445 for ; Fri, 18 May 2018 08:43:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 014BB6B05AE; Fri, 18 May 2018 04:43:14 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id F2DFA6B05AF; Fri, 18 May 2018 04:43:13 -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 DA8C06B05B0; Fri, 18 May 2018 04:43:13 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f71.google.com (mail-pg0-f71.google.com [74.125.83.71]) by kanga.kvack.org (Postfix) with ESMTP id 94FB86B05AE for ; Fri, 18 May 2018 04:43:13 -0400 (EDT) Received: by mail-pg0-f71.google.com with SMTP id q22-v6so1838035pgv.22 for ; Fri, 18 May 2018 01:43:13 -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=UcpA1xVHpPC6m0bhf9K0FnDA1027lFi/MU2HK9ZMr9U=; b=gFTh+Y9mj88IRVKZKoPZ9K8OXPc1JwGyv85cXvQz7DtX8m7ddt9bjm1REFTVGhSu4d +K5F5rcMY9Db3JqOCsemmGx4kdp35wO6PB47CLdmsCNIMSEAaElrqutiyovdrfVzvk9/ fXJwKPbNgYJgRX4cTYWrpO9e6tiV+PERcc1EYBDX8LfuNmqVBmHCxJUma/D6KNzyRry7 X00y05FJ6SQ6nTX35QIaJ4qmsXGTXed5rLd4tIOXImCvVqrpwXYyq94F5mUjWJZqLPP+ SOg+0a+xsa0FWtSGrl8Gg7HbOn8yLKHAWKTUOauFy/IlieOmAKIIzFo4L16C/2Dd58Cu qoDA== X-Gm-Message-State: ALKqPwdIZ2VtaTWEM30VsRCZ5scrW2EYS2nrtJUzuw8bhMijxvy4/G86 /j++C2R3akJyWdED1TwV6baU4xSWpGExsB2b1vtFQnVbrdGpN4/M2RrScpggMGXlJ2xrYtsTnfJ akrZp8iUn7IZ2RAKn48O8b5fDdpGNt1pbW6dqpsfcejnUnQd9HGEGr7sdDTsNULFrOg== X-Received: by 2002:a65:6151:: with SMTP id o17-v6mr6908254pgv.120.1526632993280; Fri, 18 May 2018 01:43:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo/2AQ1Qo6xKL6Emf966WoD+7jcXvycoInSwfBtbPf/E7mbDsyx9mzJJ/w+9V9flFitEXeH X-Received: by 2002:a65:6151:: with SMTP id o17-v6mr6908231pgv.120.1526632992528; Fri, 18 May 2018 01:43:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526632992; cv=none; d=google.com; s=arc-20160816; b=CUUDIru//UtNLdHSXVGpBlXZZnrX2mFv2Z9Xf8IoVcZfbKHx+7xRwMx8YzeZGOsZZr vAD5vNct/ZvNUdF0cdnwmWE2ll/KL8oLCNP5s12RpxSb1k7mjymOXJ9JUXh2kdZ1Ld4F ySfz1J7WhsxfJNd/mTddd7ccI0IjoWLjp2f35VrhDuMZnEEzdJ3QIYIr7SfuDqaVAc50 8ODdcXEVjp5o/N44E/pJeOCLfHGcKZvmjvGqe629RxIuBvYlrLyJC+PLOCpQBLKsphRI 0bTh32Kus52J4HtT9Ps766KYqKgh9WcBn+U96S0g7COcL4SaXvfwLB1JJDRogRoDTtRJ iXfw== 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=UcpA1xVHpPC6m0bhf9K0FnDA1027lFi/MU2HK9ZMr9U=; b=wOXr5XE+Y+CFb4KYdqSdEFqtAByBkEk1RL+bxRYlxt2w04OWCfTZhu8B2+CKXLdzfi Aufe0e+6SSpn3hjp8Rq+BfW8GcZopfjomxJqsYiADz1zoSsTHAQYZ7+COCbD+6a10oJo fgFlUEQKhKKXIqP6ChBvv7TbpN7/bRzu6dfdue10Eh+Dg3Y/8XcEb0DTcDqdF93TdrcK HJBo8HmN7OoF0G4p6HY47C5jS5kyQkIeeU//8NOyBajTyRgZbdoReE09HR5mdBQ5GaS4 q2Un9w/4cm3VC4+SRNVEGEATQtpsRfHVpfeGAiKiVyV2JWef2ngs2cBJpf3AKeJqBqGY QbWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=NfaNzP0x; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.94 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-ve1eur01on0094.outbound.protection.outlook.com. [104.47.1.94]) by mx.google.com with ESMTPS id d1-v6si7343873plr.410.2018.05.18.01.43.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 01:43:12 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.94 as permitted sender) client-ip=104.47.1.94; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=NfaNzP0x; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.94 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=UcpA1xVHpPC6m0bhf9K0FnDA1027lFi/MU2HK9ZMr9U=; b=NfaNzP0xdyOzieghXD2vWF2EGwyQ51IDO9ybcsNl7G8LYD6TVyA9Xk5pkkxdpSZIWYkukzBzvf7s60eg4aAnFq/mIjO0zZe67BxpGpR6W+ydNAfwSQ4o7CqD+GuSrqW7TdqbiNxExGNajr6Atv8gits7HB27HgzmjK5NI/04N/g= 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:43:09 +0000 Subject: [PATCH v6 08/17] fs: Propagate shrinker::id to list_lru 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:43:07 +0300 Message-ID: <152663298709.5308.15783920940060927762.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: HE1PR0202CA0004.eurprd02.prod.outlook.com (2603:10a6:3:8c::14) 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:1gVFvbXYGpFTsAAi2hk+54AHnhlc0JK8JHhRsbiahw/ElEQykCMRL9QP2NSmUSwJ4Guwscsnjxn8LZ/nbDcRb9nB5nXFZwRrHXvIVkPHFg0tOWfVaWKe1vaixk1mWjo0edNkn/vXcFv8DmaN4uhzmiAWhldhAg56FC9byS9HyfPhAlN97gOOL3TnCjr0+iy2IjGvfAR/zZ4/+1x73PsyDZ7naeacFqBiMA75/F2kYx7vfcsKwq6YRNA4WZ+4unTv; 25:mqNhWfBINOazJdhWh5nnyRkpoIViaYYQutUc9wIMNKxiZhGm3Ipvr/6I6CyO8KZKD3zN0kHnMCyQ6i5dBbznvoxxmUTwQrW9VM54QMcg2XekQ3zBmLIae/wevJJUTlTVSWp6lEPFHkKUrr81li7YkCKH3xfMp+824k+oA5+ZGZNLas1nKdhAvqzqpAbo9BRK2FCKpJP0ITLakXRoTeHv9lB+lVY264zS2MzNSAKNFbk3N39RqAJ5FTfjS+8X//oUlgMvVFyDSjUbLJg7HF14ZbxwUvlKTx1ZRF7JQlFrVaH0Ko1DKhpbqT2H1TL3OYc/pzbJUpcv0THJrzGkvv2Ovw==; 31:LgBd8l/w7gfK4gYWtfCiNTIkkCzTO7733RWIavXJ0oVxAfjZ9FYvCGs7WYPJZz5TysIlJkSG2fXHW340CFD31LxVGAyC3o+pR3jYv3fkN+fUlVllDGui3J/fXgzwkZn5JqltnVyfAzBIilNodcriHmRyoGcstmhIvhkZQMSuFjRxWhN2qKGX78IVV9b0WQdNmFF6ikeGkuC2lCUyR+QIz9MEvSdrttQvhVpWiF3Eu3Y= X-MS-TrafficTypeDiagnostic: HE1PR0801MB1339: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1339; 20:ToHx8BNjTpuXjzOPrGhT4fO8Me0+cYqP+0gj6bROUJH4ua2/bMtw/pYlIYNuP3bsEAOOxVdR0koaAn5mzEO7+lxCSgyvMSXgRTP7KIAvgxLvl1R03BtPQ2RSl+iOswcVR9Dl78lScUO1C6I7/ihjUpitSqsACjjLdKLT0MAY8pmMf/2mA32odVcS+w6AJ8oehUvyWrspjLk+46hAtZlNg+QJHYHEb/lHzd6aiUfo7KyNuwUB7/IB5nsryEtY3FJ8AQwbIx00eCuGBuHkDli63mRfcNFTf6ajbeBufDue8+WnzeuUpH3NDIxdgEd1BfF3VRSNRh4rSKnrPWA6sIAlq9J9C4DlgqiYCPObTS1jLK+/P+cKMnnKf9mbwD+gl+Ea41Wuro4BaDleQMuJSAtxMmtwiNR7QbmdXEm4vpclQCJFzu6NUmsQop5sN4fK0RW9BMSTAMw1Usb2CjCuqk77WAz1pM2MQ2/pQGzxgB7gTF6OjQrTQDU6t4e0rWrw/DQ7; 4:3EkWb1zNrJKB1eEOGAl+kjPawWBMzhFMeC/f1Mz3M+DBg7JJT2hq4fe4NCuG6p/l09shIIst8e/TkMlh7Kvqtlr2275EkJmok1WaQC4QoNLq2vXgmUrHJgQE95R8yz3gWGh2e3XtQGata6l/JubA4dDxt1c+lVVRE4M56xgPQtflBRCM9IZF4cqqzOXbmW0qzYh7uq9PugV+DCSQnIhADWLkVZnQNSzn9ebzbs7AdKVeP486RkfBpNYy3P2yqgMCggONOb9dZVR+LsI9rU9KZQ== 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?MTtIRTFQUjA4MDFNQjEzMzk7MjM6QkRCb01MZWVrVHBUNmI1UmIvRW1PMzhD?= =?utf-8?B?Wkt0bFlGK1d2enltd1FSSzhheWx5bVUyaTRabjlYeVF3VGNGM2NXSkhLZnVh?= =?utf-8?B?c3Z5SnpnZlNLR2xRRHJjZzRvdGU0TjZLSml6S0pFdWFmUHBQR0V3bHVqNkU0?= =?utf-8?B?MUxCMTNXTi90SXlURFN6ZEcyckx2aWpqbmc5OEtKcXhwOGtnMHlKeDBsVXhu?= =?utf-8?B?OExVWHdJd0ZQODVOYVMvMk9UQ3dDNGd2TlZ2K0ZmbWcvWmtoRm13bHZPSFp1?= =?utf-8?B?TzFJek5HaTNSVmxqVnliVDVBbFRQOEtBU0kxcXpzY0xRaTlaMHI3NlAzRHJS?= =?utf-8?B?eVNaUXpsTjl4Y0RuN2RTb2dFeG9kTFF5T1Y4cElQeWptemxvbEE5M0EwUURS?= =?utf-8?B?enA1UjVKV2pJc1pabGNkYXk0MzRtUklwOFhEeXdHL3BGeEkrS1hjdWUvbXNH?= =?utf-8?B?T1QwdlZacjlDc0hkV3QrcTYvdHhjRmxxUEl4N0tTZHU0d3NxWUxUVXdJenk2?= =?utf-8?B?Mml2T3YwRzJFdFhzWUQ5UXk3aEVYb3VKdEFSN0hPYnNHUDhTTWhhOFJkM2F1?= =?utf-8?B?R1NydHFHdTBzcTNhU3o0bm5LRFVobTQyWFlMd3RyQ3RqZTJSRXJWT2N4U1ZX?= =?utf-8?B?MFBNUUhLbS9JRzJoUm1FM3RWTE9vVk5WaTd4aVkyL3Q3TDJaclpHMkd2Qm4r?= =?utf-8?B?Ym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YCiP7Xmc2ZCz3vPlWm8Oc2IH6pQMZsuogSTjHp2GZiGnHeQKTlMLvbMaldJ62aQzow7ZajCiN1haaPYAG22yYa/hL+zuNxrxu4=; 24:wbFFew/TzrbBJAvfQ7/AvEh2jlfwTPlF1ZiExzrPU+HXNsuOWT/Y9IYBlLzp9CjR8XItUFIO5fYBJ0E5ymo1UCxzcgVzfF7mMRKAQqhhB+M= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1339; 7:g8eI8gZz6CRTnEdRLSvG2/AL6iA7+UEIdvlZYU31EFZ5ojMGaD5fdpEVsAZlYwGelIrlxCSN64ENK0RvF+LJ+ldbgBJKKXRFiY3VoEeEf4a0Y1NLfWNgnApRN+fXHR8W/JgM6DwpFyB1T/XNf49XH1rgx4Veirj/cx4Oq9J4sFfXnt0/FEdXLjW4l5hp8BL45X/HYp2I3sI3zboFEHmgZEkKmh+v6Ut14+Fzaqe1/NM62rhCL72PDahYjq3HiDUT; 20:DqmNCa6AL/brOZlVS24xk11l2Tbh674xQlf81kD7F2ZPaJJ8gIcQlmcxOr6N2fLrt91pyU0dAr60noRp8C5PI/FucMY11gqhVusSU+GOLNbfPmPcq7PmYUJ1BopDnvA50IybN4qNkts4OFd29vNO9iEPhdJWUDAIMOipdilHt1E= X-MS-Office365-Filtering-Correlation-Id: 61500837-62e5-4263-186b-08d5bc9b626a X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2018 08:43:09.1584 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 61500837-62e5-4263-186b-08d5bc9b626a 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 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 --- 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 232bb637cf02..dde9ecae7cb5 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -559,12 +559,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); @@ -607,6 +613,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 c3a4fe145bb7..79099bc5c256 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -531,7 +531,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);