Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4247543imm; Fri, 18 May 2018 01:45:02 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrqnZyWGxmpLFMF4N4wUTEzUZIF3NVPt+TQzjShVz5j/BVies1b/SACH4UZUfUxBi5dPwvC X-Received: by 2002:a62:7682:: with SMTP id r124-v6mr8481095pfc.80.1526633102813; Fri, 18 May 2018 01:45:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526633102; cv=none; d=google.com; s=arc-20160816; b=AIbZHIFtAG/qSL6ksvhq2t9VJeofFXKmmMBr5IpbSeiUgcJgvmUS2uoAC6niTC4tyL nOcUQGkfXzIXogdgQ+27yBDgCnfqORwZVssqajRUB7PjZIbTxsDCN9qd/ZLTz+5LOpTB 7FNV/pvGUqw0jPjhvNqpv8sSaAh39zk9Z+TFK/+1A2nSKwEz0jsJaRNDNnht6W+5OO97 81sK3AZdesawzQYRctGaimd+2MZgKuze5fi7nkXsTBZ60FqzBysoMfOa6bCxLN1MgKa3 2G7LfFoa2sx3a7b8XEAAubxHY38JNu1nPvsY+yz1zWS2rRduN68LLQuVbt4CW3DG5NlQ SuAA== 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=LFfDQx5J1CVLSSXFNH+S3h8jGjR6DUma2O/abeRlgEs=; b=O3vSJVhj2f6KGuLiFKcpxDcUlv7H7Y9XnldxJ/cJ1tehHC08ZylgL0a1jaAFiaeJ8t +eJIDTGBmLkt2Z5IbJrVXV/XMlVYrPP5S6tOOf5U4MsnIPRYDSb2gpD0Lz6l0mECpUNJ aTRWYZwW4Iknmo/okcYRLUUBWkeR7/Izsot97XXUd3QzXfHF5bKTgzHacehU7IwtyFuT KXQp8BwkDXsbNXN1+n3kM8fBSagMMEWmWORjbDDhedF5urNLb4iwd/VyUmTQR1bketUu 16Rlku7U3EX20J5FXyxcLWnEzLjXvaux/CC/Ju2FgEJ4DxUG4CziRTUaA9HR3oqU24zC rk/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=YX5bxNCx; 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 n3-v6si5583455pgr.342.2018.05.18.01.44.48; Fri, 18 May 2018 01:45:02 -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=YX5bxNCx; 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 S1753772AbeERIn3 (ORCPT + 99 others); Fri, 18 May 2018 04:43:29 -0400 Received: from mail-he1eur01on0113.outbound.protection.outlook.com ([104.47.0.113]:18244 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753223AbeERInY (ORCPT ); Fri, 18 May 2018 04:43:24 -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:X-MS-Exchange-SenderADCheck; bh=LFfDQx5J1CVLSSXFNH+S3h8jGjR6DUma2O/abeRlgEs=; b=YX5bxNCx/OaM20Y+zUoxsJMAh9f65XllCx0MtaTkDSlG4m8iER1lNsEOM1YQlEab+wv/ZHvwce6Wxjrvg497N51k6LLWRxVHVkm7pL5f0gQHvAELfEv4baUl2s+wNHw7tqHKj+kqZHL6Yg20eiPUZki8jJ/CcJ4bOBl0JR3ISDM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (195.214.232.6) by HE1PR0801MB1338.eurprd08.prod.outlook.com (2603:10a6:3:39::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.776.11; Fri, 18 May 2018 08:43:18 +0000 Subject: [PATCH v6 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: Fri, 18 May 2018 11:43:15 +0300 Message-ID: <152663299522.5308.211266210014374179.stgit@localhost.localdomain> In-Reply-To: <152663268383.5308.8660992135988724014.stgit@localhost.localdomain> References: <152663268383.5308.8660992135988724014.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: HE1PR0202CA0024.eurprd02.prod.outlook.com (2603:10a6:3:8c::34) To HE1PR0801MB1338.eurprd08.prod.outlook.com (2603:10a6:3:39::28) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(2017052603328)(7153060)(7193020);SRVR:HE1PR0801MB1338; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB1338;3:ssEijJ7MxsEmHXm3bENCEPJYhP8SUzA+D8bBSS7QZARYFHEsm+m56T74fYFEIZ4feWYsOGktZW7qE7SzlGPzE64okizGKVrugE31wr7hxwMsRCD2Bh83JKy7KtyKWuYbXMI6VNT++PyGlmiZ9KyJgocWpsmPHWfc7/zFzI+gkPHgsS+/saOOzr2Ee1yEL3TXDu0k9EzF+effU1JvmP43aCxmiSXgssZtxjDpPWB4NXFoM103cQgKknUF+p1rNc3n;25:EzTsz7H5INnbqj17TTu16ljMHEvIsOUxrRQSMdGM28GAEkqQJnyur17AQLpZSfoTsK0n1NZhTu5Woq4c/wOzhe/gBbRGymZyFvV82PEWM/bgWYxmwl6rXoSIjp/lTZM+tQO7vZ4gRMYCHs3cxy4CnDPsZ1RzwEU2HptCDULt4kmxnSddzFnn9mEn6jlkmzVF+oRPb2hM73MEaXFdyxeWVD3ZWRjiMVcrfgMQWaT/Eq0Ubmi4LD8L9OCob56x2INKdn82r5t/RrMs5f3E+T2PGXHg56fMhM2TbHY0HADfWhgRSy0AqxJ6NFrjyZn8bcJj9qhXYOAKjAzMzdaqJF4aJg==;31:NG+jn+ClJLEs70OT++BmmElXY5lR8JFEDyIFS62OFV82EJbiIFlc+OkLyXwwVtEl6ipFaNejzcJhKW9MTNyTMHPCfV+FFwIytu0Ku/ldEvpV7cIqPA99aLuf1WebkG85eBE90UXbRw9sJHP2KQW4oQtheJIMNUEoGkepRdtINiTCLdpdqXrmiJPaJfuIAHTxRMVOGbyNgKJPF5jVakd3xhkxAqcfxW1q4IGhH+418fM= X-MS-TrafficTypeDiagnostic: HE1PR0801MB1338: X-Microsoft-Exchange-Diagnostics: 1;HE1PR0801MB1338;20:edAKx5PPE5SBtBvg5INOVUeZkUq2RhUJh8cn8xtOABCa5uu4d6zcI4+P7FB1r2lZ9ugUfAS1O1lDJlCFieg9HGz9KDj4XRcJgKpKT/h5ZdoIZCXByxyCGyg8nTcouN7pLs0/9EtSGdDDrNozy4dUbPiGVgIa616nXJlHJDpPXV6wqHKdoV33hSdX/kBGeAXYbyF1AZ26HwY+XaX2qdyfy7U+Gfg3yTvQ7YezyfWXuJBl0R8og/Pb29gRzbhWrtQCM7ftXOOkpK+IyBC7TxWHEz9JV9JxeJOLR+yisaoFxvrEwAHqgHdS1oZB32LwMVTqQG2zZ6I0Oz3ze8+bHxfAxmVbmLx3JAB3ifyCQJuqgRhvtpaYhoCaoiV5XdbIkktXoiNmZddDV8BEdBI3jtCOs6BLNd6YgdR0qFZuhSTGhnEyDGbBY8UT1LtQ5TaG2yuYDaVjMv1OSuGz7QlnXlBVyOpWF9CzWMoPdGhNjKmXlouFEh9CXIT+kscBpYC0d9KS;4:db0UQ0IRyKIlYY8ifRZ2C4b2gO/kPHgW6UTTwng8tD9WT5+NKWYB0RnQzJ/1Al6l/9vK7K771aKtA1OtY5GU5cQIIVZXtD2B+Mni3U9TOPLd7otfzs2mauzr+g/P4YcPFgJsx+pvgLDB5HJlgTWzifV5L6hK1lYThA/bY2i6mehickH3fYJNPgDFhZ1bzGkZ3WSf7fESwy2Y+oHzSZ0S4qeTRC4F+5/hYCLnURF9FhpxWmswPtOulxyKfvYxs7J5eDrdNdY9mDVG9/S0bIsQYQ== 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)(93006095)(93001095)(3231254)(944501410)(52105095)(3002001)(10201501046)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:HE1PR0801MB1338;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0801MB1338; X-Forefront-PRVS: 0676F530A9 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6069001)(366004)(39380400002)(39850400004)(396003)(346002)(376002)(189003)(199004)(25786009)(956004)(68736007)(58126008)(50466002)(47776003)(66066001)(8936002)(8676002)(316002)(81156014)(81166006)(6636002)(478600001)(6666003)(486006)(3846002)(6116002)(446003)(230700001)(103116003)(476003)(2906002)(76176011)(7416002)(33896004)(11346002)(5660300001)(305945005)(7696005)(52116002)(39060400002)(2486003)(23676004)(186003)(16526019)(26005)(6506007)(59450400001)(61506002)(386003)(55236004)(86362001)(105586002)(106356001)(9686003)(97736004)(7736002)(55016002)(53936002)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0801MB1338;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?MTtIRTFQUjA4MDFNQjEzMzg7MjM6c25Tck0yYlRKN215bDRRYmhtZksvTlRD?= =?utf-8?B?bW9tQ3NlVWk5N1ZPWUgyNlBUdC9QYkZhbFBUR2Z4YXloL1o2d09ZQ0JlbTg0?= =?utf-8?B?OElONUZzQmdyYjdUbzE1UkJlTDI5aHhzWDFtWTBYQjRXQXZORWgxdUp4K3hF?= =?utf-8?B?MlFzSnlMdFNsanBuOVU4VnBvc3lKUUovY3JtdTlUck1WaEFBS0R5WW10blZF?= =?utf-8?B?azdOVFN2Q2NUOHVURzY0bW5RNnQrVG5DMCtHamVBUDJlZVdNWXk3L0l1dXV2?= =?utf-8?B?eTZpRzVadUNUYWRQdW5nVzE0YTArb0o1RHY2UzgxTFhnMnFZSEFjVHlZd0w4?= =?utf-8?B?SlR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yKH9HMIlm/++L9zT30rHBTDFPQPVqIU78645t3nTTb50mg/0ii006jd2pTjwXYS0rh/QuK2Q= X-MS-Office365-Filtering-Correlation-Id: 3ba10584-306e-4a7a-bd3e-08d5bc9b67c3 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 May 2018 08:43:18.1345 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ba10584-306e-4a7a-bd3e-08d5bc9b67c3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1338 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 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--;