From patchwork Mon Jun 18 09:45:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10470519 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 B616D600CC for ; Mon, 18 Jun 2018 09:45:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3B0828474 for ; Mon, 18 Jun 2018 09:45:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96E0528691; Mon, 18 Jun 2018 09:45:21 +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 A9CAD2853C for ; Mon, 18 Jun 2018 09:45:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C19366B000A; Mon, 18 Jun 2018 05:45:19 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BA1816B000C; Mon, 18 Jun 2018 05:45:19 -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 9F47A6B0010; Mon, 18 Jun 2018 05:45:19 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wm0-f71.google.com (mail-wm0-f71.google.com [74.125.82.71]) by kanga.kvack.org (Postfix) with ESMTP id 26FAE6B000A for ; Mon, 18 Jun 2018 05:45:19 -0400 (EDT) Received: by mail-wm0-f71.google.com with SMTP id w21-v6so5182169wmc.4 for ; Mon, 18 Jun 2018 02:45:19 -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=f1AS0rDHhCxT62oyo0eTh+vZjglhq92cQLpt3RuGN3A=; b=kKsKWQkWKd6O9qcAAzNobPIkNkvOZQwcTjCOSx8Csgtayxt4Q2ZHql4d9CpGaNjiBg VutLqrM4RZoR+wiyNudLkfER13grFx4+cozyzEgnUzhyYzW6o0k5wJ4gaX93X/AvA7Nu 3jwMMPBraaCOqMLx1CGppPTVo216GsaKXyBkyh6UhQaVDypaEUEymONiWiucVgV8iehp 7/72jzn0FnEtvYofbzxt26rPmcYF58IfsiehzSJWl/7fHLHRC2Jor7kym+X4pNqYjSvp mb3fGwX3l/R5iHdCmcvX85tWe7x59jSZohJN+pLZd5ao+vNFqOGBGS9nf8bwcw9k5kFu lmTg== X-Gm-Message-State: APt69E2v4lVFwf1J01q8tPqFXxnmH/0tBuu3oqo4hhitP0ircJXQ1zKE zAInVwg5N28TTtDxCo1OGQRUot1TrGSSK6Lrz+gvVB4SiVOzkdZ7KbHcpnh76+SgKhRI5eEbIOC 45C08B1PY3gs9SgsTyC82M5sal48XbzedGa/8XhAoGU4AWoTKziukDgzMnXEsoDmZAQ== X-Received: by 2002:a50:a806:: with SMTP id j6-v6mr10645249edc.138.1529315118690; Mon, 18 Jun 2018 02:45:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLAjAqxbied4A0330nLYvksIGXTv+EPFDFaC/FpyFeg/GWhwhPyYfXDJmc75ZGm5jxD3MgS X-Received: by 2002:a50:a806:: with SMTP id j6-v6mr10645192edc.138.1529315117475; Mon, 18 Jun 2018 02:45:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529315117; cv=none; d=google.com; s=arc-20160816; b=w+g6b/2xhHdDk1R449VG4ZNPsatFy495lxLXgMymUp8RLn8VZ856SlBi8WHetWLw63 8S6iWi+S2rw2EQ+J3spjimEublDjf7rLoBAg7GMQibcbbX5FPOJX3r65wYaMGQ9qJ/+x gcGvpzydnktKPqGH43qtqyxih55J+jh0prkHpwPgxzP3iurLgg1g5c1p24ki3imreu1Q s8lI83Kcae5itoi/gbTrrWT/hX781d0QC7RAPsKTX8BM6FHW7xI1enhFB8jZqnxKXgz2 7w1dx2bAUU2YknxvrATENYq1oNFAUb+LNk70GpQjTDL2JHRN2DBTBDAYgUSTFY145fgq ZsPw== 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=f1AS0rDHhCxT62oyo0eTh+vZjglhq92cQLpt3RuGN3A=; b=w1qPRPVFHYkB69epj5tMG9G1icRGDrbk7dBWMwcKi1zlj+SCtUphdkmnqlCMm9A6rW 0mz7MvBg8IJ6C0Ns3sOyOZX9TxEWdmCTjJO3c9i47gSaP51uMv3qD1auCAtV3zvo2h5B cfVw+2jRNw1XNbfGrVV685JuWZqinwmdaGknEZrOwt4tF80BoeGcq951akysJ0YSsA4/ qedosWuUa0Kws+KzF04imsboW1AG2EFfrXdNZilxdlJptMasDANfwAziP7/ix3+M08S0 iGLLThiwszuYKqRZmAQEJDlZYqa5a5wZzKcMRjUbkx9iAzJZhsnRbqxemehEXQq5LMKV zasg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b="L1lXoVO/"; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.2.120 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0120.outbound.protection.outlook.com. [104.47.2.120]) by mx.google.com with ESMTPS id g5-v6si9043299edc.349.2018.06.18.02.45.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Jun 2018 02:45:17 -0700 (PDT) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.2.120 as permitted sender) client-ip=104.47.2.120; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b="L1lXoVO/"; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 104.47.2.120 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=f1AS0rDHhCxT62oyo0eTh+vZjglhq92cQLpt3RuGN3A=; b=L1lXoVO/6hGlDtn2pJoMnphwM4XXTqGUpGGW1R3R2RkmR3IHi5q+Uxb+0ucmjH+UOkel8IS10QkFjE8ocBlyb0gXq58AmL14YPbFXAXyJZTNW8VUxNcdtXfUOrpt8tFrHJFToZvZKFJ5oq1XIN8KKIZKWH/B495acjxLwFTSeS0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=ktkhai@virtuozzo.com; Received: from localhost.localdomain (195.214.232.6) by AM5PR0801MB1329.eurprd08.prod.outlook.com (2603:10a6:203:1f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.17; Mon, 18 Jun 2018 09:45:12 +0000 Subject: [PATCH v7 REBASED 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 Date: Mon, 18 Jun 2018 12:45:09 +0300 Message-ID: <152931510922.28457.18115445564323612603.stgit@localhost.localdomain> In-Reply-To: <152931506756.28457.5620076974981468927.stgit@localhost.localdomain> References: <152931506756.28457.5620076974981468927.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR0802CA0009.eurprd08.prod.outlook.com (2603:10a6:3:bd::19) To AM5PR0801MB1329.eurprd08.prod.outlook.com (2603:10a6:203:1f::7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f6684dcb-98df-4f79-36bd-08d5d500311b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:AM5PR0801MB1329; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1329; 3:XP7vo6/GMiud+Ucpb6TmMnYyxU9zQhfdEJFGcl0KY7uL7o95uQv/2r+YGGG8MmFCd6ZDjhB4j900bd6eESv4WpR5sGSJr1g/uQORGZ5qRJPJrvQzwO38TL/GtDBncVEebh2E1rb+22UC00ZwLcvvmTYzwkoaHLXgww+X3w150nldGmA1ftnZABcOfqDOD9IK7Kt6Yr70rYhMfsA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jGhIR28aYgoESzV6TfBdVf4bnH9itDxmQUee64voblJ88yPD9xKJZXsgML0cY+f90VVhE7fY8B5xw/xO0HnjwVfRJI5WPxY/Geq8jzVLkHRU9QB64xgNUjZ+J7D99XSZ89A0C9gdLNAQUlrB+WjZc+3; 4:1wBH1fs4WWZFnfdwQKyZsbYQpf2CJbbApPQ9woX2HlrOpojHB1adtluDfq25FbofTPDdcglJOZNot7MsoetN3kMMXCuAs4q8V69i/QOIgBg8H9EHnRWM62C2CjV3gqEudlwHJwZe4RPORMuOHWrQ7h+arXBUFe6kyLn9b7AW5O/cRZrBwJlw/l19+ZM4utGQK68Dj3dq6hWB4MIlX5MIZZgQSwuQFk1b6NtJpD4XL7Px6SnbTDLKzOylTQx8Y9J9+d/N878IEXFgiRtpLoYWv6ca3fyJcBoh3ZrCYXKrOLJFEB1Btq8u8PRugxIklQA5+nBm7MROFlFQUGGQAwgjw1ZNS+nkDlpldsJtXqG/UFbq2J4OSI39Au6UQdmnGLfolKbNNX8FD+davrLY+70el1jCUnJotiNI1fueXlMFo18= 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)(10201501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:AM5PR0801MB1329; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0801MB1329; X-Forefront-PRVS: 0707248B64 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6069001)(366004)(376002)(39380400002)(346002)(396003)(39840400004)(189003)(199004)(9686003)(26005)(52116002)(186003)(478600001)(6116002)(59450400001)(3846002)(53936002)(97736004)(956004)(11346002)(476003)(6506007)(386003)(103116003)(7696005)(76176011)(2486003)(23676004)(575784001)(16526019)(486006)(55016002)(86362001)(81156014)(8676002)(8936002)(81166006)(446003)(50466002)(25786009)(39060400002)(68736007)(58126008)(316002)(105586002)(106356001)(61506002)(6666003)(6636002)(55236004)(7416002)(33896004)(66066001)(5660300001)(230700001)(47776003)(305945005)(2906002)(7736002)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0801MB1329; 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?MTtBTTVQUjA4MDFNQjEzMjk7MjM6SUc1WlFTdEVDaVR3UmpObEJiVGxMakww?= =?utf-8?B?N3ZCN0dKbTVMY0V4SDRoa2h2WWV1VVhMTHZES3FBK0RxY1AyYVJmdENZUjhM?= =?utf-8?B?K3BzMWZOOFlhaWZ5SCtuL0JJbzZld0haUExKbEJkMEM3NUoyWTNoTmtzRm4z?= =?utf-8?B?b0oybDcveFFLTmlETUFCWElRMXl5ZFIzbktqTHROV3hyajBrZW5mWHJHZk5X?= =?utf-8?B?ZGRPdjEyalZFV1I2Z01NOTJUZXlJc1VSVnBPYk52LzFHeWxyV3pwR1paLzBy?= =?utf-8?B?M1Y4c0duT3BTQUJGL1dnWlQvVUQrMFh0WnVpVjNaU3cxK0RTekF2WktxVGgy?= =?utf-8?B?RGx0SVlpd3FUYjllUUlVbDBKZVlZWVB5NHNOZFB5djYvWm5GbzFINDF5SzZk?= =?utf-8?B?RzdnSWJ0aE1JWWtrVUFTVXpjOHhqb0lHZG91RjNQZzZFa0hiUFVXaVVVUnQ1?= =?utf-8?B?TVVXNlo0NmQwZTh5MnN6VVRMTlowM1FVTGRCT09kSzgzblZQR25nSElsUk1l?= =?utf-8?B?bUF5STM2dUNXaEo3eForWjdQV3BibVlyaXNZNS9YSnFYQ0owUGNo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BEjOFWS0L72A/ecKccCD10QaDV8Y1kBxiz+VyO26wCSIKnY11Xo55tDLIJlfStMi9JyO5sg07g/O7ECxjZqJjwBml836phxPstBh7vtFVWxdIAMhPtgH/pAljk/s+P0wEIDzGhDlA7kBNplhwfSg==; 5:7DgIdAXIONz8UlIcsDsPm2zUJBmuw3uVxxv3a63vkIe4a6jZQmBYL75XeFai9MunnBPEnojpFs2P9DxxWgqncJ5kHXn5ha564YGpPhHBD75BIYix0J3EfXHQSx72MJGufjcy0PgpFG3aB+lEYcU5MIqYMtCdFmwIMbO4DJZq0Pk=; 24:4K8XXBRPvnhhZTj03tDi8D3B5I7yokX7F3a8csVp8oeG+RNFtcBFN7kRMwssqVK3GUEdJlmzQfURKV3TR1bTpyFftfYUMtrAEz32sEvRZLU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0801MB1329; 7:pyuyWkwbQqTgcZZ65td7JxqWTzc2XRSk1VAkbt/4IrhCiSHt6XhZiBzJDx6IrFqOA/95mu77CY/+AyAfS2K+HD7Wc4UFuW6566omWqdNcUQl79vnAvokDohjpFpERQ5p1XsO+sttHgYVqAUrrdXxSJt2nKwj9mzYistsQ5+JJIINoVLXBkeC9Ldk4MzhHE8YTLiEQJV9ScMkf2rFXQ9z6KRNQRm+vYar7pHiaqAeXpp5vH84qgD8SzAiSfD5D44R; 20:TMekNwXVsgfKiST06HU/ChdLZGIfST4tWdYh1DMGKrDHJoo5p8UIsDDUJHg97d0jsRL7MkHhYL8l6YL7oxUsZreY2G0SHgQSaQFKqGlMnRJM2gh3DDyx45RiEc7Hzv8H+HnONgiTMrEJvtoF2do0aC3+2oTGWdzqx3odW1PjOkY= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2018 09:45:12.8314 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f6684dcb-98df-4f79-36bd-08d5d500311b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0801MB1329 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 6c6fb116e925..d9e38a7c0c05 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 87bf02d93a27..15d79ef7e460 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -723,7 +723,7 @@ struct task_struct { #endif #ifdef CONFIG_MEMCG unsigned memcg_may_oom: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 5a52f07259a2..d9025be3063d 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 1e3e2f3a2a64..7621084d5a7d 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) { @@ -290,7 +290,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) { @@ -549,7 +549,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 e6f0d5ef320a..fca9326fba99 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 @@ -2119,7 +2119,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; @@ -2384,7 +2384,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 @@ -2779,7 +2779,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; @@ -2879,7 +2879,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) @@ -4176,7 +4176,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 @@ -6003,7 +6003,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 890b1f04a03a..06f721ab90d3 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 @@ -580,7 +580,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. @@ -857,7 +857,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) {