From patchwork Fri May 18 08:43: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: 10408775 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 2D833602CB for ; Fri, 18 May 2018 08:43:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BF7228445 for ; Fri, 18 May 2018 08:43:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F9F728462; Fri, 18 May 2018 08:43:28 +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 AECD728445 for ; Fri, 18 May 2018 08:43:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 73F006B05B0; Fri, 18 May 2018 04:43:25 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6F0556B05B1; Fri, 18 May 2018 04:43: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 5910D6B05B2; Fri, 18 May 2018 04:43:25 -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 30DDD6B05B0 for ; Fri, 18 May 2018 04:43:25 -0400 (EDT) Received: by mail-qk0-f198.google.com with SMTP id p190-v6so6212714qkc.17 for ; Fri, 18 May 2018 01:43: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=LFfDQx5J1CVLSSXFNH+S3h8jGjR6DUma2O/abeRlgEs=; b=DF5agcI8bX3mSmllzfGTDA65Tf4CCXfTc55b7GsU/mA7XF5UQmq8lyqnSkUFZd93Rf 2Qd5NLADCDgoYnwA+0RKXqBuEfyI1Z7691n8a1rQcjFJpWDbgbZ12r8ZnBcyb70/ZZwh VooApNH9fNPzZ2TDUP7hQphFAs/G3xkYMVI9s1B4M9aKwdS9uqkTN1LQNRd2IIYrJeqY TOea5PjJTryoTOgUusgsK2YqtW7cIvEGGKni0SpH9VZEnKPa+yOJ/ACo6DMTwXDy3bFS J3b/KlOj29I3+If5aUTWq+mRRYEwxMPcR72XLNcu9OfCoaR44XBrqixZJq0SOaQR3VlK pdDw== X-Gm-Message-State: ALKqPwf64S1dyPdUnwJyfClSugo7D29GHeUwZAWYhIzFoS93/0bsyR26 FM7JozfFC2M5No7czd/8NVaqw97RD/mVFz0yHtCmgpW4GhpGtuW6qn1ATYrOR3oqpuN5FXJAMVf JDZkF3THfYV00j0ZBKeh1UZsm0KllErclWaAnEHj0XqdwtRNRaR48n56Bf0FT0jIwog== X-Received: by 2002:ac8:7355:: with SMTP id q21-v6mr8420701qtp.27.1526633005005; Fri, 18 May 2018 01:43:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqpKEf24rIiS1S8xP41R39lyet2P56EoB4URof17EmJMTW0diPn+11zj6W0kFd9qhRxDksO X-Received: by 2002:ac8:7355:: with SMTP id q21-v6mr8420689qtp.27.1526633004392; Fri, 18 May 2018 01:43:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526633004; cv=none; d=google.com; s=arc-20160816; b=TKIoH6OjaVe0eZQjZBwsiCosYUjpF5LG+ET49tRAc3mm76tNcRT2jqIN8sooF4ltho Nl1Q5orvX3vbpMBfKsozcRwDopQK9c6uPtNzrfG1q1/Ec9vPh8XB23jmHwFpXULWHzNV HrJnTMgJ7VdnEUyhWa1Zbvc+DVdhzR/xfKwbNY3qCxa2j1cMJ+JTBCX/naJhSohgPG4o xN9kNEnsFsk3oCE32BWYDJ5DD6KOFNzRAVHLw5Kd1PGTpvuxAM27Q3NCQ/H+i4R0Xuvd 4IK8ObzDRa83vfqICPkZJ9Isj5IJfIpqQdqsBvl3u+S+uDWga4X+D45PJ3aITlv2x6Jp 60+A== 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=sAv9Ad/9KycF4v5ZRIPavdnQ5Mwc074iJ7VAjgeftu1qrR8EwaMMhIUmVBLxU/jY6V AvDpcmTxhjkZhsbkUktBC224syPyb9Lw3kTXDRYL7Y1kCbxkp1c7EE3ahuaHeZU/oRMb Saveq7oyaLi/YORu1xQ01WjaLMqXiVTKCQeg+XeM7xuO03draj4cskfgxc+hg1tQ/FkU G9VwRMrzwuXzSIBf8CbAV1lpQeQHlCak7c+HoCm10SlITn4NxWqkteC6CIjGcls3fVKn DqNu0IvFnpxC5HU49LsgUTeOgU8WZ9KVD/D/EDxZJqHazGsB2Jbs9LXvq/UAcX6E9TRr vTIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=YX5bxNCx; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.0.109 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0109.outbound.protection.outlook.com. [104.47.0.109]) by mx.google.com with ESMTPS id d14-v6si1281759qkc.48.2018.05.18.01.43.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 May 2018 01:43:24 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.0.109 as permitted sender) client-ip=104.47.0.109; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=YX5bxNCx; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.0.109 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=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 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+effU1JvmP43aCxmiSXgssZtxjDpPWB4NXFoM103cQgKkn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dBI3jtCOs6BLNd6YgdR0qFZuhSTGhnEyDGbBY8UT1LtQ5TaG2yuYDaVjMv1OSuGz7QlnXlBVyOpWF9CzWMoPdGhNjKmXlouFEh9CXIT+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?SlRHbWwvR1pyQ3QvNnppek1odU8xOWRObXJBK3Z4Q2x1ejdQY2tOVzB1bEJm?= =?utf-8?B?aWlpMmt0Yng0QkxDYTlmaXBVanFYOEM0WFF1WGdKeWZSLzdlSkhmNEpmSzZw?= =?utf-8?B?azJWSXlzWmhlTy9adEF5cjVhdGxIREd1cERyZEJBdmNZNXZZY1Q5M3B1Q05o?= =?utf-8?B?Wmp4OXY0UEdPSXBFaE1PVlpJUzRpRnZjV05YajdWYzlGMFE2WVJ3a2lta21O?= =?utf-8?B?MGxDcEI4Wm1UTGhXaElOMjVBQTVXcnJiNDZ3NFB2THJYNlV2Q292eU9aYlRa?= =?utf-8?B?dk92d2h6anJka3R1SkFTaXpaN0RlTEtSRVRtVWR2UWFYMHBSZThod3dRbUdy?= =?utf-8?B?NWNFaGlOVlFUMVN6M0pOVE14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R5/PMhDw9V7jItZoPekwxJ+FHZfySPOBcX5PTV++YuM+QBnJScF0WH1dn05+HLfgizH6FbN7LWYwkU=; 24:8wh8q6qqig7M7Wd+N5sK05ps5ITHKPua6byoXZTHgWipDuA9u81sCSlyj1bPqK0Y1TYmecy3x9VoHBfx9Nn7rv0T5A/6dyYINpQfCvwmc0o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1338; 7:XRNshx1ibpWRf3tIYIe+F0CnrXQUSpMMbYaZHni4FRm0d+JReMLP2VFWR76ZxBA4Pxd96Uwg6i09Y+/4DhFIkGb27TII34XOQJlkZy00RatTqDM4ph3iNMFdzZaivrMlO1mZHtoTmpeAjeq7JwwYGr4TnHr+o7YcLXJjZrcQ6Wtpb4EBYf6RS6X/pikU+AG9fRb4EjKYkDdhpLphVx1DdILwufbLAug2Ec3615pnDp9L60i2ZXheZoYc+LYNk2zE; 20:BC4/9z8ZC0rE0iZHhO4mkSlDccoTwDfAnIFGFUrwEo4PnTexe5GnLG5quGz2dMFcx9MPPq5CEbWVMY4MjkaPn5v1ni/gH61smZOyKH9HMIlm/++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 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--;