From patchwork Tue May 22 10:08:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10417863 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 8C2E86053B for ; Tue, 22 May 2018 10:09:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77AF728A49 for ; Tue, 22 May 2018 10:09:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C30F28BA8; Tue, 22 May 2018 10:09:00 +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 DF0E128A49 for ; Tue, 22 May 2018 10:08:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C1CCF6B026E; Tue, 22 May 2018 06:08:58 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BCD006B026F; Tue, 22 May 2018 06:08:58 -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 A94CE6B0270; Tue, 22 May 2018 06:08:58 -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 62F296B026E for ; Tue, 22 May 2018 06:08:58 -0400 (EDT) Received: by mail-pl0-f69.google.com with SMTP id i1-v6so11814405pld.11 for ; Tue, 22 May 2018 03:08:58 -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=LFfDQx5J1CVLSSXFNH+S3h8jGjR6DUma2O/abeRlgEs=; b=Vls3rIKppvhHB4Ov0YR9wpxxc5NKC263GiuhEFkLGR66Xz0WVN6S4VP0eFCpZ09IXf acZ4WNiiqsXFsNPWfqzt4zVkHWlh8q1c9A9qkYN7VeUfu2ohGxfKgYEo7iO3AmF8oYbB 6nnHeSCKa8oQsPEx7y7ySY8R6gB2upL18al0k599MuzslKbuHYDl1KMfvu2rWY+MauMo 0qOJDP9194CTZrKwALw5DtJn/3Ee3MFM5+cUs+Dt5THlZkrw8LX35+ZAsMwWhxjlvO13 ln4V1tHHyF9CtrXePdWL6nbIWDtMja/f9zQD8fmnLwY4YDYZcZZ18IuMNPfpCQS9h2Yc wK0Q== X-Gm-Message-State: ALKqPwcAC6o3rpEZd14rkSwAtuTgkdTtqKYf5VfhUM1i1uXzNn+VAjpE ch1D/uGjDhYazkM/eEW7UWLWiuhcT4oY5S075JafmTFI1nzvV2xb07H07SiTPnQMRFJ+j+54w7+ yvvlLPy/gwX4ASKjxUykX+VB7Bn6I0q0WB90bjkfp4NPooAsFQY2/EWMkfuiicy+ZxA== X-Received: by 2002:a17:902:6e4:: with SMTP id 91-v6mr23961786plh.63.1526983738103; Tue, 22 May 2018 03:08:58 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqzzJx5lpob29vuW1utBAX7K3BydqhfkexkWGno+D9Ba294gattxjJ0aEEfY457qsMLX9gL X-Received: by 2002:a17:902:6e4:: with SMTP id 91-v6mr23961744plh.63.1526983737479; Tue, 22 May 2018 03:08:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526983737; cv=none; d=google.com; s=arc-20160816; b=SQz7Cf1d3QdvSvx/UXoaLIxqiO728n+rrCsoXw6PsgF5DO6wS6K6ylIOpP0O+vQS8a qq3IuQmcV6z4+ovY78nO2J3TIZJmEGLUjS+qgcLrN4yxVzab3tNA9JtPA+iH94tJum09 Rqh79AiEFRECsHXVKRtnSaD/atpJStdmDcK6JPHvY8StE5zlJlJSqVFCvmhXtVWWmk/I sxs2FOucYYWbWW4Kz5lPps1hG1rBNUxVhCJioag0rV/DevLjqx319lG8d4cCPD4/ymbt Zg9lu25mkLpf7uejD7ZImtsI7+QDCvkVv4Jq9arw+r+AXeozrAdVwoUK7P9oH4Wlhggt O0SA== 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=LFfDQx5J1CVLSSXFNH+S3h8jGjR6DUma2O/abeRlgEs=; b=IzSAfUqcZxEz8d9FdgujFXD3d3d04THtDkbMuaDXGvMyUqa+B/T7AKxt/msmMRLgCp nAt4rit/uf2nQqTY3Oqx/dJdpGdTi8ypnwy9eBfGkS/lKu6iUpen7VY5WbMT5aDC2ZyT B8ECEo4APwFUBBzMGQ20NHOmK+/snjcnnRqHP95047Nvtoi45GscDt2Xm4mMn6V1iAPS 1E1f4Biad8+cKgnG4OHlNGCN/XmWBC/RobRUU395VHsjv3lHrTXCbVk8hOd/eBuzDqvG BaIiRv8lWcaQbXvwc+i9vtZGIDOuSBFWdz/DtzhhJwmJaumoHaZ1vv1CxHRHsSzoicjS ws+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=clmrJtPT; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.132 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-ve1eur01on0132.outbound.protection.outlook.com. [104.47.1.132]) by mx.google.com with ESMTPS id e4-v6si15742112pln.331.2018.05.22.03.08.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 22 May 2018 03:08:57 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.132 as permitted sender) client-ip=104.47.1.132; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=clmrJtPT; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.1.132 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=LFfDQx5J1CVLSSXFNH+S3h8jGjR6DUma2O/abeRlgEs=; b=clmrJtPT/zzyQzBkTC9W43qD29q6cOM7pX7sGK14SZAwbS3LvK3GjHhfwwQpULnaJ59/whuQZ88XsaZ6Wo2Nc0ATd5yXrwDZtaQF435xJHtmf1OfjqzB1AHh/3pNNvHiZt5ZhfaW21pE/CK4IE07Qxl4dxew7XLUERazeBKwQAY= 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; Tue, 22 May 2018 10:08:49 +0000 Subject: [PATCH v7 09/17] 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: Tue, 22 May 2018 13:08:47 +0300 Message-ID: <152698372740.3393.9918100159995644893.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: AM6P193CA0029.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:3e::42) 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:mkuY6IDPdrEOTqBmrwy/Mb/fXKhPZXi69EauDgGZSGoA/wYMJh1eQpl7jXUiJ8+iMzdnIMaG1mUHXDhg0djeoK2WRjXH9iCKjvDnF8xJ4XfNbxNac+dE1s2TMW+zqJHjnWxJcpwS1YTxMTurWD6JKanaMoiN96+eEqzvtOsEoU6aAt8kaDLyGIUgquWom/tI37m/MF3AFBVd/VPfI7lCBa/dKUBWSqrGLf6995sNCi7pfJTkz8O3kZEf6G5DbpkV; 25:BImExLMuymE6xgkQ0Iz1GWyUCtrRl4BnbWeKgu2T0A2nTxUeSVgyP9EVXtqhxpjPu/E2evQvDIMUbxG9lmtZ+1s6YBS+NT3CmdphfDdrHLPyAbz8Zw1iCpXsJMW1H3pU9TnfS2X9AkBmvimFXdJrggWv+m6S1x0wU4M8R0U3+XZ3cB1yVY8m+nDT0Pe9V07FOQZzV+pD9EF0IVRnr4dC+50JBB3xGsRdVU4TMdaXKZZ06HAVhVi2xZThoRvNCRPOI7QjO+BvVhsqPpzJ1bVBU8IRvrUCD9XYLh+qzO38nOgARX9nEIwUjiNngf5Zt4/kPBTrXtkxZ5v9oSDNH867bg==; 31:2NytQyyO0PkbFNrRStandaztBPkH6BwZMTArDUJMamnHaF6mzJDEIs2ad19M8Vwt/hfmbfKid+MmADY9rHzH+NguvF0l2IKeZFh7gpX42WYTa98Gl8+2AycuA2gQJyHH1FcDZiU3yM8/rDLf46yW0JofdeACsgpIx/+SQViwEfRlGVZDnwu5ENZ3N0SbtXjuFJQ5nLG8E+eWESyZAwbRaKQvrL3Q+XZQxih/DPDrerc= X-MS-TrafficTypeDiagnostic: HE1PR0801MB1339: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1339; 20:R1arVWfOGs5bY8UE2nmkG0iqmKPGzn5+APnnrrmNL3BTJohF9uJAlEHr0ZancGbwPpl7JWoVIwtjPK81rs9oh3XUfeAoscEnjGzmiP9XnRSLsgIbSnPZS8sdsnBXtvMYMJw1aayO9Ngk0YZdiEwn2tALVshPTd7QxY0Y97Nvz0uc/XycwoA2ctkSN1sg6jq/RuMzKBiaDYLy+zvXVR6n/HqtJaDvYamvlqO67PYeQuFRNPWqkVjAP7woQ/EyGOfd0d7B+OfgtHgW5PJid/zBDpYjmY7gLmSkCZa5uau7Ep7i3UyjjEwRngvOZ1GWakK4HajuTirmpIfBz2G+QWyzqtD7hADNFkjbTk7us1gxbVS6XuLaa8gCU14wEBwMYAXw803M52ZMvm5kCJerLOexZf4EbYllN9XInx9VbRjxT5+epE440+5mIsCdjzL3wHoJruf1y15wwmSTDakKvMOowUChO22EJsFSjFRkiYLqG8nrA5niWJ6CzSVdU3teA6Y6; 4:/SSvfkQSMzzZn0vID6VqMNHk41Yxa86CY6WFgj/dtt4WDCj09KYp32K6empHbNRjiATQ5SsO7INEb1m5k01SR0LnMWrTFhFjGvM6EFpesGukCfvBaC+ySPxQ7DX1s9Xgg8+EkKkZ4N6TetBjKRjyMMZlqu5rkJzzQSeSmtTF5q4Wk4LUhr69Q+RKLg3jQFZ5iBej7VuVuDgI2IIfjMV7rO4DC230XAgq8tefTFCwr4IWbR18srwT04ui9Ik5WTx44dTtmG97GM0v1APkDuwN9w== 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)(3002001)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:HE1PR0801MB1339; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0801MB1339; X-Forefront-PRVS: 0680FADD48 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(39380400002)(366004)(346002)(376002)(39850400004)(396003)(189003)(199004)(7736002)(25786009)(2486003)(6116002)(6506007)(386003)(16526019)(3846002)(8936002)(186003)(61506002)(7696005)(106356001)(47776003)(486006)(39060400002)(446003)(476003)(23676004)(11346002)(86362001)(956004)(52116002)(68736007)(97736004)(478600001)(316002)(8676002)(9686003)(55016002)(103116003)(50466002)(5660300001)(81156014)(59450400001)(2906002)(66066001)(76176011)(55236004)(6636002)(105586002)(26005)(53936002)(58126008)(33896004)(81166006)(230700001)(7416002)(305945005)(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?MTtIRTFQUjA4MDFNQjEzMzk7MjM6MUhGZDRxN29XeTdCYWVJZW1ta09EWmth?= =?utf-8?B?ZnhCOHI0QW1DTEVGMkVBdzBiZk5RTHhaeWxXck56dnRFZzBKVSszM25keFkz?= =?utf-8?B?N3JWTGIvYWNFOXJWQnJ0Z0lNWjYwS3Nha0xLdjNzU3lOaVB3Z1pjYUxNRkxk?= =?utf-8?B?NmNmRUc1NVlLS2tlQ3JaMGdwR1hJWThTa3RlL2ZJT3c2OHh5Q3lUVzROOXdt?= =?utf-8?B?b3pWMVN3Yzd2N0ZWdlc0bWl6QmZlbnV3MEZBR2JVNWRCTDFWaWJXc3FaZHhB?= =?utf-8?B?Sng5UWd4ejhHU3JnbTVHS0ZvdndYVmdIMHRxSzVCMTA5ajVQVjlHcWhwNUU2?= =?utf-8?B?UXZVUG52bDlYTkpHamZXQ0grYjhUakkvY0ROT0FsMHpRRGkxa1ZLcmVKTUsx?= =?utf-8?B?MU95M2lqQzZlS3JjL1pvRnBxakI2OWhIZVUzYlNVbjVvYmJJanE5WklobjdJ?= =?utf-8?B?R0pmd2NhcDcwRkxYM0hzSkdjdndEbjh2U0RWd0FlaWJDQWR2MjFKQ1F4OUxo?= =?utf-8?B?akFONWlNT3oxTWFFaUx6RVZnV3AraENQMHhQaGJCaFRub1hJS3NFQTlVajVi?= =?utf-8?B?NXNJQ1BtQjhFa0g0NTIydmZPMkNnN0svS0NEaERHeGwySzdoNnRLQzNzNHZ2?= =?utf-8?B?RkxiUFVjajgyUUp0WG1VVkF2Y1NsalJQdWJEOU1BWWlST2gvMWM0MGJKbWZr?= =?utf-8?B?VHQzeGg1TmVSalZQVy91dXU0YkxUQVR5aFlu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DiolqRrsEgbigE6R/lbxps1EaZXu5qy0hDWZOnP/IzMDgSm/Fq8v2TyNEE0=; 24:5vgZyJybzZ2wBvjXbtLBgEuYoR7zCiOLiCAh6iZ9FcawaLTzktGohiCOU2oCA5bMTho2U6FM/PLMut7cFumNtpn7/RTwoMq6w6bnG7Qhv3s= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1339; 7:IW1JAg52wcIyeaV2g48v2Ev7YQKXlzdIEn8HtBKx5xIwtZqEHK/lFVxqj6AqCTWVNKZrc7m0cPkeeewLKeqwqYplNKxfURPe5h8q30moiLYAW2dVFGhnB7jEv/w43iXFq6otm/h9/gjQY9JqBLnNXJIK1GdaWkjg5CG9LFYmpZa0pnEsjc3ieyoLpMs2bJNbzz+mL46BnD/wuCfM+RfBtoKEh3008wiemvFqIH9CxNwcncOa3xVrI63ef12zxX5T; 20:JHdzmpoyZyKmjjgikeqhgtImsuACz3DVnpEZi2EBxq9AIRqyJ8sqsZXl68KQ6j6r6Y3vPuuVmxD2BRQzodwb+EXE9AZC8q45ot0IJaCoU0KvQu0cFztY/C4Ap6YO9snSOXY6/2Rfp7/4dxAVoEsoxhmiN82oV3VkzEoTISSrw1Q= X-MS-Office365-Filtering-Correlation-Id: 52929bf0-17c0-47fc-e223-08d5bfcc0549 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2018 10:08:49.9504 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52929bf0-17c0-47fc-e223-08d5bfcc0549 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 dde9ecae7cb5..151fa77eb7c9 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -66,18 +66,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 void list_lru_register(struct list_lru *lru) @@ -100,8 +106,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_KMEM */ @@ -114,7 +123,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++; @@ -140,7 +149,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--;