From patchwork Tue May 22 10:08:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10417859 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 975346053B for ; Tue, 22 May 2018 10:08:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5DBA289F3 for ; Tue, 22 May 2018 10:08:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9F9728A82; Tue, 22 May 2018 10:08:53 +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 BCDA9289F3 for ; Tue, 22 May 2018 10:08:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A228E6B026C; Tue, 22 May 2018 06:08:49 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9D15D6B026D; Tue, 22 May 2018 06:08:49 -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 84BC66B026E; Tue, 22 May 2018 06:08:49 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f69.google.com (mail-pl0-f69.google.com [209.85.160.69]) by kanga.kvack.org (Postfix) with ESMTP id 3CA2A6B026C for ; Tue, 22 May 2018 06:08:49 -0400 (EDT) Received: by mail-pl0-f69.google.com with SMTP id f10-v6so11809263pln.21 for ; Tue, 22 May 2018 03:08:49 -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=XNKLKnGBLAEHiIdkpJLGKf/m/i+WT04RD/64gZaet3bn3tC0MpUZn4+RGY8S4ASR26 ocb5ak6Nx9E/Ap/K4F/nuCHC0jFMfc5QcXObppWpQtY0z1D3CkJzmMaAaJFKUybCC30R 7s4jBaek0wLyw/gCUD4kRwPF4o2Otweok+4uRiepQVgTxTzM5VdvzJfDYKgvZp+na/cN dmTku50j5umwzMmBtq7xJntSIycYHEciBxhlC+iMkqByjdqWphE+f0rFIAmHwpzf4aDq x2TXudhA0h6nkLJQ9+5ZQ+gWVUklTsuJxfhLl7enExIot3OnwU2gjDEHL6UnabG66rpG IqJQ== X-Gm-Message-State: ALKqPwci+paPbmg79jzqLODdCJOmjmz4UWRzbKE4buGFZ5jOVCqmL7nW 3y1uP+ypVfCMCLmPzA844u7zckkjOwc1I2TqMuiFkJW3rEKy/qtgif16rp41WsfxQDzuaHYvaZQ 2XuYjzTYy87M01tYxk47h9FOh3lEVhYnZ5SFWnSF+rVT6zYrKsRVx4j/ex7IQnmtX3w== X-Received: by 2002:a62:3745:: with SMTP id e66-v6mr23506942pfa.43.1526983728933; Tue, 22 May 2018 03:08:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqLwkeGxqxwDztIJdUXqdnXigty0r+JvQtdVWL/1R4xOBQwgeZ7dVdwvxJCXZsw3GZqu5lC X-Received: by 2002:a62:3745:: with SMTP id e66-v6mr23506910pfa.43.1526983728262; Tue, 22 May 2018 03:08:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526983728; cv=none; d=google.com; s=arc-20160816; b=XczyVcVO5p94btOZjFX+7a/nfNVjxc6AUHFhBapAnrdCiSmL2/DdWYy1lfVySBGi3Q XfGJ4O0jiV7kTv/1eyC6Xntx6NwQy5AdOSzGyBGX+JHvdAAJjFl+DniCGK/fi9y7LXb/ EqPKZjHe2aw6RzZs/bJkA6gp7bpJReiLkH+CTmBTpM3BsTvbit4lsx7dvJ2tAkv73NYO mg6HIHDRR+iCOh/jcRPkbIzKhLuArVtntBHeiaK8w3iRmocsOtc73zb/L94n+3zJroKS ClHDsvSnduEfkInaB48nHF5pmKXFIa+Pmmmoypam/xk9QdnH41GZCyJKQcxc+UnESTpW Ag6Q== 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=ekj4bF2V+wY9S2ADnEHSwhkPeqpqinVBQ5aeo8aqu4XpDfOelqxtJ7xiTALa00tJoo ffNkoOKZiemIlD/jwrtibWMYROxHPfriDOXLEFsctNv+BC6pcCzfYHwP36MyWFgLjJ6L 4Zc/nbASWeOYtn0HTnIneM3MZek7sH6dqZD0oc0knpP2X12jPEtbZiRfWAyUwSgliBxi sEoePVAcY9rpdi97mVgxMYvhMbjFjxgs9HNxnx5Dldx0isIUC/5v1PAqlrr2kHUC58P/ DWIAWmZLaqnEQ7Fi3jrKnBk9cWGwv9zcKmMmvb79s8azOZMPkS7mUqEVRFEsdvGHqXa9 nJaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=fmKl1Ofh; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.0.113 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-he1eur01on0113.outbound.protection.outlook.com. [104.47.0.113]) by mx.google.com with ESMTPS id y12-v6si15242619pfl.283.2018.05.22.03.08.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 May 2018 03:08:48 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.0.113 as permitted sender) client-ip=104.47.0.113; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=fmKl1Ofh; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.0.113 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=fmKl1Ofhvro+Qv3OkqE6wR/wLnC3MhZJQ07ec83cwI7Ue1iV/y/MhIrCojnLdGKMuV5SxJQOlA+/8o7azKNXSzEc/zOs2jGumuJqaiiAj4LdiTS0c/XQh50W1g9kJ/y1SGG4mUGobhQC8ADEhH2Dkd9VibnxhMGst81M4TEK4pI= Received: from localhost.localdomain (195.214.232.6) by DB6PR0801MB1334.eurprd08.prod.outlook.com (2603:10a6:4:a::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Tue, 22 May 2018 10:08:40 +0000 Subject: [PATCH v7 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: Tue, 22 May 2018 13:08:36 +0300 Message-ID: <152698371665.3393.13441718686811755204.stgit@localhost.localdomain> In-Reply-To: <152698356466.3393.5351712806709424140.stgit@localhost.localdomain> References: <152698356466.3393.5351712806709424140.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: AM6PR0402CA0024.eurprd04.prod.outlook.com (2603:10a6:209::37) To DB6PR0801MB1334.eurprd08.prod.outlook.com (2603:10a6:4:a::28) 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:DB6PR0801MB1334; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1334; 3:Ky0sQ83kC6wUuIuUsr9uaKb68OW+lK2j2JDMAj6qscUDmkP06UcCIBsncC2eauzHeBBmxx+hizgNXfPMYE8Y0barfhiYGtVW2WFwFopKbpTXTsdKOu0FG1xcOtjmPdjaefMGoPDEUJBR2kyMVomgXLWMstpZ1Q+alFg0GzoC9xNUWxR9RcO/RsgT+5KvAppLbdG0w/sIj90G6RnBJzIxpw9xqTRecipgrGU4Xot6f/KwyXlEJ5BPKkeFSLSN3gHY; 25:DDe16HmcT9BmdHKbyBJMinSsmeu+OZw8YYFjpa5GyZW/D8UpiPgfCuJYCdE7Mes1PNlRt7E4BmBkNk4EjucD3w33sZYuG5vwdvWgY3IlTVq8tObxQYc554N5+M/ccPFd00B3buPvpDhNRa6464ai7yn++PcUnk9CbRLcfrVEIdm5chta1R/VtBMrTm43j/TFy/ukVqudxFkQgMeVud5z3kuremAA4E4ix/V+1jhLmLaRlW+l4q1d8dzKD9A2PICdcsD9rAGkq9e9zM/Xp1qG9Q693Kf34McpY9wrbbqG2o0AA1fcOY6qxOrpwmwObi13oYfqNw2YTZ0R2ZxVm8JcYg==; 31:p5jwjbfZmLjwfMbjHPTcclYJ1zjhPPjfZjRxHvgOjRzSXzaGXXHHFqPkrM5EWCN9XaOG/iJtI4u6rklyZz/A/qsJSy10mBKZrvcJtoIZOhD7rYxCVt+UwUCI5Hyo4BNKYLEkDGq6lbo4jSAA/1LaytbGXkiREbp4sd61PhGtZPJCpP69r3IdinBDWprpJhy3ycfW+FAd9R/53ZBsPTycgp0wKo8qAfarpKiCK0AhtHc= X-MS-TrafficTypeDiagnostic: DB6PR0801MB1334: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1334; 20:Ppzgbhzg8EXyzMPzaBKQl/N8WQBLGEQZjX0K8lPzgRNOA5SDkuou2sGAVlzO9CaFDzOUEQPJRHTT5NUUVjooYZLe6rlWJaSHhffKGe33y8/DHJNh8MzMj/vYjsA1RtXEUV8hapHWCa0D6vBBX4uudLpQIvOMX3ngEU1p9MQEXBvX58LePyDeU20vVWbfh/C8EMDA+oWy/A3Ri1k/uto2D1P37BX8dS/M1xtaEHZbRRJ7TSwbSwyamN8o4y85k7vE0REaKE9S3jdzGubfQRQDJ+OBaO0MNTy1iyfJcVJXgLeMrnbkYZu4nr1fMHC9ULrmBJXWSWsmhnEJZ1JMY8rebA2q3XF6Uocg35iicKSwRt2qpD5nkWv4tsb21ntOWs0cpLsnCTYQRDN9OF9i3RXZC5nmGFLgUthyES4yfeEWQzJe6j7drbqrKU4KXgz7ksp51HGnjb+PoB+yhSzL4tPB7ebsK+A+hS29DE7Dhw6u2SzR93e+dHFRQg6HbZh8ZfoG; 4:wabBhGxMSD9on0veZsI//fkRLHOQrEAkgYQFAafktsFzPhm1WIpVlCc6uiEsbtf63YPcA1n8klmDYjbBAnRZ7IrD0BIi9/WXLYIIbCDPtuue8ovMZk0V7qAkMJMP/whBQhNFTjnoI96+9mEPz6V+588TGBOZqm9Gjz5tZL3jMJfApECh153SV/hgmJSigln1bhzauLkh12yre1eeB46EFhEg4Gu/yCKrTgFKvF0Qg7KXO/3KjFxKCb+mWzV3yWkyTywfO2gicq/xbhsmQDLGlw== 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)(10201501046)(3002001)(93006095)(93001095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:DB6PR0801MB1334; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0801MB1334; X-Forefront-PRVS: 0680FADD48 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(39380400002)(346002)(39850400004)(376002)(396003)(366004)(199004)(189003)(11346002)(486006)(305945005)(81156014)(186003)(230700001)(55236004)(6506007)(386003)(16526019)(8676002)(81166006)(53936002)(55016002)(9686003)(50466002)(26005)(6636002)(2906002)(6666003)(23676004)(39060400002)(2486003)(8936002)(86362001)(575784001)(476003)(59450400001)(33896004)(956004)(7736002)(76176011)(97736004)(446003)(52116002)(3846002)(7696005)(6116002)(25786009)(316002)(106356001)(5660300001)(478600001)(68736007)(61506002)(58126008)(105586002)(7416002)(47776003)(66066001)(103116003)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0801MB1334; 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?MTtEQjZQUjA4MDFNQjEzMzQ7MjM6ZVpaTDRRWGZBcTVnS1RHaG9heHVzcmdU?= =?utf-8?B?QUd3ckRFSy9BcHQxUHZEYzlKMnlCUnpXUW1GZlVqdktpNFFyc0ltaDlVeTJw?= =?utf-8?B?ckdyRFVEL2o1QlhpM0ZnS1hSejFVajAwL1BSUktXOFFTTmo1WGt1ZmpBNXlJ?= =?utf-8?B?ZGgwdlR6czY3RUFpTFBNczFaMFg3Y2NnMDZBVEtWa3RucVlYeUthYjRIdEd4?= =?utf-8?B?N1VyNzJKYTZqTDd5N0lLQmtQbXd6dkF5MlNUKzhLTDhIYXE0ZEhKZnJzSm1H?= =?utf-8?B?dFVDMEtyQld0YmJ5enI3dEJaT3RqL3NSYlpRQlQrY1lIWEMzQ2RIVmdiY2RG?= =?utf-8?B?WnVRZmN2Q3REM3IzYXZWcDg0RTVTczRNd0tJZjhFN0tUUVZPNFY3RlgrWU5U?= =?utf-8?B?czh2R1hXMmJvcmpsV29QYlloSFB4dGFqQm5Gc0NwUzhHVVV0a0JYdXIzMGl6?= =?utf-8?B?cmRRaFhET1FvZnpXNEIzckZ5ajlkditka0UvSUgzZ3d1QzNXakxSWjhzM01P?= =?utf-8?B?dGRlNk1kSHBob3hYM0NVTy9LYjYwS1doeDdXZGtMQ2x3UW90UHlhRldwZ25w?= =?utf-8?B?MlJtblBSTEJGc0JqcmEwbHFRbHVxWEl1cFkrS1g4REdnUk9uQURneW5WL25k?= =?utf-8?B?VHVTVGtEaUFjUGFpSmhxZmIxeG4ydXFGOVh2WkwwR1BjS2VlbnR6c2JHRnZZ?= =?utf-8?B?Mkx4RFdrUGFPWUsrUUc0d2lkYkxiRHNCaT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BYT/EbQmaIwwZgkwbnK0Kt3aLx36GCZSF+4ZrN17Iv5QzA39lruN6qfhYUqdhihFhkKjhZG9ZDEecjEstB6V8308p+LywqbsTNiVTAT75h/SfMAR4Q=; 24:zaDmDkb27brQcLaqH6fDedgjHiyJG3Ksdfthzy65O3QnImMmPfIxLXe/m4SzEUpCSOryPOkikTa7wcuvhJrbgUJlO8JSgBfuCc0ckHA43Ks= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1334; 7:4PyrYr8bxS9CvPZvzKJr6xKykS+7z7/CtUuTP5aLbx5r4ZYb56eC8XxR4tX26t1KoAxzBT/WeC/3of6FQ+oILOr4EfAOrt9MbVBtlRXrhGpSb5d+GJeDBEbgSDo8OIi4XR6rbK3Q9FYwIl82XEV6nVfrt0mfcfSkxn8Skbt6x1a8Ymuu2hAlxG/vxVbvQM1h88yf4h2cvYeuOa5Oxg/2xJizKJfWx+MBnHw1KYm+HcF1v/03Q/SqAj1Cxd8P5W9+; 20:/DVZY/JiXs9UDXUH9m4eeNjY6i+df8ETpcewoTCatDOQOYF+6EJBGHE4mTQMwzQii+0SOVZrYM2bvDau9nYwUxm6LPQLQdaFgH6LTrtayNwDx5RErxcw3pWOilHXU8W4UeG4nJTeqp2xY88iAeM4rMnXMS0suqZU7Vg1J1bCJbs= X-MS-Office365-Filtering-Correlation-Id: 0eb7fcc3-8b93-490a-35ea-08d5bfcbfeee X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2018 10:08:40.1270 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0eb7fcc3-8b93-490a-35ea-08d5bfcbfeee X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1334 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);