From patchwork Mon Jul 9 08:38:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10513961 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 7F2E8600CA for ; Mon, 9 Jul 2018 08:39:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67FF228A5A for ; Mon, 9 Jul 2018 08:39:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B5C828A5C; Mon, 9 Jul 2018 08:39:05 +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 C28D028A5A for ; Mon, 9 Jul 2018 08:39:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 63EE06B0296; Mon, 9 Jul 2018 04:39:03 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5C68C6B0298; Mon, 9 Jul 2018 04:39:03 -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 419986B0299; Mon, 9 Jul 2018 04:39:03 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f198.google.com (mail-qk0-f198.google.com [209.85.220.198]) by kanga.kvack.org (Postfix) with ESMTP id 125CA6B0296 for ; Mon, 9 Jul 2018 04:39:03 -0400 (EDT) Received: by mail-qk0-f198.google.com with SMTP id w126-v6so12401469qka.11 for ; Mon, 09 Jul 2018 01:39:03 -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=DMQ/Ih9GdnkRuI8F87WrcF+0VyHz8hJYQX/0MCwyZRQ=; b=M+h9nrl3wVlRGGcac0+qGOr7qowM/82Yn44KcrGdtn8pqOP+xzW5H7AS7igpzxZ7jA fJXCsznQcpedD1Ky6h2IKJTak+xN3M7MhmASc8BEyYoLxJUGfcnEsKt+Vmee8upvK5OY GvpsXkIea1Qj5BREhHDAoafx8BWwskAMD3yo8pnbeYSScIqPr6IPpro3zmteTpKQxiTE TdHsqxhg5/sAWh07Sk+SRSK04rqOO+MO6avEgHqB5wIbUOdpRbD92YR0Bkug+xcLRpjD IOF4ZPNibkQTsB8i0jv0nR/X49Mp5Efr5pr20WC0+LXoaVqapQqMdXqzqR9371ffYGvO 5rWw== X-Gm-Message-State: APt69E087D9tcAhkIvKDhJ5Wu8eNpMsGfInZwWEzXrvEwze5ycc8aYB2 Cnx/JobNIB2Rs43kvzBADCrnkK7jZRJzh6eG/ATQmg/EQ2C0YvaP4WTOG7GV8qIsYQUZ0bqakO1 pLlHKK7Y4R9T+KtTAAn59tNdW+G4etzfSbFDkrFlqmMlMPZfohs3POByFFCU+eQgl7g== X-Received: by 2002:a37:a98e:: with SMTP id s136-v6mr16884126qke.407.1531125542852; Mon, 09 Jul 2018 01:39:02 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcFagDquGU9SxTj4lEbiATRbRZUjkpUICSxGZLA/8lzJ0kAUcdMyazL7sYxwTXYGUqrpMJW X-Received: by 2002:a37:a98e:: with SMTP id s136-v6mr16884100qke.407.1531125542074; Mon, 09 Jul 2018 01:39:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531125542; cv=none; d=google.com; s=arc-20160816; b=CqgtL3/0H5u+3l7hib4OkPxxwwSMYKTnIl7CKQlOTvRSnkz6WmkSw2ZWuQjsiaSnQH lmyFU1kHnidZCJb7LsbC4cPGtpKY5MXg2oE6tp0X1BT29IpIWLOWkIbuQ/YHliFhB39z rQoffSAf3eueRqLpGgTRab3iqy3GIxK75/103Fz/oJ6chC6QcNQuGzU3UQZDhWsu8kx5 qCCodCaI3woJJQnzWIx2Cn8hGgGnq3e72OyBSNDUJMWlUElqFvYexjVfZe169/5SeTjp FJrdp2PYOgg56goixsbLO+EHBsdRsbzoiCh4ZWnurUKhMvPw6FTUwCfB7tOHo3PIs4Gv y3fQ== 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=DMQ/Ih9GdnkRuI8F87WrcF+0VyHz8hJYQX/0MCwyZRQ=; b=HG9g2BWFartvFmlBEGXExZO90q3cASgMzEOEjKyM+HoO5PQ3BQ01/fGTuMi1MU0no9 WSZtwrG+h6JY7f6qybTbkJwViAbdYJ6dngd4899dYWsHDYT7xYs7mhgJ8uXgWYL9uq6y RkD5a/qa2HeF3nwdQYPLJ9x9l7Zphm9mH2WuB8EqiY9+4jVpBa0PMkaaUxvTNJE0UmZP eUnCy5mRE1ey6mR7HZ/uqY6gSWMBrzggt5Qbuy6+v5hlNg+H6BlspTnSmOottUVMRMbT EhLHLjGz/Rt3fAH3X1aCVhBIu/spq9P3S5ykAN5ZMBzal6O4aKPT21WQvmeGcaKaswTW 7Rlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=BAIXwSm3; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.7.111 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70111.outbound.protection.outlook.com. [40.107.7.111]) by mx.google.com with ESMTPS id v62-v6si749403qkh.168.2018.07.09.01.39.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Jul 2018 01:39:02 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.7.111 as permitted sender) client-ip=40.107.7.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=BAIXwSm3; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.7.111 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=DMQ/Ih9GdnkRuI8F87WrcF+0VyHz8hJYQX/0MCwyZRQ=; b=BAIXwSm3z727OAWlWMjvpwNNNStWBcW/WlesUM4/XFDFt6JNwo+6+N8rajaFY0UfGLvIyqYdBMu2DaGQYZEh54IRajFtutRFSDnTctzVU+oJE04mu2DQIxWXQVFRKZGr+pw/+0w2zYab3j4ttdjeIOmqbAtojFK3z4XGrQ74oJU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (185.231.240.5) by VI1PR0801MB1344.eurprd08.prod.outlook.com (2603:10a6:800:3b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.21; Mon, 9 Jul 2018 08:38:56 +0000 Subject: [PATCH v9 09/17] list_lru: Add memcg argument to list_lru_from_kmem() 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:53 +0300 Message-ID: <153112553378.4097.3204989884654871988.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: AM4PR0101CA0048.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::16) To VI1PR0801MB1344.eurprd08.prod.outlook.com (2603:10a6:800:3b::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c5fe88ae-6af2-4938-64a4-08d5e57769b7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:VI1PR0801MB1344; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1344; 3:9I8EXdIwStVuzlVoHFiNeqmVT1olGYd3/w8rZS6/wQOh8Dw4gGXHpzJkFnx6e3LSm7sjOqwh203/6YVYGgWpPeStBbHM6Yuvt3oEHwbkyYSAOzUBaMJD1RhHM+Crq9g3rg1bodkF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kdl13FLzNhQI1xNMFgJNxe6P5gl3U1pyy3sPy7sEidRqPb8zC0jmx04ue1w1YdJscoojgV86gAXmDf3ZSbgATlwYzKl3vio1VPU7wSavqHb6BFpDyxiUKs9EFdROckM6RgGgsZeYbBpEDDDTL1JeXhCVzxRt57Dq4mqU+m8BIeYPY5S+7TjGvTQ36GX8IrJV6lR1OcHVtd07KwnAfOcuFlETO; 4:PnwGjOGX8i6dKGPPYJgYUEJpiMPWxGgIqN5EwxDkszB35lUhKMb5W9TSuuj9K5FKcpmpWD7urXP5dJdfxP80ixvSVe+vux4pS5ju//4F4XQYoHrdhSq70WeuKuw8mYs12KpEuNkvSBCQ5nj4oO0ArEzAwUcpMETTZTSePwf7qEOohJ+0Ngz6lpMskT0IV3jWCJk6zYKEvmqIt9MnqJoUekzJm3qEAPTtd2HbOZXW32wIFVCUo1VP6wARnUjxe4BWPPlEoKr9SHnNzWdsGgpsW30B29J1Hd67+z1njyWf6D2N1gT3Q9WzafHE+5QUjCD9Uieb7l+/Tppxmt/bjbcaTXMHFXiG4wFPPR981Bol9Gs+MUmc6Q5QSHZ9oIkCIOAM 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)(8121501046)(5005006)(3231311)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:VI1PR0801MB1344; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0801MB1344; X-Forefront-PRVS: 07283408BE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(396003)(366004)(136003)(346002)(376002)(39850400004)(189003)(199004)(2486003)(7416002)(5660300001)(52116002)(7696005)(106356001)(105586002)(7736002)(305945005)(2906002)(23676004)(68736007)(25786009)(86362001)(14444005)(58126008)(16526019)(186003)(97736004)(53936002)(6666003)(486006)(50466002)(39060400002)(386003)(6506007)(476003)(61506002)(26005)(11346002)(76176011)(956004)(33896004)(446003)(47776003)(66066001)(316002)(103116003)(9686003)(55016002)(230700001)(8936002)(81166006)(8676002)(81156014)(478600001)(3846002)(6116002)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0801MB1344; 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?MTtWSTFQUjA4MDFNQjEzNDQ7MjM6Vlo5Syt3UjZYeXh4K3VrNnZ3VlZIRThs?= =?utf-8?B?ZWdZb21ncmgyUUJrT0xqSENuUGNTb0R6RlIyOUZ5eHhST3R4SXk3YkJPMkQ2?= =?utf-8?B?UWJxTno5eDJSdm1oRStuMTIzcWQwMjR2Qm40MDBocjBNaTkyRk1vOHFDWG1V?= =?utf-8?B?dlRLSFh2cDY4NWsycUUwN0xpbUo3dTd5Q3lXU0dqTzJXQm9EcmM5RkFEaWNY?= =?utf-8?B?ckwwZjlOODV0NE9FTWpvazRMYVBJSk1GeXg1QUx0YjJYWDBWUlJBU3hkQkt2?= =?utf-8?B?dldsOU9USDIzcExMMDg5NjZ2ZTFWSmRlbWo3OXBlN2o4UG1yQ0w4L0pUTDVV?= =?utf-8?B?TzRiaUh2SndJSEh0bzZyWjBhQWExS2tHWGFpSEdGNHRBZGtnOW5GWVZHNk1M?= =?utf-8?B?dkluaERHQkU2V3A2REpSNHdqZDg3b0VEN3V2ZHYzcHdRUytNd0JpL1NrcWZR?= =?utf-8?B?bG1oU3Ridk1rREpJaFBxY2FqRHhuNmE1aFNWMmcxL2wxNGZJaVFkM2VWZ3ZR?= =?utf-8?B?NUJlanBhVFZlZVk2N0I0MXNJZ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HGhjDjU3Ukv26jkAs7pib43+0b0I2om8mkRhInxDeEPzVaWT2mKtzLVsmmb5vDJwmPFg2iKdpfy8hFyze99KuwEpetW7Ofu09LQDBmHjcaEmv90mTzYc5sEBdbNZv+Z+psCDZx5SvPAubIRCepNkmlro/RzsK2yovg/C6cW1x6kJ+BEKKxTvSyDDpTqmdsltf7iaAAPORtwjnEtJDc84PFuSbBmLkmHtVfJQ==; 5:8XXhHMj4Iza54UUs8qlaF40B1VEzqHXmqo6+rqJvx8WdOI2QVIC0rpYN6MTFTHc4M4BCJbCbQf10OV09tb0UPIpV/vtuqhL7vxpX100Zk2t/YBeEwbdWJWqZIh6JzQbH7RVKfeOS5ulCpj2FsI2hWCjALaROC6zu8ymDR/rWJE4=; 24:GHboIUh8/tuRnws4itqG6Vc5471lnekyeAVCi55sFIx0rYUxuZyRK0pwv+Cv6dJB+ozTGdLCx/blHsV707LbaSrwThqVXaT4Ao7RCKlV8Qc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1344; 7:8C3jc+WATIGgP4iazyMUHH8mXysHcXXVWy4PdkW1fKYfZYX507F2VHbCdnfmYVDxpJyKsrIKi3PcqQww5/hS5OCGZmvr5D8MeHVWV0p1n7VPJ6WcU7UhWZwiHYLRJFDq/yHn+7kSYUw18E7EeWjFSJpzlOGp0ww53QEiE2xaDcDHkLtLPTqoQBfrzIfNqeGQNUaJ9VykUsgaLfbHuPX6bPvaExiWHhOjm/LPjM+ecZRh0Rx4Ke9CrBQRS7m01A+d; 20:no7FJjf18ycW/a45ExZeXYRalJfdW68ASCMr2WpA1nSUGtIun4ziIAHWWlt9CbKsk5ejemC2vImuk1f14q/tP4/e4EGAqMgx8cxfy2i10gsLwNuFQBWNP7eRQVT6fpC5+tSyZgfVEZgHWqpOzDqN9pgwPcRo6ypjSN+EoBCDjhs= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2018 08:38:56.0542 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c5fe88ae-6af2-4938-64a4-08d5e57769b7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1344 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 Acked-by: Vladimir Davydov Tested-by: Shakeel Butt --- 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 5aebbb9b2f5b..1fc5be746e69 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -65,18 +65,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) @@ -99,8 +105,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 */ @@ -113,7 +122,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++; @@ -133,7 +142,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--;