From patchwork Tue Mar 9 08:04:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Averin X-Patchwork-Id: 12124315 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C427EC433DB for ; Tue, 9 Mar 2021 08:04:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4971F65228 for ; Tue, 9 Mar 2021 08:04:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4971F65228 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D85128D00C0; Tue, 9 Mar 2021 03:04:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D5BC78D007F; Tue, 9 Mar 2021 03:04:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BD67D8D00C0; Tue, 9 Mar 2021 03:04:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0240.hostedemail.com [216.40.44.240]) by kanga.kvack.org (Postfix) with ESMTP id A1BB48D007F for ; Tue, 9 Mar 2021 03:04:28 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 669BC180AD820 for ; Tue, 9 Mar 2021 08:04:28 +0000 (UTC) X-FDA: 77899598616.03.C622EF4 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10130.outbound.protection.outlook.com [40.107.1.130]) by imf07.hostedemail.com (Postfix) with ESMTP id 83429A0009E9 for ; Tue, 9 Mar 2021 08:04:27 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dOtSuKSheq1f1uud7BzmYy+HuWxlfbIrnr34sWPqKu4igh/5deInT0O8k9L08bLUajgrOKyBwDQsPSL5dbj9Tr5rgBVfkZ8dh7fzSYXxICKAk3mrvB0FKNr0mb4Fq5V8O1hpKTobwkXunZNV28Il0YNsTVvSgORIvLINhp0cWLguq9ktT8gCDseoUbld3GUD1udVGTsDeH6jajKnAQ8PMACRtSJtkK+aop3c13R7jcOvBVYdHx0S9Bu3qeZLqP5AZbu/aant7nej5MJppL95wGVSntw+vKCAJjC4FEkRw3VzLt0alnFnciwGr0z8t9ATVW7Q/B5akqdFqDZLS5AQVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jOmah3Ttr9Ux8KuZu/qKnk0qr3VbDotJHjS20FoIgVc=; b=iX7XJCDRNvvtd3ncUfVyVWkCHCGNq0vyXEk2qRNJWEDSTr8VOSDjQ1E/1gbpxGyikGd/EGicTTQ5Fgi26Hglgac3z2KMK7JZgmJkF5bWyWYNEQZ2eeKP29UEDwbUlHkecRFPDSnOTtoQHrvzFwkKQNv+BKxqBrTKgSbZTLRrCfFOZAdhCS7M/2JEEmIQIAbiWhn58rQF8utFPHttc28/qqlpJV69SscvPes2IcpR3rTSTZhPPgYv8+VeEe9TKhvJgDRxehSGxJZem+Zp30gSJzsDwr+W3xej1uUqXhRDHBxigccviJiAK4jvijVfTbRXwP0h6tuTbtqmKhyEBSp/cg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jOmah3Ttr9Ux8KuZu/qKnk0qr3VbDotJHjS20FoIgVc=; b=RQSuWtKu7YNKRzV4JUL3gFPUTNYuL+FCxfgShJ08jNC3cze6gXt9sznoQnve4759qYUFlj8UQ+ce5Q2Eksio7FGqzP0fK2SYc6u6BnJkiFzETOxTb1zNq4w0dsaARVD1KayMbFK/SIj275w+QxOObiQiysFbxzWTaG12JXcrNM8= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=virtuozzo.com; Received: from VI1PR0802MB2254.eurprd08.prod.outlook.com (2603:10a6:800:9c::22) by VE1PR08MB5789.eurprd08.prod.outlook.com (2603:10a6:800:1b3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Tue, 9 Mar 2021 08:04:24 +0000 Received: from VI1PR0802MB2254.eurprd08.prod.outlook.com ([fe80::e4c3:b366:458c:c613]) by VI1PR0802MB2254.eurprd08.prod.outlook.com ([fe80::e4c3:b366:458c:c613%11]) with mapi id 15.20.3912.028; Tue, 9 Mar 2021 08:04:24 +0000 From: Vasily Averin Subject: [PATCH 5/9] memcg: accounting for ip_fib caches To: cgroups@vger.kernel.org, linux-mm@kvack.org Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov Message-ID: <6f182357-0a06-7f27-8684-22198725ac5d@virtuozzo.com> Date: Tue, 9 Mar 2021 11:04:22 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 Content-Language: en-US X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: AM0PR02CA0018.eurprd02.prod.outlook.com (2603:10a6:208:3e::31) To VI1PR0802MB2254.eurprd08.prod.outlook.com (2603:10a6:800:9c::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [172.16.24.21] (185.231.240.5) by AM0PR02CA0018.eurprd02.prod.outlook.com (2603:10a6:208:3e::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.26 via Frontend Transport; Tue, 9 Mar 2021 08:04:23 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b6ebc230-2eb8-4563-55fa-08d8e2d1f3f2 X-MS-TrafficTypeDiagnostic: VE1PR08MB5789: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:972; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pbdpcCATu+3+RtliJHYVsM4gbtw9a5bD00AbDawPLzbSxuuGLptCTMJXpkuR03tk355IwrxBuDJKDh7ayXCK/Ul258tZqvSzPu8GVP1o3RgUtqr6fI6Ej04AhW1vrbCMcWxVFjLu0NTlCIg4H2OSOHP5NynuYok1AR+1kGPkhjsYzaI4iA/1HlQG9bulw0A/iI3EtguzGVJCsXLPXhWfFJ/ggFIhSxTFFECyS14hYQM+KiU9kaKjIZcekro5PYmghEL8zObyPlG16ErzoOT5LvL/xQx2pln5zxffmgU7ytxsNvNu8a+nreB7TdiVzeQCmcv6gN7TpvBjH0lNEw7rO2DA0so/JmStQ8IGhJssFYbVHYZiUifHdTR8riZn+MU0frfIFDezY1qy45pvXs+DvDepJJ5sTQ/lCBJiwGWtI5pCfYusxDn1Y9NV6SMMeINutatX/MulzjIzyB/zh1fywFfAVOFLtF3NzjGOOxfjMZPK6cn/dM9hQAAYeRzPgQoE4zKoqeog6R8bu/l6aPI95XNyO+jC6JnQpy28j8Rdi7d//H2Qbl6niFi/94aybKb/Rvq2BLG7urJmca8b2GxaPCs5R9Jvlila5KebJGSdWwc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR0802MB2254.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(346002)(366004)(396003)(136003)(39840400004)(376002)(26005)(54906003)(31696002)(66556008)(66476007)(66946007)(36756003)(4744005)(186003)(4326008)(83380400001)(86362001)(478600001)(8676002)(2616005)(5660300002)(6486002)(16526019)(2906002)(8936002)(31686004)(16576012)(316002)(52116002)(956004)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?vShqCrI2tvdSlkmG2cojJOesW+iAAk?= =?utf-8?q?HU4Ul3tdaQGfuRrJUu7v57wsVuHUGCqnGtoL12mA16EcIalVLgZjSzJ5fLo1uNF+O?= =?utf-8?q?wCojOdPvq3vYBIM0+2NYVAtAI3t12kpIpp4SsZ6oNWQeEblSwkHmBSh1H92G2eHk4?= =?utf-8?q?O8yQhEfgEPJa9N84NJhHkYJCUnL8+t5JTCDXNhbDZo9u61Vn9R02yOuxf6g4fdIOE?= =?utf-8?q?uPvovnp7LxYufrARGgk1EI75i0mtFry4HrIFdq5yvjbRcgw4xZfOLE5ERMKIqwkSg?= =?utf-8?q?yBzCnE0MyrX7yYQj7P4c4dRCq00iEBo2E9pzl3lkQjB+IJSabZgOQgnCVOgH5jUzj?= =?utf-8?q?cQZYJ1CmWW/NqVvK8VSDW3M2lxpFaZrwaFGHMwpq8ZwQ9McLEVIPAJ0tcY7+M5c4O?= =?utf-8?q?wgY/5zBSfW8PHxIzpL6HqHGd/lw6EM+GLSZ6/HLBX5lvNRr0QnF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CrossTenant-Network-Message-Id: b6ebc230-2eb8-4563-55fa-08d8e2d1f3f2 X-MS-Exchange-CrossTenant-AuthSource: VI1PR0802MB2254.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Mar 2021 08:04:24.3082 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dJRsHSm9k904wpiROI/htbiAdKwGjtqDhwGukWklR8vVLuHXhqHV6HiyuEH54k+sa7z9NwwBA1/qkQ1uk/ni5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5789 X-Stat-Signature: 8jme3k44i8xbshphjngccsbfmfd5thqx X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 83429A0009E9 Received-SPF: none (virtuozzo.com>: No applicable sender policy available) receiver=imf07; identity=mailfrom; envelope-from=""; helo=EUR02-HE1-obe.outbound.protection.outlook.com; client-ip=40.107.1.130 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615277067-616851 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: Objects can be created from memcg-limited tasks but its misuse may lead to host OOM. Signed-off-by: Vasily Averin --- net/ipv4/fib_trie.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 25cf387..8060524 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c @@ -2380,11 +2380,11 @@ void __init fib_trie_init(void) { fn_alias_kmem = kmem_cache_create("ip_fib_alias", sizeof(struct fib_alias), - 0, SLAB_PANIC, NULL); + 0, SLAB_PANIC | SLAB_ACCOUNT, NULL); trie_leaf_kmem = kmem_cache_create("ip_fib_trie", LEAF_SIZE, - 0, SLAB_PANIC, NULL); + 0, SLAB_PANIC | SLAB_ACCOUNT, NULL); } struct fib_table *fib_trie_table(u32 id, struct fib_table *alias)