Received: by 10.192.165.156 with SMTP id m28csp213411imm; Tue, 17 Apr 2018 08:57:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx48hNdrO5qwP6FueN1xrAhJzqJKSOm957cxGqDRayWMCTCKwyMZv09m1R6++ztQoM+OAyGPV X-Received: by 2002:a17:902:274a:: with SMTP id j10-v6mr1281930plg.393.1523980636487; Tue, 17 Apr 2018 08:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523980636; cv=none; d=google.com; s=arc-20160816; b=SbsHATnBOLP6qJkmS3DYAhNhYYVTdncsaW783S7j7Wz1Hp4n0FwKHDBg9KauR0aAz/ mHgiEALC0aDN0SsP6O8y/ZpOYHsmBAS3qE18ad2UrgSg3Qmu3YZPf4PYcD7T9cdvIR8B fe7AbgEWACWpbuHZRiwVGwOHkpQmNpWL1KtMHxiW0k3n1d40QBOu33FqVeVQkR5p+2mt il2Vq4Gryyv9nxsJk3VeVQBvNOSsFXNG/jL+y6+3xhxSICfyEYjVk7pezTzypRTcrNTv 3J9n68GjR62+C5oljRBgy1zKqQ01/4LXoNZYYYsNzzWpRg8Zakuv2WgGpDXk1/OwRhNm BhFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender: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=bA/gXjjNsd7nPVDYc4rIP0J4DH/V38Ir6IDdg8CkDqPEW4rNKX7JJUTrvyw+Wve+BZ AlYeQMyCjJc6WoiQf3f4vgMk/cSgJZUKr9RUB9VhHhKlQzLkIJ21tuTM1KyJnF/CIEY8 VlfNDdQnK1eICmYKHLPWlV1YMunwkiJuRK9V56z0UD0QDF0NVIC2sjnJLvvVqZrnIZ6V MUoGnMjpiksamPkyVHkmMqx+GX9zMKKXq0KmpCdP+Atjr0Lh3HXqXGLxfYNZYM/rOvDC 85fCaXa0FU7djj5kuoEbfWvbzffLWJjY6Ir5aCbifNyZnGF3ZJULDqBZOro5y8nIUG9U sHmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=LIfqdxiU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4-v6si7870387plo.316.2018.04.17.08.57.02; Tue, 17 Apr 2018 08:57:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=LIfqdxiU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753238AbeDQPyR (ORCPT + 99 others); Tue, 17 Apr 2018 11:54:17 -0400 Received: from mail-he1eur01on0094.outbound.protection.outlook.com ([104.47.0.94]:49568 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751187AbeDQPyO (ORCPT ); Tue, 17 Apr 2018 11:54:14 -0400 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=LIfqdxiUrq51Tvxni4eGdBpv4n5fNySa6PwjO+qx1YI209dHNJ4z0boEVHmtrN451X2UQ5AwBADvZ3OahYx95FciwXmeAfT1UgnYRU4w/QaIwXHL74/GYGVSi1KKt2VAS/BnPEBy4z+S/iccaeH+Hi0/Uxfk4Al1EtsLd3vrEXY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (195.214.232.6) by DB6PR0801MB1335.eurprd08.prod.outlook.com (2603:10a6:4:b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.675.11; Tue, 17 Apr 2018 15:54:05 +0000 Subject: [PATCH v2 06/12] 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, hillf.zj@alibaba-inc.com, 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, 17 Apr 2018 21:53:56 +0300 Message-ID: <152399123632.3456.2611169207870543630.stgit@localhost.localdomain> In-Reply-To: <152397794111.3456.1281420602140818725.stgit@localhost.localdomain> References: <152397794111.3456.1281420602140818725.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR0902CA0053.eurprd09.prod.outlook.com (2603:10a6:7:15::42) To DB6PR0801MB1335.eurprd08.prod.outlook.com (2603:10a6:4:b::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:DB6PR0801MB1335; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0801MB1335;3:Yb+zxKtFwkXOZyLiVaQUcJDLaPss56ar+H+JEamVwREnnxCD/567DJERG0icnFsj0J2Fx0UV4Cq+fCAIzE1fhwGQTD2VaZpsKO10GKUAZXRtQfbhVpFI5Uuf5VnMYZWyDBsyfS19mpTnSjBIRQC+fcvoqUwRLzEFkJTD1l5DS2LVLCuIN+j0TZDPuXfwM9RXDZrxQBVGd2tHnxbZVeWHGnUQUck++oOke06OP6VpYd+R5JzK6/lCdyhiBfemO++1;25:u24nMxtXZrUvve/2SbRU3KceDfZsWLPoJEi2IosDC6DwOFL77171bUk5XfZOuitGdRSul8ovfilqonB6UrCdiSLJpTIYJ99lfn2zMLMO6piDMY6FKyAs76RcPC9AWHsefcsmF/sse38bVDpSVjfGfJK34XSOPw/4wpQ0ZxP1PpZxiWOH+A+jH0RQPe+ATWy+8RKx6Wg9/KFNv+/hNSlG9cu9poY0qJUkvV37ac1645FkwQ4pNNm0ywxYHPoWLIzQeQA4wfhmRzQNWRZ5pCFrqYUGLBOvIB009QtrWn9M6ewKbdBSRzITZ0yTFR1QtQLNqqzi0342+hU6bnDBkqI/MQ==;31:0fbX0iLCGlR+Vk3gPojUM4s3nxhCBgz8ggXvaBO2LiFDsdMPXoreycfOs9MmyVufnp3CwcW6VXxwt9uTosxulN/f3ploOHESNxwNji9E8+Sa0O657GQWo9MdxK1N1VEYQE6GHzW2qAy2uAhPrLn57dlF5zbJZxlAslkaMmf5rMQKUqrUqZiHVmDqNoYlOnYOAlwkju0VRz1xUE9OlsLLc9s9aLUxcfyB2aZhp4W/WZI= X-MS-TrafficTypeDiagnostic: DB6PR0801MB1335: X-Microsoft-Exchange-Diagnostics: 1;DB6PR0801MB1335;20:7DsAPVbdtIZIHUGdFmLWJnxSGemjfANW+zAV6yoWr72R4ZjvkmcOWo0GQBtez/M44uhKSo0yWt5ee2jmX58jGrFOJzcDNs+/TyQXNGHDxJaDqh5tHrw6GibMKBsDXWEFhCaonBBwCVHqf3WnPvJfC8cBStfVx7VBLzsFw2gwaPUxS3kvnMNidWoYfdPpjY6ZcwfAY9cgqtgvs5Dlox8dMqWo7vll08+LM59t8huRe0cSaNaq8R9PSitDW/r3WAultWbm+PcJI7+hgQaVOB8Ccg24wwbScLJRxG0/S8Ty7FDcLHNyb1FjycKXl0OafAkRrcjBAt8y1meAw8ZFT/Wv/VY5x5HUZ0X3zz/UDggsJ/mwwXRUHPSQmfwUhlMYZ8wHI1rrR8GnKYq/BxIO7KT3YFC7OKIKOcsr+cildUCyaRSEKKYZS/JVXXFbxfv9VRAV5qgdBF3gUUkH6oz7DDBajj91BUPEERY1VaO544A5jx4G991j6cq434I12epXt7yX;4:vGFlW0m98uU1gmoSB/8qcSi0UGnD69RhDUaXLPHNVy7G73lnngQCSIHwA96ah2iWyO3y16lhpiLQVQdcY7thP21rITxfKDdr4HtoX6NMPgwCyrR/cK5fsRLtFM7j4oH3pQ9QcxiGldXTywqfsxKYeuIj025VJCfMrLV17NPXXbeBa7L8oH2adGmmvY4mQAV03akQMBDavIQO4OjG114bz5MC17L3TPvQjRvixDqd3woRBG6lHc67G4FqpmCBS9OudkQHrtcBvMIqCxI4+vUWTw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231232)(944501327)(52105095)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DB6PR0801MB1335;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0801MB1335; X-Forefront-PRVS: 0645BEB7AA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(366004)(376002)(346002)(396003)(39850400004)(39380400002)(189003)(199004)(50466002)(103116003)(7416002)(5660300001)(305945005)(7736002)(478600001)(105586002)(2906002)(106356001)(55016002)(39060400002)(9686003)(53936002)(25786009)(8676002)(68736007)(6666003)(81166006)(97736004)(81156014)(6636002)(7696005)(55236004)(230700001)(8936002)(66066001)(61506002)(47776003)(52116002)(186003)(59450400001)(26005)(386003)(33896004)(6506007)(76176011)(16526019)(86362001)(2486003)(23676004)(446003)(11346002)(476003)(316002)(486006)(3846002)(956004)(58126008)(6116002)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:DB6PR0801MB1335;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?MTtEQjZQUjA4MDFNQjEzMzU7MjM6cDRDL0FSQ21mYlRPYTQ4NXJWQnRucTdi?= =?utf-8?B?blg0MlFNZy9BUUZXQjBrdHFBN2ZuYTBCZUdrZkpDcG8yU0tEYXZoc1QvZUox?= =?utf-8?B?bW1rT3ZEZTBjSmlvelczZW4vMjN0c3g0UWhJNE83ZFM3amQ5RG9jRjdZMlZs?= =?utf-8?B?WDU4dmM5aEp4OUQ0OGFjTjVxSVQ0ZkIyejI1eHJJV1BWNFZmRkNnUVg4Z1Fo?= =?utf-8?B?cWtTUUR1dUJRS29HZDJMVitFbHdPZlNXajFMY0JJUnlxUXFmOEh1bWcyeXg1?= =?utf-8?B?MFRLQUFUbEpRWFFsUGc0cmZMckJ6VzVrKzNMc2ZtOE9vUXB6L3Rxc3BCazhR?= =?utf-8?B?d0VvL0NiV0tuWjR3TWR4SnpMSFlpNVh4Z0xIQ0R2aGllWUVmWD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c2sdENcDj0Hsi+DaV+guy04GOpd/kiZKGOkAmE= X-MS-Office365-Filtering-Correlation-Id: 07ef197a-ce35-4a62-4e44-08d5a47b7422 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2018 15:54:05.6314 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 07ef197a-ce35-4a62-4e44-08d5a47b7422 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1335 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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--;