From patchwork Mon Jul 9 08:37:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10513917 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 9A65F600CA for ; Mon, 9 Jul 2018 08:37:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8316428A54 for ; Mon, 9 Jul 2018 08:37:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75D5228A59; Mon, 9 Jul 2018 08:37:46 +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 8189B28A54 for ; Mon, 9 Jul 2018 08:37:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 751CB6B0288; Mon, 9 Jul 2018 04:37:44 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 70DD06B028A; Mon, 9 Jul 2018 04:37:44 -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 52B536B028B; Mon, 9 Jul 2018 04:37:44 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f70.google.com (mail-pl0-f70.google.com [209.85.160.70]) by kanga.kvack.org (Postfix) with ESMTP id F224D6B0288 for ; Mon, 9 Jul 2018 04:37:43 -0400 (EDT) Received: by mail-pl0-f70.google.com with SMTP id s16-v6so9609255plr.22 for ; Mon, 09 Jul 2018 01:37:43 -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=9faoK2o1DQJxnXMAB+Em1ABir7fxoYqm2LDho4cAax0=; b=aX6HnChIgyu7qkfyQXwFP4Le0//iLp00ke5WOkeCp/J1jtLKwHTdSEfcxpDsOoFf7s v1f9+4i2MIwerMtt2p6Wuj15klC83pGuof2UmVVw5B2hzspYi/zGXlqamGHLcGLc0SL9 9FhTkypjCb19r8N4tYpJtwAjbp9GwS+dq2gul96zwD+rqHcKQuZhRcQYMr1iYEDrZrVy y9ehEOxqHEcvjLC15tv1BpJNYTJqD33lWiVTat0KdhmFZIcmw7CnsCTFG3SPnv47oGrg UDZahPbtSh62QzvEsSc0sByD8JMUlS9PGORaboaSZRqmUAvqp4t/tI9nCJnzI4AXGldF GVHQ== X-Gm-Message-State: APt69E0fcVkxD+CKZkNQAefVSKO2NNC1LZmvvC+D97bkbNJ+r1nYxL9l v+BwTulvnmy4HK6Kb6avzFX3ygt4KISqQq5qW3pC+7+qGYEji47OQ7/t62hfpca1Khrs9Trbi8G eZu0K+F8343nTRzAcwS11hrhBUMGIjIJvIyUG9be481FWnJpvbf5Pnlvkp1stXIfq8w== X-Received: by 2002:a17:902:6b47:: with SMTP id g7-v6mr19988817plt.251.1531125463641; Mon, 09 Jul 2018 01:37:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcNgHQHO21xDw8tOaxGZhgbitNSoURG0m49kVjb1xbi4S7prWHbe6rxzqkOzt3vos3afX0R X-Received: by 2002:a17:902:6b47:: with SMTP id g7-v6mr19988769plt.251.1531125462634; Mon, 09 Jul 2018 01:37:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531125462; cv=none; d=google.com; s=arc-20160816; b=LOePLrWQ5nPp/4dL3JuoPp01AMTtDgJAXbf+9t6XuYkidvOyHV3f95TpMDSqMSq3jy EhhHGi45Lojg4Lx/J/MXFHEbDSiH3OC5Sx/IjaMbv/HUUH4fzjt+ZTI4a2rV4ZAdeWY8 d2oYtNeRPX0aERWnAUWSPqFxnnAnYqgRVw4gXZI8VAkqfgv8GB43hk3/Nyz+f2phntPN 3MsuElzZhD2bE08X4CH9Hi3T++4Q5dJij9x9gp4drqMwxKl2aQVHpoyNwdlSw9x6GUAb wUE2wBytgTyoVPBenWuGmWgVWQ8nORAAPw0CFB9NEHtl8H3ZUJC1yWuOShuKFhLhs4Oo xZxw== 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=9faoK2o1DQJxnXMAB+Em1ABir7fxoYqm2LDho4cAax0=; b=bFVEHWebUp/H22+H6IXZvdJNataqJ4Mquf55d4p6X+BhnK7ek5dBvA/uEeaCVBqfnv uhZmY/JNFi+KxmUVFd/u9KDBA6SkLhczL9UYxi6+KWpu7fufaLBzEBENGARA5TC0H+Bw Y/+Q1BfDH23GoPUr6Eqi8xA2u47qpb6gAib6IBOaCKQHdZ6bRJ833oghQr/BjqzlKEsF 6pZZDB1CmIIgfGu59rQ4HtZMxQXdJtPDhQ3IovxbIjClDX7kMM+UDYbLq7AwIYOV87Cr z4UIMhWIgIOuOTJWV/AEqcIXW9yl9g1ME3KbFJdsSVl0BMVYk376ig0aSBeBAvklQCPp REKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=cBy2Q+Uy; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.5.134 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-eopbgr50134.outbound.protection.outlook.com. [40.107.5.134]) by mx.google.com with ESMTPS id i12-v6si300163pfj.190.2018.07.09.01.37.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Jul 2018 01:37:42 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.5.134 as permitted sender) client-ip=40.107.5.134; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=cBy2Q+Uy; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 40.107.5.134 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=9faoK2o1DQJxnXMAB+Em1ABir7fxoYqm2LDho4cAax0=; b=cBy2Q+UyKI90JCs/5v44lzXF1smHH0gLJwjbZ7BMuX9NnWD5TgOwZjYusPtP0/a8xNo8564/VOPMcMyBvu0tQDETCg+/+DI+vTtSaBXXPevvpL5rPGTUtPiYZwbkpRLbqM4vZkLXMem0UuMXkvEKOOlfrGsvEu+Wlh/2fAzARlA= 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:37:37 +0000 Subject: [PATCH v9 02/17] mm: Introduce CONFIG_MEMCG_KMEM as combination of CONFIG_MEMCG && !CONFIG_SLOB 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:37:34 +0300 Message-ID: <153112545492.4097.5538595404798621309.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: VI1P189CA0007.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::20) To VI1PR0801MB1344.eurprd08.prod.outlook.com (2603:10a6:800:3b::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: da1d2d31-aede-40b8-7913-08d5e5773aa6 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:XzAS1sbz9Jaexd2k5elLxy7XPJNp991AzOSC6/5x5tAe3WIfFY6L5dy40F2XdDH6sSS54ymc9S0r0x8qkvlYgub0LX2I/Hvcfp64/MuuPtj5GrBzP4KoQ6Cz1W3KK7t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ZPjZ7MMCEB80Vv5OttFiAW7yVen8hSApyMvkCD+zqMMepsv3/yUCUB05O3TzfsBDZ+l0bkxAhgd9MUWpKGSpn39p+ZUG6OBigGiKPsGJx0lsv5Z/+YpqTDjX8GYTqJsZc7NmZszUO6PeAe+aS/lNs2kMoxGf1nomE1r7m3LSPY4zxFiwSY54NGQVLlTQiwwE5np0jacwMfzkJDUMFi0e77QaD; 4:MbVYF51SEmGpOweJv2HXjizFOYGXn77Zkl5EUdeW6V+qu6va0iYCvJDwa+SClYxO3YeN72hk91SlEEWGesa/7NoroSwMkWo6zCO23ADGeYeO7ub/X5KdIF2c70TPf8j2STSNdQwEqQ+5J8+onot8X2UuNCz+s078ZpsqpbeVkbEWnerjfH1u/evtDVz1bnDD4WsgL6sB8mVL//IdqfHOdyLWgWF9J5gNjiFOiTpn8bn7jJ/gjvFnZdSqm+EDo2eWl2rUTZxkwJj/5FcJamxUbIu9oNprA8y3qvIIJfIlsQJUNS+xgKQKm7QweV/wJS2+QgEYBf7UDeFS1cvttJGHP82p7w4VTMjKHcLVP9fVnqnytoGNna09VL/UJBR0YirA3ZOGQTj+LJn5PvVFg7hlJbsiNnHLrZ6z9mYYC+JZqlc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85827821059158)(788757137089)(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)(39840400004)(376002)(189003)(199004)(2486003)(7416002)(5660300001)(52116002)(7696005)(106356001)(105586002)(7736002)(305945005)(2906002)(23676004)(68736007)(25786009)(86362001)(14444005)(575784001)(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?MTtWSTFQUjA4MDFNQjEzNDQ7MjM6TXFMOFVTSjd0bzBBZ1lBdzY3QTRKS1BM?= =?utf-8?B?NEtHblpBQnkzQUdWaHFTRzdYd29OSWo1dFdoWUVCVmJ2eW5GZjRvcVlMeDdq?= =?utf-8?B?cG8rMFlEV0VFeDZ1Nk1Eck5XeHVHUWZqTlBvbldSOWI1elNFVCtOY3lUZFdR?= =?utf-8?B?VFJlTHhYNFB1VjVvWVhvYThVNG9YWmVqemFiamFBWWZmdFl4L3BlVGZkd3Vp?= =?utf-8?B?aTR5dWk1a25aVHJmdENSK3Vqb28zS0p2NkR3dlM2K1FmTXNHb1dLT3F1THBi?= =?utf-8?B?L05hWTVZU0ZQZzVqNDNGTk5GK1JqcVJGTWp1NTFHOWMyRHNPWXk2cVNNZ3BD?= =?utf-8?B?YUtPWXhiNTBva3pYZEtTdkd2MHlJVUtiV1YvN0FIMmY1WnJib0NTa2MyVVZY?= =?utf-8?B?MUFsZ0QxVnNjMmlCQTRPZXlQcEI3RjFwMnMzU3NsTVNmZmRkbC94OXJDNGtr?= =?utf-8?B?OFpXbk9hUWhoOHhsOHphZzNpKzJCVm9IeWIvVTdPN2c1c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hP9bbNL0X3s746FEE96wABntTsXGPFIpAosu9tLaXB37Et1C88ANwPAgVFJrVE9KHAd9gXlTHRHuqYxfgBxlFtn0ECLP4SOhk4YO+XlnUzoCkgwMexSub1RQH2MzeoYVBcHxPQmeVesglxF+MiU0e6icSg7eBX+egxgyl2ufIjObT0z3S5aIrxraLmSGNk+wtxJoSjeSq0kIBS6quc1rToTPngKoRhOJj2IbG3DuAQPPMnhCTUikoZKajmid6yg==; 5:MEknX15qQZnDU3S7DRa04/mSVEmetvaC3Rm7RjvqmdvER+XoGBhkQ4UVi90eDQMLEu8n+92BVnyH2KxUoWul5Nti09e+qWVYKDZgIunKnrubf+6ZJNDxbCFqjngdpDRdNhfRl89ArFt/sEuOAhxflX4W656K4NW/h1JKXfmxB/4=; 24:Ee5ZPXoMGIv1xdgo13NBCKrzVwHWrKIZutimX2daDIz/+dfgb9QBMEQ3m+YuX39uiko0JFjEIfuJE3Q3aIdCRJCENzYTpEBgajMOanKuR1g= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1344; 7:uaNif8lr4bs7xZheAfMHlYiI4ZQDoKP723j/ZVluEr0jnwEdpB2ZwJBsSxKnUZQhTao5zHqS+cwYzy+9ACAfqap0FmHpQwBIA+9nSsIs/xC9+s/Xik7Ml7pQrB0K+0siNzT40CGs0SVAOXZweZlLroUXHwssFuc4jvfFx338FTu9GRHQX4D6va4D1bgJX48vS7/F8WFYpLxy0NJFAN5RCo3UbFSymKov93XHO80SvFPUi13bcFLPuXRULSycEwkW; 20:IR3SD7xX3sVERh1SbIUAEkMNrTELuRGJylEz43DJCsdX5mdK1P+FkaBochZBy9LzS6kfPphtZIcUBHtyqTlrgJGgrUkEt/b5YnB05M95gyD+5XtQH4bjppJSv5jC7MD3MDgVvNp+YvkIO8Ok9W01PdUuAke/SomHWSb4KjptZ4Y= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2018 08:37:37.3466 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: da1d2d31-aede-40b8-7913-08d5e5773aa6 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 patch introduces new config option, which is used to replace repeating CONFIG_MEMCG && !CONFIG_SLOB pattern. Next patches add a little more memcg+kmem related code, so let's keep the defines more clearly. Signed-off-by: Kirill Tkhai Acked-by: Vladimir Davydov Tested-by: Shakeel Butt --- include/linux/list_lru.h | 4 ++-- include/linux/memcontrol.h | 6 +++--- include/linux/sched.h | 2 +- include/linux/slab.h | 2 +- init/Kconfig | 5 +++++ mm/list_lru.c | 8 ++++---- mm/memcontrol.c | 16 ++++++++-------- mm/slab.h | 6 +++--- mm/slab_common.c | 8 ++++---- 9 files changed, 31 insertions(+), 26 deletions(-) diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h index 96def9d15b1b..2d23b5b745be 100644 --- a/include/linux/list_lru.h +++ b/include/linux/list_lru.h @@ -42,7 +42,7 @@ struct list_lru_node { spinlock_t lock; /* global list, used for the root cgroup in cgroup aware lrus */ struct list_lru_one lru; -#if defined(CONFIG_MEMCG) && !defined(CONFIG_SLOB) +#ifdef CONFIG_MEMCG_KMEM /* for cgroup aware lrus points to per cgroup lists, otherwise NULL */ struct list_lru_memcg __rcu *memcg_lrus; #endif @@ -51,7 +51,7 @@ struct list_lru_node { struct list_lru { struct list_lru_node *node; -#if defined(CONFIG_MEMCG) && !defined(CONFIG_SLOB) +#ifdef CONFIG_MEMCG_KMEM struct list_head list; #endif }; diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 5a69bb4026f6..8b35b6903c85 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -271,7 +271,7 @@ struct mem_cgroup { bool tcpmem_active; int tcpmem_pressure; -#ifndef CONFIG_SLOB +#ifdef CONFIG_MEMCG_KMEM /* Index in the kmem_cache->memcg_params.memcg_caches array */ int kmemcg_id; enum memcg_kmem_state kmem_state; @@ -1194,7 +1194,7 @@ int memcg_kmem_charge_memcg(struct page *page, gfp_t gfp, int order, int memcg_kmem_charge(struct page *page, gfp_t gfp, int order); void memcg_kmem_uncharge(struct page *page, int order); -#if defined(CONFIG_MEMCG) && !defined(CONFIG_SLOB) +#ifdef CONFIG_MEMCG_KMEM extern struct static_key_false memcg_kmem_enabled_key; extern struct workqueue_struct *memcg_kmem_cache_wq; @@ -1247,6 +1247,6 @@ static inline void memcg_put_cache_ids(void) { } -#endif /* CONFIG_MEMCG && !CONFIG_SLOB */ +#endif /* CONFIG_MEMCG_KMEM */ #endif /* _LINUX_MEMCONTROL_H */ diff --git a/include/linux/sched.h b/include/linux/sched.h index f809b7aeb11c..c0fbeefecb3a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -723,7 +723,7 @@ struct task_struct { #endif #ifdef CONFIG_MEMCG unsigned in_user_fault:1; -#ifndef CONFIG_SLOB +#ifdef CONFIG_MEMCG_KMEM unsigned memcg_kmem_skip_account:1; #endif #endif diff --git a/include/linux/slab.h b/include/linux/slab.h index 14e3fe4bd6a1..ed9cbddeb4a6 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -97,7 +97,7 @@ # define SLAB_FAILSLAB 0 #endif /* Account to memcg */ -#if defined(CONFIG_MEMCG) && !defined(CONFIG_SLOB) +#ifdef CONFIG_MEMCG_KMEM # define SLAB_ACCOUNT ((slab_flags_t __force)0x04000000U) #else # define SLAB_ACCOUNT 0 diff --git a/init/Kconfig b/init/Kconfig index 041f3a022122..524d6d02895a 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -678,6 +678,11 @@ config MEMCG_SWAP_ENABLED select this option (if, for some reason, they need to disable it then swapaccount=0 does the trick). +config MEMCG_KMEM + bool + depends on MEMCG && !SLOB + default y + config BLK_CGROUP bool "IO controller" depends on BLOCK diff --git a/mm/list_lru.c b/mm/list_lru.c index b65e0b9b0646..c5217d84c6e1 100644 --- a/mm/list_lru.c +++ b/mm/list_lru.c @@ -12,7 +12,7 @@ #include #include -#if defined(CONFIG_MEMCG) && !defined(CONFIG_SLOB) +#ifdef CONFIG_MEMCG_KMEM static LIST_HEAD(list_lrus); static DEFINE_MUTEX(list_lrus_mutex); @@ -103,7 +103,7 @@ list_lru_from_kmem(struct list_lru_node *nlru, void *ptr) { return &nlru->lru; } -#endif /* CONFIG_MEMCG && !CONFIG_SLOB */ +#endif /* CONFIG_MEMCG_KMEM */ bool list_lru_add(struct list_lru *lru, struct list_head *item) { @@ -284,7 +284,7 @@ static void init_one_lru(struct list_lru_one *l) l->nr_items = 0; } -#if defined(CONFIG_MEMCG) && !defined(CONFIG_SLOB) +#ifdef CONFIG_MEMCG_KMEM static void __memcg_destroy_list_lru_node(struct list_lru_memcg *memcg_lrus, int begin, int end) { @@ -543,7 +543,7 @@ static int memcg_init_list_lru(struct list_lru *lru, bool memcg_aware) static void memcg_destroy_list_lru(struct list_lru *lru) { } -#endif /* CONFIG_MEMCG && !CONFIG_SLOB */ +#endif /* CONFIG_MEMCG_KMEM */ int __list_lru_init(struct list_lru *lru, bool memcg_aware, struct lock_class_key *key) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index f59ded209975..09517a0da93a 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -251,7 +251,7 @@ static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg) return (memcg == root_mem_cgroup); } -#ifndef CONFIG_SLOB +#ifdef CONFIG_MEMCG_KMEM /* * This will be the memcg's index in each cache's ->memcg_params.memcg_caches. * The main reason for not using cgroup id for this: @@ -305,7 +305,7 @@ EXPORT_SYMBOL(memcg_kmem_enabled_key); struct workqueue_struct *memcg_kmem_cache_wq; -#endif /* !CONFIG_SLOB */ +#endif /* CONFIG_MEMCG_KMEM */ /** * mem_cgroup_css_from_page - css of the memcg associated with a page @@ -2164,7 +2164,7 @@ static void commit_charge(struct page *page, struct mem_cgroup *memcg, unlock_page_lru(page, isolated); } -#ifndef CONFIG_SLOB +#ifdef CONFIG_MEMCG_KMEM static int memcg_alloc_cache_id(void) { int id, size; @@ -2429,7 +2429,7 @@ void memcg_kmem_uncharge(struct page *page, int order) css_put_many(&memcg->css, nr_pages); } -#endif /* !CONFIG_SLOB */ +#endif /* CONFIG_MEMCG_KMEM */ #ifdef CONFIG_TRANSPARENT_HUGEPAGE @@ -2824,7 +2824,7 @@ static u64 mem_cgroup_read_u64(struct cgroup_subsys_state *css, } } -#ifndef CONFIG_SLOB +#ifdef CONFIG_MEMCG_KMEM static int memcg_online_kmem(struct mem_cgroup *memcg) { int memcg_id; @@ -2924,7 +2924,7 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg) static void memcg_free_kmem(struct mem_cgroup *memcg) { } -#endif /* !CONFIG_SLOB */ +#endif /* CONFIG_MEMCG_KMEM */ static int memcg_update_kmem_max(struct mem_cgroup *memcg, unsigned long max) @@ -4228,7 +4228,7 @@ static struct mem_cgroup *mem_cgroup_alloc(void) INIT_LIST_HEAD(&memcg->event_list); spin_lock_init(&memcg->event_list_lock); memcg->socket_pressure = jiffies; -#ifndef CONFIG_SLOB +#ifdef CONFIG_MEMCG_KMEM memcg->kmemcg_id = -1; #endif #ifdef CONFIG_CGROUP_WRITEBACK @@ -6055,7 +6055,7 @@ static int __init mem_cgroup_init(void) { int cpu, node; -#ifndef CONFIG_SLOB +#ifdef CONFIG_MEMCG_KMEM /* * Kmem cache creation is mostly done with the slab_mutex held, * so use a workqueue with limited concurrency to avoid stalling diff --git a/mm/slab.h b/mm/slab.h index 68bdf498da3b..58c6c1c2a78e 100644 --- a/mm/slab.h +++ b/mm/slab.h @@ -203,7 +203,7 @@ ssize_t slabinfo_write(struct file *file, const char __user *buffer, void __kmem_cache_free_bulk(struct kmem_cache *, size_t, void **); int __kmem_cache_alloc_bulk(struct kmem_cache *, gfp_t, size_t, void **); -#if defined(CONFIG_MEMCG) && !defined(CONFIG_SLOB) +#ifdef CONFIG_MEMCG_KMEM /* List of all root caches. */ extern struct list_head slab_root_caches; @@ -296,7 +296,7 @@ extern void memcg_link_cache(struct kmem_cache *s); extern void slab_deactivate_memcg_cache_rcu_sched(struct kmem_cache *s, void (*deact_fn)(struct kmem_cache *)); -#else /* CONFIG_MEMCG && !CONFIG_SLOB */ +#else /* CONFIG_MEMCG_KMEM */ /* If !memcg, all caches are root. */ #define slab_root_caches slab_caches @@ -351,7 +351,7 @@ static inline void memcg_link_cache(struct kmem_cache *s) { } -#endif /* CONFIG_MEMCG && !CONFIG_SLOB */ +#endif /* CONFIG_MEMCG_KMEM */ static inline struct kmem_cache *cache_from_obj(struct kmem_cache *s, void *x) { diff --git a/mm/slab_common.c b/mm/slab_common.c index 2296caf87bfb..fea3376f9816 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -127,7 +127,7 @@ int __kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t nr, return i; } -#if defined(CONFIG_MEMCG) && !defined(CONFIG_SLOB) +#ifdef CONFIG_MEMCG_KMEM LIST_HEAD(slab_root_caches); @@ -256,7 +256,7 @@ static inline void destroy_memcg_params(struct kmem_cache *s) static inline void memcg_unlink_cache(struct kmem_cache *s) { } -#endif /* CONFIG_MEMCG && !CONFIG_SLOB */ +#endif /* CONFIG_MEMCG_KMEM */ /* * Figure out what the alignment of the objects will be given a set of @@ -584,7 +584,7 @@ static int shutdown_cache(struct kmem_cache *s) return 0; } -#if defined(CONFIG_MEMCG) && !defined(CONFIG_SLOB) +#ifdef CONFIG_MEMCG_KMEM /* * memcg_create_kmem_cache - Create a cache for a memory cgroup. * @memcg: The memory cgroup the new cache is for. @@ -861,7 +861,7 @@ static inline int shutdown_memcg_caches(struct kmem_cache *s) static inline void flush_memcg_workqueue(struct kmem_cache *s) { } -#endif /* CONFIG_MEMCG && !CONFIG_SLOB */ +#endif /* CONFIG_MEMCG_KMEM */ void slab_kmem_cache_release(struct kmem_cache *s) {