From patchwork Tue Mar 9 08:04:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Averin X-Patchwork-Id: 12124311 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 4903DC433DB for ; Tue, 9 Mar 2021 08:04:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C58F565295 for ; Tue, 9 Mar 2021 08:04:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C58F565295 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 520B28D00BE; Tue, 9 Mar 2021 03:04:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4D0F28D007F; Tue, 9 Mar 2021 03:04:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 34AA18D00BE; Tue, 9 Mar 2021 03:04:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id 1A81F8D007F for ; Tue, 9 Mar 2021 03:04:09 -0500 (EST) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id D72CD180AD820 for ; Tue, 9 Mar 2021 08:04:08 +0000 (UTC) X-FDA: 77899597776.29.8976BF6 Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140097.outbound.protection.outlook.com [40.107.14.97]) by imf23.hostedemail.com (Postfix) with ESMTP id 832D8A0009E8 for ; Tue, 9 Mar 2021 08:04:07 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hVw8+SuGMOP0WcSfTcRwrae0LPyxq2R7Qm327Fy9cezf31xEBSagOT7J4RmeZG607a1P9Gj6x0Pv6GTQHDU6MlSEXDaVC/mLMwrXjAePXtB3qk81x6oKyllUTMBzuIxBDjChVuMHC5rwnV+j/wCTvrfhifHOFsmMc04sh6EgCm8Wli7kELWlnMhmYbLeUBx9qlHnqSuiHVdGnunZ1uru/RC6sG8Pa3kc1hC/hJZLq/AhHpTlqVUN+kn01lC8u9K7SipUFI3l2o/sL8ReQHrkiG/l4Hpv7e//f9GW8JmzXdjkc9KQvVgaVsbNY+yuLH3SdOYy33RI72oWnn+0sJ24CQ== 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=hJ2iE90uFKsfL0YSrlpqtiN1MHH88JEy6xn+wb4EZUw=; b=C7W6VSsoMj1S0Vp7N2GNO4/tJaVhuY1H8GHHj8yaEM2qrtTpLrH7/8eVzlvsT4QcPjMiAtYgccVBGOto3Ya9Ftx5cUpNeL1XaRJhAlQYaTHKa5eKBoumFBeZZ5/wURrPz3KfTlIefbP0QBE8sKOa/APH6QejfwUg683VqO34cw6h5hZ8OOulT5jC/3JppDUn7biAQTRz+K0hyj8Bf73Zq5njv0xcE38PfFIPXR5HYOSSjPL1y5w2eUG20NplLi/fk+SVLpr9UzpghEVCrvehVmEQuS23dh64PShY8P8hq6I6j0u4yJU62f+zgx3ZT+PA8ycUT23/Gx8fdlBzSTwjLA== 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=hJ2iE90uFKsfL0YSrlpqtiN1MHH88JEy6xn+wb4EZUw=; b=B4dDQJ6GD48Ju+gX+6I19PxEniXVL0kBNwZLBRj9NBBxtcxXCQu+3fWVyt2e6JvCHy+PJlsPhrnPw+bEOnVj3ofn5SFCSyMUowyzGuisPIOW2zxMDBNz6UBsSoGJO8oBOambjr2mLuvSYXS6knvEb/neyFXtsPzQDaYyWEp2fQs= 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 VI1PR0802MB2511.eurprd08.prod.outlook.com (2603:10a6:800:b1::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.26; Tue, 9 Mar 2021 08:04:06 +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:06 +0000 From: Vasily Averin Subject: [PATCH 3/9] memcg: accounting for ip6_dst_cache To: cgroups@vger.kernel.org, linux-mm@kvack.org Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov Message-ID: <6a9a651a-b609-01fb-56c4-01e134c9d534@virtuozzo.com> Date: Tue, 9 Mar 2021 11:04:04 +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: AM0PR02CA0012.eurprd02.prod.outlook.com (2603:10a6:208:3e::25) 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 AM0PR02CA0012.eurprd02.prod.outlook.com (2603:10a6:208:3e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Tue, 9 Mar 2021 08:04:05 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7a77bd19-8695-4034-8fe9-08d8e2d1e93f X-MS-TrafficTypeDiagnostic: VI1PR0802MB2511: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1201; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zFj+eAGJgvuREaL0J4T9erxYiV1va5qs2bHJBe5j+90RotPHtcnt70LhJYbRdtckXmY+K/ZXrA3QMMTmEB/1mvFqwdH+3M8t55Q7wPBFQZL1EPYNPdUfCl9A0mmHznIEHb9yN39vjzJpytvge79Cd3oKs2uvsYWvcf3/copPwZ605GSzxBchQCR2NX6amOLGVXq7Y6OyMvPiuujVeolBS4v7YKiy5msmTgTNraDVTiwB06DAw6nUdDDZ5/1QlAn24ryclyKV4Uf9R8Na6bmRc1Hbs3Pf4QuEmMvxZ0qJzC1Sg5hZgXnubJpbF8cozIwyl167/JLcHQraf9LLryYNygAZNb/4UNN+VMlDKwiF36wm2BVIGl/WkYXDt+2MlddRbGX44Ei944pdHw4fpMtq7CjO0skqN/rQ5IL4wbe4uWsC8pAcy9v63UCXc0qxYEypX2mrB/YOVI+27C0QS1jbRBXbGlYt0OQNsNShr9lTPxQ5KFzkVKd5/MF+mI+m8GEfvOvSln0VE4FIndBk4KZqMnwEjqA8XRJwwhywzsQqJFESG7RwrqDD/hvmMZSpT7VBbALdfCgFOUsILI58xZ+P+uDaUdrpboOni8sgNh++7dw= 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)(376002)(396003)(136003)(346002)(39840400004)(366004)(16526019)(66556008)(86362001)(6486002)(2616005)(8936002)(66476007)(5660300002)(478600001)(956004)(4326008)(316002)(26005)(83380400001)(66946007)(4744005)(2906002)(31696002)(8676002)(186003)(31686004)(54906003)(16576012)(36756003)(52116002)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?q?NN79Z23yNJJWMKBNA+CepMSKcn6c0J?= =?utf-8?q?azxbDFO/afAJ6JO+lXbzE2vmxnoQBwzNy/i08fHKGC9CzAaXSMP3ISikwgpVqcZcc?= =?utf-8?q?fjRcFMJBeEXyhzH7T5fnOfqVapnkWwGU74TPEdX3KNE4hFAbYulnY53RWpLTHFWfx?= =?utf-8?q?4EvSs4qKEYnIfidZr0zRuItq4UIhtYPXjKDuOdoKZpuc7g1hK9Ea6Fyf12kf6+9Ps?= =?utf-8?q?vW43jqOEUoxJPV9Lb6qFLHJm2/pJJn9IKpPu7WhQaeKP19e0FfqifVyd9gDoLF2Ov?= =?utf-8?q?KcibH2zTnj/VBy5CLFQBHdqYsgYjgq3RechIYcm5T5LXZvQblPwH7Luw8+MFXfxuc?= =?utf-8?q?le6Qu9ixtTN8E3jHLRZdvizu/Iq8S65/MWg6VRQSklWB9Y1U0e3G72B8AaQu1/Q12?= =?utf-8?q?aZuqoEeSS0SgItd4lbGIbHjlI93Gw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tuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a77bd19-8695-4034-8fe9-08d8e2d1e93f 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:06.4983 (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: jkKQB4HX8Wpda18qt6yuB+VIZWdSBgC+ZneYqPTLUwkwkNSnE4vVfsjB2z5MH1HbaxVOy/wv2azs3oxJRF7pJg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2511 X-Stat-Signature: f3rarc6gtkt5xb98fwao1qrjgo5a6iji X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 832D8A0009E8 Received-SPF: none (virtuozzo.com>: No applicable sender policy available) receiver=imf23; identity=mailfrom; envelope-from=""; helo=EUR01-VE1-obe.outbound.protection.outlook.com; client-ip=40.107.14.97 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615277047-177946 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/ipv6/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 1536f49..d1d7cdf 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -6526,7 +6526,7 @@ int __init ip6_route_init(void) ret = -ENOMEM; ip6_dst_ops_template.kmem_cachep = kmem_cache_create("ip6_dst_cache", sizeof(struct rt6_info), 0, - SLAB_HWCACHE_ALIGN, NULL); + SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT, NULL); if (!ip6_dst_ops_template.kmem_cachep) goto out;