From patchwork Wed May 9 11:57:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10389271 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 096D260236 for ; Wed, 9 May 2018 11:58:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB36E28824 for ; Wed, 9 May 2018 11:58:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DEE822894A; Wed, 9 May 2018 11:58:12 +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 1D55428824 for ; Wed, 9 May 2018 11:58:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E4B806B04FB; Wed, 9 May 2018 07:58:10 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DFA0F6B04FC; Wed, 9 May 2018 07:58:10 -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 C9C8D6B04FD; Wed, 9 May 2018 07:58:10 -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 81E696B04FB for ; Wed, 9 May 2018 07:58:10 -0400 (EDT) Received: by mail-pl0-f71.google.com with SMTP id ay8-v6so3643400plb.9 for ; Wed, 09 May 2018 04:58:10 -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=TtLpdzodt4Axq3H+Vm1SDOprH0akPoNa42kKtMwjpL4=; b=p7QUC9SAmPoyf7sxX7Wiwu08593MAQt70uw4S0kuNYNk5FAJEV5oWskBRxS+q4wSmZ 0BqsE562im6CRZBlQKX3+K09iYpmM7arWF7Ah9fy0Ertxtwfa9yBMcyTtZsMLMovTh8s GTgLb4EjDMBHvNQgnOn8ht039ev4mRlMne579jVJ4I0xY0+Aj5TP6o0vZGOsDXQOmSYL vn7ay8o9gCzf+u6xLf0+VuK+UmUPEgq0HF+WpSiX8/RlPAhdEnzkCfjH6BDofMs+v8sG Y3zjpZgImo9b0m/uD410GEnCn1wgaU6baVBN2V3JICPpjrJOnbIThbHvs+I+WxJvLwc8 m0Jw== X-Gm-Message-State: ALKqPwfED6cNUtQf/pFpuLFyCErMWTiLowGqnmwgKjyacDAp/jGXWhbr Np+AtZh9/+BEUNClD6QqcAb2Uww//1+fU6rHltl4TC7Rs4XHWNMGsPLEbG+q6E2+86u39rN7okG KEjh80kHpP5Cy0BeQHCcq+pwwGKfO38w0pFNLEfg0f9M6FD1HcqsTYZXbSp603p5rYw== X-Received: by 2002:a63:824a:: with SMTP id w71-v6mr4682419pgd.37.1525867090211; Wed, 09 May 2018 04:58:10 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr/RiQXrLt5ZrFL6xrjsRcYNawVIrUAuI33OUIC/3C6gYj7x/SrdZAEeqXX5LJhKDRn9ypv X-Received: by 2002:a63:824a:: with SMTP id w71-v6mr4682396pgd.37.1525867089510; Wed, 09 May 2018 04:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525867089; cv=none; d=google.com; s=arc-20160816; b=TxfYKnimDVaXMfPZNLTzQi9k41JgMu2yEA16MI5PuArqtZ6C3/Zcw/hc0nQ23mYvzU r9bP0Sa+N8ix61n4TT635f9tS30HUq/55OsOOY19L1Bj94Cs+oWUHQuhdCHI1tlSTFsg p0ZqCny3eOea5FNsrgxTbSpR/GJSI7LE6QhAKukN/J1YTltD+l4aH0a3C2yAqu0LTwLJ h50IZJ7SB9L5GmxeLBxckoA+trGaLh2xvt9wgSV0dJaPdMmaJauEpQFscKFIQ2df7/IT NLw6V0TcWg8hGFkMPhvYbBfiS3ZAspB351HlmFuGh8d9BKPPKd7uZ7NvfyLJ19PhMVpF mEMQ== 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=TtLpdzodt4Axq3H+Vm1SDOprH0akPoNa42kKtMwjpL4=; b=EzQDcUDWH7DYF9wQqdet+fY5Vu4KNSY+nFa1189b6+igZcjb8ZoEk/lL79LEijs2yT KES6pVC059kuZuJw4lIKnRF3fxu2hdFUKeV2KIdCnVpdTCian3M8yD/kcDZIkeYII6WB 0Q1osnVSJmpCV5VHQVPY+XXUInWndYviedIQoaNNNCQK3koJ+jaoVA+1AtR1h4yJAZbm /HuLrFn3iuMF17J2kN3OQlEyu0KT/XJA7w0yD9WxO3b4dKuFA9Mksla1r8ekjUS6KH0u H/8qhHnWLVz9A5yTXwHBxZ4+QLD1yyC1kTpZS+PtIkI2sTyAHvmpjCN4o2KkWQ/LeVav /nWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=OLVU6TLe; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.4.90 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40090.outbound.protection.outlook.com. [40.107.4.90]) by mx.google.com with ESMTPS id m14-v6si3073385pgs.178.2018.05.09.04.58.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 May 2018 04:58:09 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.4.90 as permitted sender) client-ip=40.107.4.90; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=OLVU6TLe; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.4.90 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=TtLpdzodt4Axq3H+Vm1SDOprH0akPoNa42kKtMwjpL4=; b=OLVU6TLeuJISYw+HT1i8Yko/cygjJWy7bWTItHMgpTUEZrKp0tHWNQX3Qz/0b/wzeTZ++ykTChBV8zSlyA5BNEl1cpnZy3I2iI2oDHx7WcnFe91Fb/c+b6V/mS0eVA5jOxqn9q38KgrXSkdTrhYZpRrw3O6JcQSUWRQCp2NUqVo= 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.735.18; Wed, 9 May 2018 11:58:01 +0000 Subject: [PATCH v4 07/13] list_lru: Add memcg argument to list_lru_from_kmem() 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:57:59 +0300 Message-ID: <152586707901.3048.10773401016856276682.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: HE1PR1001CA0022.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:3:f7::32) 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:BM5L/U24onXjSKmiJosivXzi9I22vrRQKD+O74Fx7l7cE91fD/r6pCBqQsLOeDcysVZHE3lzy31yXGXLKRHxBLbN8nuomw5UVoskWGbNbBsjavZYIW/q8FrbZQnZC+ci9dpg+CrPFfNIGvKEn4bBfUCRaBr28xIIfhPxQdrdWFoHm6iPiZqv96o0upW1fnXVhs5BBT/B93sDCcegKlhZ4u9RsNQeYuWxbUVU3T6A0Qhwo7pRpx37ExywnuLVmYdT; 25:D/j8bKHvj5YOtQV0WENllNuG3A7/pbfB5FIVG00GCMiOXlIXbyX51YQf1FhAQfWvwiFSX1uCAtKjFx9D8HrQZ0Yu2p7wbz65nq0W/5TNB3BgaQGdq5Px6QPMIOEETuKo0sDbTmYP4YZoKLpoFT3f7i0qfM1JAYJkti43x+nsn7sNvOgdM4Gv4PgEH+0iEXuVkObERjt+Za5UULZY06osmt22UXW5Z1M2f4HzGez3Mj4F63/4bXDAWl2V2gcUt+XL3LyxN2Leu11V2TcUt2x0r3CPhiFKMqF+2/SJNrPfxEcnSLwMgZSYrc8uXRA3SrVdGsi/kwtznxln/6f4kLT+bA==; 31:L96hNILZDWcfNaewr8JD1qwuNzHeN1VcX6wj3hagEkHmheHOc52oH3quR8ARzMQP1FLhsLpWpiAx2fALbdVg9hko1tfe1QDK/zYSj0BgjS5jlRJieJmI5KLOrOHXaJaYeeWHLNqcZ73Vt/VWoP+IrN77wws1pWzbiOzA0R/FdzfVdCpPW9+5tkGzQffoxFvh+R3sNhI06k0e2vhfytEX6dJFSfpD5joVol3pjXChmaM= X-MS-TrafficTypeDiagnostic: HE1PR0801MB1339: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1339; 20:VoULpIKR5uNZIUUbnJuu/8fKloLy9k/ntC2ePjL4uyVyYPbuQMwjD46OmVHBhe68XuHJ7IRevzVrO19cwpGt/3Vd8rT2nlqtjS0ObxeezIm1caihj83cjDqF5DdPdCxZ3mOlBjBqOOs479mLeX7Pb7dCsO7FsMqGSfqm5IDFC78fBMi6bNuiyQeNE7BMH4vczfQzdq7T0vxOgzHgiLbJaI6uORNTSjlKoibOsD6FPQw9cK6os+e8we2cwKwuQm2ijkCXi0U5FBf2SLUlg+Hy8iGzRahH4Hop2oaUImo0LPuDY1bfXFV2tRotgz16zHTw06+9UBs1xw0c4G3fk0KFdoWM4101kaQ+aizucYliQbSzSTChPE54LhMh02IF00scHJ32kG1VNjdPopyJ7Bi3Y4yPGAS04olTB6WN48/yrOWZH7l1Z0Ez+6EylmW+XfudRNBj7KSbttLjmpWIrTM7D+wdYHwfJEu1IEx6nBPK1Tw6YoA3JQ4KjAEopy7wqGht; 4:ZJLzthk3cN3c3Ua091HT4u1p47mhEqfXcj5hRRcj4rl/MeawMsMDuvElN+NFeMQXy7F55aCUI4tExjoGA1B0JpgDzSTZJhve3CrE9xLoQKcLXpLS7sYtUoYR0EI25vZuxkYr4GZrSMPLV3VllboOpwQZ4DWizUqRBIoyPSRGNsCn70xLAE8wyy+oRqQRax6SE0tJz7Cqgba/eh6qEObwABLHCNcPomzmI5zzN1kaocw4dO6lyA2YWh7x+eedar3A09BRYTAqeHL/Qw3fShOGHw== 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)(93006095)(93001095)(10201501046)(3002001)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:HE1PR0801MB1339; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0801MB1339; X-Forefront-PRVS: 0667289FF8 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(39380400002)(376002)(39850400004)(366004)(346002)(396003)(189003)(199004)(230700001)(316002)(386003)(3846002)(59450400001)(6116002)(7416002)(2906002)(47776003)(33896004)(6636002)(305945005)(58126008)(106356001)(5660300001)(26005)(103116003)(55236004)(50466002)(6506007)(97736004)(76176011)(55016002)(53936002)(16526019)(68736007)(956004)(86362001)(186003)(7696005)(8676002)(478600001)(446003)(8936002)(81156014)(476003)(9686003)(39060400002)(25786009)(486006)(52116002)(23676004)(105586002)(61506002)(81166006)(2486003)(7736002)(66066001)(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?MTtIRTFQUjA4MDFNQjEzMzk7MjM6Q1dtT0M0Tnlna0kzckpWWVdWRktXRkdZ?= =?utf-8?B?clR3TVlTb1JZZkJHUkpieFBvOEFMVGVzd05mcjZFeW1sS2ZkREdCb2Z5dzls?= =?utf-8?B?N3VrdWIvWkUrUjFaTkpSMnBJdHE2VmxkVUJVU1ZmTmtVelpKekl2NUFBYjMw?= =?utf-8?B?dUJBekwyTEpDOXNwMVg1ekJobTk4L0Zvb3RMZjNMbEdEV1VXekFJaWRxME1s?= =?utf-8?B?aGN1WHY5WFZ1RWJNRmY5dnlTeUd2aEhLWVU5NnA2RlZZR3RBZlpIVkJ5M2o5?= =?utf-8?B?SGlMWHJTQTlQMmJzQThWalZYWVVSODI0TnFsdVhubnBJK2tGWEs2ZzAzbi8v?= =?utf-8?B?WVQ5M0tqSDZ3MTUxc0w4NFZmN2ozUzdhbHRHQnhvWXVmZ2pnV0o5NTg0MFlv?= =?utf-8?B?UVBtUk8vOFEzZ3BxeXhKUStiRW9UN3NZbm12UVhtK3FTSFpxYWh1dUwzK3Zr?= =?utf-8?B?ZTZ2VTU4KzNOWjN3c3VjWGRQZ0grdFQyenZ0aXFGeTg2WGhRRkVsWmVZZ09u?= =?utf-8?B?ZzlJdGg0b2ZNUDFtYytpanFjWDNmRnd3T0xFNlhYWUJpK2lCYlhXcHN6ZXJh?= =?utf-8?B?T2ZBZUd4ZzBVS3I1bWp2WGh0anNqTVZFQ2VJaU1HQzY2a01RT0hBWHVpVmp5?= =?utf-8?B?ZWtvTURRaU10ODZjS3BTRHdtZFZtUzE3MWhRTXIyMTZEZDQrZWNjSUVjaUp6?= =?utf-8?B?dnJ3RklZd2gxU2VIaFE1MnIwRzlTNGZIb0lZUlVaNnpvdXpXNEU0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+Da+Xd5H8rKdkB10k7/08p+CGXvwL3a1U=; 24:XeDQxRzuPxgFhNwOUG+4MvWKnwUuOcQPuswVjU/q0S+zQvLV0m5CV1U66wAQmrutW0yELDEWgtsud7kJYWRjuA67dLOsJbQIqUCF0MsA2Qg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1339; 7:pMXtRs12oXYvK3TwozTpS7BiBMUmHvoYY7k0BYwFmAasWVh7+cNpPY94OMXO5m2/UC9BCNHc9RVHfNYT190s8CSm0rXmlISo17K9k2/PSPlBd8bOTSzYZ131LFiqk8Y5AdjF2/jPss6QCbWjReyBj6HhFVjR0Fos3XWpw8RpVFcEWmioKyRJwCiPPmM1bhjDthZReTztGTK3DnHOLLIvnXLAtBs/GM8/gnsaP+VXm6/71yADQPIacfOIwOW3XGKI; 20:/aWxJFH/EgF9Q8B5T9Oz/BdggOjK07AsIO/l+VL+bL1O/L6zin6YSlU7V7+PZ8Nelp3W643ieMGwlnzwSE0rUP/SpW7r7hAtiWLisj6edzDIRr0gfQG21tf97zsd88oPjHmsGpNQNf3LTiztOwesBnBUf476ZFO86+2fcNrrnXU= X-MS-Office365-Filtering-Correlation-Id: 2ff74eb7-a2aa-4b68-e2a3-08d5b5a41e1c X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2018 11:58:01.8985 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ff74eb7-a2aa-4b68-e2a3-08d5b5a41e1c 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 This is just refactoring to allow next patches to have memcg pointer in list_lru_from_kmem(). Signed-off-by: Kirill Tkhai --- mm/list_lru.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/mm/list_lru.c b/mm/list_lru.c index 2a4d29491947..437f854eac44 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -76,18 +76,24 @@ static __always_inline struct mem_cgroup *mem_cgroup_from_kmem(void *ptr) } static inline struct list_lru_one * -list_lru_from_kmem(struct list_lru_node *nlru, void *ptr) +list_lru_from_kmem(struct list_lru_node *nlru, void *ptr, + struct mem_cgroup **memcg_ptr) { - struct mem_cgroup *memcg; + struct list_lru_one *l = &nlru->lru; + struct mem_cgroup *memcg = NULL; if (!nlru->memcg_lrus) - return &nlru->lru; + goto out; memcg = mem_cgroup_from_kmem(ptr); if (!memcg) - return &nlru->lru; + goto out; - return list_lru_from_memcg_idx(nlru, memcg_cache_id(memcg)); + l = list_lru_from_memcg_idx(nlru, memcg_cache_id(memcg)); +out: + if (memcg_ptr) + *memcg_ptr = memcg; + return l; } #else static inline bool list_lru_memcg_aware(struct list_lru *lru) @@ -102,8 +108,11 @@ list_lru_from_memcg_idx(struct list_lru_node *nlru, int idx) } static inline struct list_lru_one * -list_lru_from_kmem(struct list_lru_node *nlru, void *ptr) +list_lru_from_kmem(struct list_lru_node *nlru, void *ptr, + struct mem_cgroup **memcg_ptr) { + if (memcg_ptr) + *memcg_ptr = NULL; return &nlru->lru; } #endif /* CONFIG_MEMCG && !CONFIG_SLOB */ @@ -116,7 +125,7 @@ bool list_lru_add(struct list_lru *lru, struct list_head *item) spin_lock(&nlru->lock); if (list_empty(item)) { - l = list_lru_from_kmem(nlru, item); + l = list_lru_from_kmem(nlru, item, NULL); list_add_tail(item, &l->list); l->nr_items++; nlru->nr_items++; @@ -142,7 +151,7 @@ bool list_lru_del(struct list_lru *lru, struct list_head *item) spin_lock(&nlru->lock); if (!list_empty(item)) { - l = list_lru_from_kmem(nlru, item); + l = list_lru_from_kmem(nlru, item, NULL); list_del_init(item); l->nr_items--; nlru->nr_items--;