From patchwork Thu May 10 09:53:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10391533 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 899AC60353 for ; Thu, 10 May 2018 09:53:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 796A2288AE for ; Thu, 10 May 2018 09:53:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E14F289BE; Thu, 10 May 2018 09:53:27 +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 B4FBA289B7 for ; Thu, 10 May 2018 09:53:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 78D446B05E5; Thu, 10 May 2018 05:53:25 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 713416B05E7; Thu, 10 May 2018 05:53:25 -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 5B6BA6B05E8; Thu, 10 May 2018 05:53:25 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-io0-f198.google.com (mail-io0-f198.google.com [209.85.223.198]) by kanga.kvack.org (Postfix) with ESMTP id 2F8B66B05E5 for ; Thu, 10 May 2018 05:53:25 -0400 (EDT) Received: by mail-io0-f198.google.com with SMTP id g5-v6so1829436ioc.4 for ; Thu, 10 May 2018 02:53:25 -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=nnwy0WbKaa0RduSIvlSVCWVEqCAstFFZiZwiE++xM50=; b=WV+0dlK/mQRqfotP/QYfOkOHGpkxShychQuB+v3fZGauBnH0gP+avdRem1V5+LWKbK nLhWaceneqTzJ8TipgciCOo8TstwUiUlHvUZzR9F2KnuKPmdvkQhhyEK7cb5ALOMrgGQ rmqeWnQW+AfhM/YVMDl3g0+rhtsq9VucM5mqL247ptQjWiXaO+/NILDJswvGCEhc0RwC 83hcQPFbPTKa7rWWk9RqckUIRpRDhY5nw2NnhX+hdc7cGPy6iWe6P6ApL+V7ws7W1w/J KYXDWJtPEyESo3DPwlAtgDO/baw+XrpNqD9XhyKQFrWOK5NedkxdYhBBpli6OmGfcq6X gLIw== X-Gm-Message-State: ALKqPwcVpUHLFacbuYbsZ7fd3EQw5E6HKkAyzEQwmcx7wjlpzOhexk6v HFz3yjOmN9lc3np4ui3LLdVi8wDwrf6a+pJEoEIETzGvOQ/SEW0s8ir8jaNi08ezXW94juvQiX0 b1OXj+q5h5/8d3+g4lbbaPvGglVA7OFZHdlvSl8OTClywlrKcMaYlWd8fNRT5F0EjWA== X-Received: by 2002:a24:8b41:: with SMTP id g62-v6mr991270ite.114.1525946004970; Thu, 10 May 2018 02:53:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqgZL5WMivqmWnbN6MoXb4UBLSNeDLCzb4KUtBraw2q2XQKZU2msK9zI2O4uA1bYMmv0YT/ X-Received: by 2002:a24:8b41:: with SMTP id g62-v6mr991242ite.114.1525946004282; Thu, 10 May 2018 02:53:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525946004; cv=none; d=google.com; s=arc-20160816; b=OucBxkQkXBnjogg53AihETyoMGHdgkEZF7nrfibhyf518qdN3+knxsl1YI/ILJPgqH fucxmCmzIkHFa1J+ysoMV+SmNl4pJrCa6lqVs0SSfrY7QKzitfZFZup5lqrgUgwO2xPW RdLRuLUfcesLEoyn/wWFua49PpvyBfVysBAs2BLt3JjZCaPZCqZs5/jwQb+cBe+ZWWfL rCcgDpawVmnCP9KaiZZMi6OrY30HZ9miW7I4GAawi/oplo4XJ+uAvB5lNWr0FJtPFfuP NIFFpn1+CBSolparA839SPGE2e5tzIzbl1395C5UCcnZJwza3AvyTZpeQh7R04X6VA9E gKUg== 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=nnwy0WbKaa0RduSIvlSVCWVEqCAstFFZiZwiE++xM50=; b=Qz2rmZEPEM5b33K5WMWaXUQ/Eypyv/nT34BlY9Z0EFdukLJzbppemeU5qIdZ4XZQvk PWFOyMIuGTR3wN+mWvnI7zqT+8ydu8LN5IeqhQ6DV7YjMf5GikZMiAuEkptxMEEiM7ts p0Tjol4JtwIpTski6IempeK3tG+zftxq+qbmTAK1BmgvSmXpQnZEHg4vH9kDeUdc4/eV JPe84uKh3GHWGUo/Z1LmSI7cjTpJzHu3qhh6CyGUJEhDXhx1zruA9YfJZ2ALKZwMzuQ8 JV2GaavfvQmBzHw/Ji00awpOzrD9CachPmEbGgf9vwTeIVloNmo+vsm7poW9zHTeqIMt M0NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=OSXuPmLT; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.5.125 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50125.outbound.protection.outlook.com. [40.107.5.125]) by mx.google.com with ESMTPS id 7-v6si375411iob.122.2018.05.10.02.53.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 May 2018 02:53:24 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.5.125 as permitted sender) client-ip=40.107.5.125; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=OSXuPmLT; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.5.125 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=nnwy0WbKaa0RduSIvlSVCWVEqCAstFFZiZwiE++xM50=; b=OSXuPmLTiAodR0Anqj/VdKfb4SgW84cz5L9glICZRjgd6d+eFaGr2CWsqKO/kzvFiHsuSFSa51jyz7AMaB9YpCDay75ENp70h6MbaKrVYdT/6HnDDJ5FPPU7iRBCgU/tD1XW1D98vGGBaQovqZxHmUbUAPudSTyvpeJMcEhuZm0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (195.214.232.6) by DB6PR0801MB1333.eurprd08.prod.outlook.com (2603:10a6:4:a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Thu, 10 May 2018 09:53:17 +0000 Subject: [PATCH v5 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: Thu, 10 May 2018 12:53:15 +0300 Message-ID: <152594599552.22949.582222092861665393.stgit@localhost.localdomain> In-Reply-To: <152594582808.22949.8353313986092337675.stgit@localhost.localdomain> References: <152594582808.22949.8353313986092337675.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: AM5PR0502CA0006.eurprd05.prod.outlook.com (2603:10a6:203:91::16) To DB6PR0801MB1333.eurprd08.prod.outlook.com (2603:10a6:4:a::27) 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:DB6PR0801MB1333; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1333; 3:ucSj7A+vyM3jzuJYc8MrVZyACD7HXOqqnuScTryVyM21M3kk0iMN4G8yIghcbcByUZCiVD7KEg9lOM+YqZ1Rj0I6yFfn44rUM8YINY7JCyJe7agKYW2zAAr6qFy7Myv5NadoR2jU4WefDO39vIN7lOVXCW9dc109k4Ve0XbA7ACQwugQpozKn6ZW9AXsGenIa+KJjY8CtqBUHdZpo2oWfI8mg8nQo8cYJz2I4N9J6lgMFqyn+7uE2uSKe4R3lgIL; 25:CnYA3VsF4qjKLnqaC/N0vYgvalBgd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l4RZHosQshLlj4sfdBJWD/0Cyg/sjrIuFns4Ejr53U78rKo33aWbAaryX; 4:/QTpIVucnOoO4SBfq9TiGQUGDlv1XlCLV3JDTzAs9xwdtdAaypFVOxfGFNi/Sz3cCOLTok/LeMo6H9iOI3TUejf3fF9LePML6IkB2KxND/pRI6ciSgF3US9enyhkTp/wOs9eVKpOXOeP60rMFGJ0Uwg5qFyuSLdluhEnXG7w5G8Ur0JDYRzNm+5KEyMwLLI1snLERS6mkUH3lu42ftrQJNgCJz0dN5V29QmwqeFs3GxlMdk+J7EAj2FwPzsyuFA7KBAILt8L0Z8r7P/spyGrcg== 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)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:DB6PR0801MB1333; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0801MB1333; X-Forefront-PRVS: 066898046A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(396003)(366004)(39850400004)(376002)(346002)(39380400002)(189003)(199004)(230700001)(23676004)(11346002)(2906002)(58126008)(2486003)(103116003)(6636002)(52116002)(7696005)(26005)(7736002)(16526019)(55016002)(3846002)(76176011)(186003)(305945005)(446003)(9686003)(6116002)(316002)(386003)(86362001)(486006)(6506007)(68736007)(476003)(956004)(7416002)(50466002)(5660300001)(59450400001)(33896004)(55236004)(61506002)(66066001)(106356001)(39060400002)(8936002)(8676002)(81156014)(47776003)(53936002)(97736004)(478600001)(105586002)(25786009)(81166006)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0801MB1333; 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?MTtEQjZQUjA4MDFNQjEzMzM7MjM6OGVEZlNXMUxtTWFwK09qeUhZWnIveExE?= =?utf-8?B?bUJzb281cGJab2xZMjVua0k0OGRuRXNuQ0lzVUVXZjRUUXcraTMzVVBGR05K?= =?utf-8?B?VjNJWmIxL0g4T1BpRkt1SElIL0tMNzg1Z0RHVVJxSHlyRWpZVzJ5Q2pOZitl?= =?utf-8?B?QmJyK1FPMlM4QVlHc2plVlVCc0Y0cGs0a3E3TVNVMmM5RmxzYTk1MTg1alRZ?= =?utf-8?B?dE9xSm11VVFyQWp6RHFQdEthclR2SVlXM3JWelcyQnNhQm51U1lMSGx0SWk2?= =?utf-8?B?Qlo4aG82bzhuQWpUUGtFQnNScG1XaUErRXNQRHRlMnZhalRSUU1vU3Z1c3FR?= =?utf-8?B?WmhDWDI5bWFWNTlXMTVZUk1SQ3JqNTVhWExuT1lQY0c5TEFKRWpNTWFxR3l4?= =?utf-8?B?QzJ5UEQwRlRtR3FrM1NKTnMvR215U0tFdTJ4WFpmR2g1eTB6TUxlb2o3L3F3?= =?utf-8?B?cmMxbkowcmVUUVpST2JEbXYxSkpESWwxRzZmcDUzelQ4dWNUS3NYOU41ei9t?= =?utf-8?B?dDdqUWpOcGc3THlVZ1c3MjVGQWhhM2kxaXcwSUlsQlJBTGlVYmw0RHFFZGZm?= =?utf-8?B?Ym5FTDFKZ1FYbm51bEY1QnlkbDBaNnB6V2xHTFJyeGwvMmJsM3N1RThQbTRx?= =?utf-8?B?bk1salhsUjFJWHpxSnU5YnFWQzVrTG1adWM1T2xtQW5QQXpsYVhPakdwOVlz?= =?utf-8?B?bXlMcjVUSkRnM0dSdjNPdDhheHdFeUtCeEdtd1hyYVhCaWlNWVFGcWtQUTZk?= =?utf-8?B?Y01yQmlxUTVBUXlTVXJRTmxkWTRURVV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xPq2ZuM5gLW89PJgyQufYiG8Fd57LJMUJkN9UzwrxcBmobgDme8X1LiSpDayc3snhHzYyN9phspE78zTfYRLb+6woGR+jgDe/2U= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1333; 7:Ri+GYkOAOZna81d9eu66Ci+yFeA1mWykzrxXrutvvLl20KRm8UNqupUsD/jl74x42sqxv/EzhNPXe1NQ62AA1BVj/LilTYcM1+O1OSBQaiTVXKkt3++wpGTROaiMvYVK/Quzxrvayy9xXpkTmnOvcmhbCrYMDUolZpWDvQ8KhEYVe5q6zqt+SNFA0I71bWEVErYM45fRztmg+3EEWQ2oK/4WTHJCDoUBVU9xGD8mffs7tK2cch/CvcfMPV4eAZoT; 20:2sSkfzh/hLqvseExalrd6eGKEWbMHMzHsTkOGtbmwW5SsdL4P13uHOf3lO6IW9zEES4vCnBUTNn5OX5haMbNob815g/NhSIrMQEH+0SBALsW53M0KqB2oXI9+RRG9m6ekCHHJJkc1dVVny9oyM95jQf1pCDAI+vGMRaVRVEkGTw= X-MS-Office365-Filtering-Correlation-Id: 7865d5ca-8b61-4561-5e9c-08d5b65bdc46 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2018 09:53:17.8858 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7865d5ca-8b61-4561-5e9c-08d5b65bdc46 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1333 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 8dd3f181d86f..0721381b2e3d 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--;