From patchwork Tue Mar 9 08:03:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Averin X-Patchwork-Id: 12124307 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 E626BC433DB for ; Tue, 9 Mar 2021 08:03:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6C73F65295 for ; Tue, 9 Mar 2021 08:03:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C73F65295 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 040328D00BC; Tue, 9 Mar 2021 03:03:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 016C28D007F; Tue, 9 Mar 2021 03:03:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DAB328D00BC; Tue, 9 Mar 2021 03:03:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0107.hostedemail.com [216.40.44.107]) by kanga.kvack.org (Postfix) with ESMTP id BE79E8D007F for ; Tue, 9 Mar 2021 03:03:54 -0500 (EST) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 7CCBF181AF5E1 for ; Tue, 9 Mar 2021 08:03:54 +0000 (UTC) X-FDA: 77899597188.04.CA0CB37 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130129.outbound.protection.outlook.com [40.107.13.129]) by imf08.hostedemail.com (Postfix) with ESMTP id 0EBCF8019142 for ; Tue, 9 Mar 2021 08:03:47 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kS1uw8sBdvqHppO3a8O/2popHhBiOIcrPCd/2xh91elFqkAy7dtDKGR7fNXdA1LhJEsTjuM3P9ro16XD2/9i4XzISnr45b1gclE3lYsA9F9FAZY8S6BzTwkTvDnJ+qdUyKjOEQzYQIX8GezdRctenI9jv4sSml/iMN9i9yE75pAehYhsQwb+VvMm9ViIOKXABqoHfbQCf5qFP0xp4dc8RJV6TTDL7xsVOEB+JTScd9aVGe+7/NgrIoHbWxV87b1ADAXa5hqBC4yXg23VYww6JiObeP9djdZX+Q+6kF02azFFkXL8OM6l9ppJ5F7I/BufaCnjHPGiRH38f6I28hLZkw== 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=C5o8mkc1Zj8mwSqxNhwynoe0HUtQdQ5ByM2Mvj+TwRE=; b=RTtWSzCa0OPCPXil+Znl4aUP3rs6hXYE4Za8r9EKlF/VG29q9FMyV6JH+UMsEKW63wKoZ5+bpCVN8d5KcENYLaL2NIEqLDAB/mHoxrQnzsBsF0YiVkrj8swK9cXTLifOlIvg7CpE6eEsrPETP5H5pTVvbOy68OMbitXXMheyymPUNa0Agss4zQtKSPi+/Vdu6IgymXC7ycd3RIHKaLfrHcXzXTGuSXULuZ3y2hE+YpcxnH13X24NupM8Gxzo8szVa8muyh4SL3A9q7wSLMw77Q1IA32SORbI7QoZpxH5gu4+nKOqrmHy74/6g5ViRGNWXseOj03l5e0yv8iN7LZYlA== 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=C5o8mkc1Zj8mwSqxNhwynoe0HUtQdQ5ByM2Mvj+TwRE=; b=DkMpIobrjefjSXZtSghiTKUWp4uff6vm9fpRtU1WBWcV1PYzM+ewJM1bLR3an8Bq2tdAd6P0h4wLKoIvzr3EYp2erx8PYrHBLGK802XcrZ3TyukFkBavAB8AhbZOTsAmil+ZhSLg58hC7gnvPvpY0Csrusg+Ao6IYplNsdq0ikE= 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:03:51 +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:03:51 +0000 From: Vasily Averin Subject: [PATCH 1/9] memcg: accounting for allocations called with disabled BH To: cgroups@vger.kernel.org, linux-mm@kvack.org Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov Message-ID: <18a0ae77-89ff-2679-ab19-378e38ce2be2@virtuozzo.com> Date: Tue, 9 Mar 2021 11:03:48 +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: AM0PR02CA0013.eurprd02.prod.outlook.com (2603:10a6:208:3e::26) 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 AM0PR02CA0013.eurprd02.prod.outlook.com (2603:10a6:208:3e::26) 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:03:50 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d5c8acce-eec0-476b-aa27-08d8e2d1dff3 X-MS-TrafficTypeDiagnostic: VI1PR0802MB2511: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qKQ6Ut/YpwJBbutVJs3eyP4VSYIBHGj05XeqlVAmkXhT5pzweQ1JeaUsEmrFCUngYeHDYhUZOCqm+iSyApwG1hZaRondVbjD4x2V9irNOuWvtqecAbQwqBP47nU0mih9hIURrXqzGtGNdc1o9cd6k99yei5gwKDksloLaJXzNpUVj9Wngoou5k33dU6IHsc9V49y3pbQ/stOYo4GUEctKeE14pF8ktCTFvqD8Aq+ZscgtmCOQ2wmwDKZbb0cTSGQ4MfBUoOrenN7rWXgI9MgehBvDptgG8UFwTsWfVSQGLEM17It3xTAX6jtgwmuZH3e3hlKxuWrFCyVqUWiH7qF6+tboQ/hxcFd/21zE7SPh33/XzDr4n9cRx+C8MRZGxeIx+FEH3QE/sTvq2L7gUy7wVreFBRHbjPTdOCduIuiSmVrqCnz1v9qE2kQqYYuYI4RhKUPCiJdn91UzcV9Pei1HdjTmlg4fYoTLcGLw9MgEKIA2wlJmZRQXpc+hTltOrMnHwiBEPgR6Uiahw4AJPLasM187otYsNRBjCswf4Ez1z35C0rgWWm4T3A2lNTVgG/Efey66XpPrpBjuFlZUHIgxXFHMkGknOop+3A8j/D4Lfg= 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)(15650500001)(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?q5bHbk0Xq4+Pxd/pu8aedXyP2SOtNt?= =?utf-8?q?5LyDAzdJkoa9yt6/TRCaLbG4cd2VhRw0LsanOvpCq9CMuDJo7qmTzKZralkb/L3mm?= =?utf-8?q?/sz2rhFx+BctFJIZfoqVNkruM1VIJKAoys/+i/npEnknsYqaVcrq/Kq4nS1o/tC27?= =?utf-8?q?96BG3O3s/BrzoRHKQSZkufrr+iEDx9PTTu2cgwLCOC4M2gSUeLZy+YLrzAaMWOoHv?= =?utf-8?q?HxeKQrtqxECIYhZYsofhSTvq8mfWyCOfQ8nA71xHrL59/TxRysR5sOh0iB8RMte+a?= =?utf-8?q?sSMltpy0gaBV5yirWA2pV/Dj+1FiWNxPHStb3zmYB8UhSQn5hTHfVagRnbjqs4/9c?= =?utf-8?q?mYVIfc9kG4RSDrP4DMmYpe4rCQgNx2ADX8WM/uWSLx73vEFdhuZm3O2WwawnMAaZX?= =?utf-8?q?a73YJW40ysCXB+AuzER+MYnbsWZpR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-MS-Exchange-CrossTenant-Network-Message-Id: d5c8acce-eec0-476b-aa27-08d8e2d1dff3 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:03:50.8684 (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: xp0i88TSW7l96J/t9JQRTUWcJc54gBAh3PbRCAYgBaLo+otAMc8AmOMoeGzhVKMnnE6JP8RADvCzwyYdbNSxew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2511 X-Stat-Signature: znoxqitj1x7e3rigew4guqge8teyepf1 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 0EBCF8019142 Received-SPF: none (virtuozzo.com>: No applicable sender policy available) receiver=imf08; identity=mailfrom; envelope-from=""; helo=EUR01-HE1-obe.outbound.protection.outlook.com; client-ip=40.107.13.129 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615277027-202958 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: in_interrupt() check in memcg_kmem_bypass() is incorrect because it does not allow to account memory allocation called from task context with disabled BH, i.e. inside spin_lock_bh()/spin_unlock_bh() sections Signed-off-by: Vasily Averin Acked-by: Roman Gushchin --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 845eec0..568f2cb 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -1076,7 +1076,7 @@ static __always_inline bool memcg_kmem_bypass(void) return false; /* Memcg to charge can't be determined. */ - if (in_interrupt() || !current->mm || (current->flags & PF_KTHREAD)) + if (!in_task() || !current->mm || (current->flags & PF_KTHREAD)) return true; return false; From patchwork Tue Mar 9 08:03:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Averin X-Patchwork-Id: 12124309 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 6A89FC433E0 for ; Tue, 9 Mar 2021 08:04:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C6C2B65272 for ; Tue, 9 Mar 2021 08:04:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C6C2B65272 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 5701B8D00BD; Tue, 9 Mar 2021 03:04:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5464F8D007F; Tue, 9 Mar 2021 03:04:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C0048D00BD; Tue, 9 Mar 2021 03:04:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0039.hostedemail.com [216.40.44.39]) by kanga.kvack.org (Postfix) with ESMTP id 1F00F8D007F for ; Tue, 9 Mar 2021 03:04:02 -0500 (EST) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D44FD173084F for ; Tue, 9 Mar 2021 08:04:01 +0000 (UTC) X-FDA: 77899597482.22.AE4E28B Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140138.outbound.protection.outlook.com [40.107.14.138]) by imf30.hostedemail.com (Postfix) with ESMTP id A8559E0011C0 for ; Tue, 9 Mar 2021 08:03:55 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IaYUwQXsDJ40La1ZKDyRUpO9ur7Ge+cnsG8FJdA6/PDf/mRHYGk9MTELmLnVZAU/+H/FPDHMPvvyaPqckCluUfvWaPxryZZFrIAB4MyPokCXlmYHzV6pyAcvXqujL8nBKTMjT1gPII5O3BJTLuODfy8mgUwV64tvCjp/+E8ZeSQiWBZodLXHsY3+bJy3AC5hwwOwvjG2N0qI4PqDopVFq5HWNbZ9toKbynf/z7dmgiBdc/pFW/tMR9ypeGoGbwXzaOnAGQVl7QaL1K4g7+Z3FJ7uIPZnFCM6aEgvzuquh1bH8fiTghD9TRYjXt/w9+sbT6GXdr2+4ULD3c/ko+n70Q== 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=Kv57v9wwkEkRFk3quNioC72lkLY1VHt10WJve0iQRuY=; b=igHhA65iVcKq88wXiKF6R4/hMAlJK+I/LCz4whRKMWPkYSrOgiT272+11rQs/BlB0ZqxIZbDSkVxT9/PhgX6CIrOQ+lXCohvM1HGE1d1KeAwtJifXfB71u+SSKRPzmoOmQIaohXJfbpqIOpD+lNyPcXMqsFwaET/IJjeFafOqTuZmPp2u6Oqhum2Kn3ldPIen8u+5Eo8jfC6pjLHZR0YoI43PVx6xOkgfR++sIOkeIMcstzqTD9u4/Gue9h6Ir7yMftHGoy8E9du9EgASnUV6lLsj36c8qu1RimVhDUTZUpv5d0mH//a+yBQDC5cg69EpwO2uGdx5PdOa91rmfS7Iw== 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=Kv57v9wwkEkRFk3quNioC72lkLY1VHt10WJve0iQRuY=; b=SUj6B/84e5vnSMKxM46a+k4e2HS1OaDa7AZBrUPRiMnFuiuDCwCKYkMXItyH5uYi9rK/NO6XGWrZTJDpabXJ2f57QRrA0erJzRTXDFHW5DeF+31LZordwKwnWysSxfA/KWd3ePSIGU9BHqtHU5s1IJ3W8vxTDAIvZ16R4g7amuw= 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:03:58 +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:03:58 +0000 From: Vasily Averin Subject: [PATCH 2/9] memcg: accounting for fib6_nodes cache To: cgroups@vger.kernel.org, linux-mm@kvack.org Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov Message-ID: Date: Tue, 9 Mar 2021 11:03:56 +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: AM0PR02CA0008.eurprd02.prod.outlook.com (2603:10a6:208:3e::21) 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 AM0PR02CA0008.eurprd02.prod.outlook.com (2603:10a6:208:3e::21) 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:03:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a3116cd4-d334-4e04-576f-08d8e2d1e49e 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: qQpclr4eVqmBpkYhv0Hkht6TGNjjCUQvOmqO9ms6cGRVmpl5PvQ9fK8cknZLY0S/TMS6l97H0p4O6mnvfNKcz2EiVR/iH7Gdt89ZpcA7XXHRto39dWBPji4SJlwLBBN312A5SUQyXBTMaSkjfaE7kZjkkTtjI/0neOrYtw/Ggg6yvBkj3h08Ut7XP/4D/V8b9+TTfgpzCi7uLXgGybvpJUiGlDQzrPIo7GPWapKwUSAHTED9tqmYidVk9grh65JTe49YgH4spCSdBjeXqSLUpJfK/FSklrsKvzffAzlJvy82Hnc7qmFVq4s07RwNRC5DG+r+nrRecKlSlXsE2c9cLS7ATsuCgjC+R6rgYcTVwep8ak6hfwQq76l9Fy4DPHgzq0bh5WGNcUV3ZPCbqIb/NPzEVMjbaxJizYsICegFuZyGVl/gWAdDgdYLIaSDcjWL9WPANMtQ4ZM2UThuBpBIX7z1lzNXuJVkg5duI4A34wDw01mfBF3rmBtA/4kKQlUl0TX4oVi2Ea3e429MkSj8tj70WtPmHVd5KRmiSVF1QAVGjuISXOyc6Lr0Dm9oh2dDMpx50yFpe7D11dR+yzJAAwH/b+uOfK53ny5ckj7ZAoI= 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?WlRcXfkJiegt3gwXz07ZMV4ofiQHBo?= =?utf-8?q?VOY7dQvIGLvIo99Y0Gr+lo1Rn4BCPXd93ZXbq1rAAtzIaKC39ArkUuZ4GSDX2kaeK?= =?utf-8?q?kTh48dMAUS0dk/axPj3wcWyT1o06WKuL8TQAgzEWOST/4T9d3OekONtj4m6IPblkP?= =?utf-8?q?2CkIwkLWk3jDSf7vBLdpriUIOcStW5w3u67DcJPB1GMOBZzOOZ1y6jc7+NUBqaZ6W?= =?utf-8?q?Fgg1NSxJGjeKkO30d9UeW7ZgIoLBqzYGlArZ/OJN6MCJjKf4pTje19rDv/CTUsAvV?= =?utf-8?q?JBHBtv1cofiKu1KfTcKQhWDufI0w0vAYih8MUkFk2FU4CXuMmhA2840J3UPMf+z7I?= =?utf-8?q?Y3vbAmePooBL5Ji/juuJlb9BtpVBooCS2TxPAW7W2E8PHiaimZHWXJWbG251uWsU0?= =?utf-8?q?7G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f-8?q?uWZJIXjlXwD/7H?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3116cd4-d334-4e04-576f-08d8e2d1e49e 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:03:58.7158 (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: Y5LbmpPtdY09VbgDWswd+CcEFuQZIsK+XyXNMqHuo8Eu6o0t1C+Hh7cbtzURCxaYQZGOG2XgDFZdvwK3oqf8Uw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2511 X-Stat-Signature: hazc6sakbptcd6oz3x5bghtkz48o4bse X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A8559E0011C0 Received-SPF: none (virtuozzo.com>: No applicable sender policy available) receiver=imf30; identity=mailfrom; envelope-from=""; helo=EUR01-VE1-obe.outbound.protection.outlook.com; client-ip=40.107.14.138 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615277035-22772 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/ip6_fib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c index ef9d022..fa92ed1 100644 --- a/net/ipv6/ip6_fib.c +++ b/net/ipv6/ip6_fib.c @@ -2445,7 +2445,7 @@ int __init fib6_init(void) fib6_node_kmem = kmem_cache_create("fib6_nodes", sizeof(struct fib6_node), - 0, SLAB_HWCACHE_ALIGN, + 0, SLAB_HWCACHE_ALIGN|SLAB_ACCOUNT, NULL); if (!fib6_node_kmem) goto out; 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?le6Qu9ixtTN8E3j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iSkbwr/KF/Pw9HS3ZC27HPNsZcDYrYufMqlJN1TbHDpGxMz?= =?utf-8?q?XkA7JVAcRV0GYK?= X-OriginatorOrg: virtuozzo.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; From patchwork Tue Mar 9 08:04:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Averin X-Patchwork-Id: 12124313 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 B5E60C433E9 for ; Tue, 9 Mar 2021 08:04:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F2CCE652A8 for ; Tue, 9 Mar 2021 08:04:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2CCE652A8 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 87BF08D00BF; Tue, 9 Mar 2021 03:04:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 852F68D007F; Tue, 9 Mar 2021 03:04:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A5258D00BF; Tue, 9 Mar 2021 03:04:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0141.hostedemail.com [216.40.44.141]) by kanga.kvack.org (Postfix) with ESMTP id 503348D007F for ; Tue, 9 Mar 2021 03:04:20 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 147858249980 for ; Tue, 9 Mar 2021 08:04:20 +0000 (UTC) X-FDA: 77899598280.26.C0337DB Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130131.outbound.protection.outlook.com [40.107.13.131]) by imf24.hostedemail.com (Postfix) with ESMTP id 2DFE4A0009E0 for ; Tue, 9 Mar 2021 08:04:16 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TOB/2mwndAlyH6KzB0QLhaMBSxgYmVbBC+IWnxLwGlG9yi4vnuUBtCjX32sAmXevrfP11WicnbPj8m2LiTiTuYLZ+KXwEJjtEJoFJOTyc0KS2QiWiDSKgGBoiU//Grp5JkJSTTZV+1rX6PHW/hqIEX7xa0cuWBO6PkrIZbzHCX3ro14O/fnK45zZky0vfS2lErjHwg6V+TbF2EFVt5SEUgLflEmutEsUW/Rlb+IA7nZEi/g20Opyplaf71cNIFzmXLMc+nwZZ0IpYhx+cq6bwnqclsj+vHdUTqObKRQ9WUj4giEZttJmU93J4pX7AWfcT0HX9a82bQYay4T+8zc9qw== 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=IYB3aQq5E5HSxpjVSG+RHcLXuDkNoT5fOy83l0MSG1Q=; b=BjhxwbXL5yuC9LIZ6WYapUN7J457+ySFg3q8PQXGYnXZBJ2ptm5geenr8Isqx2UMFHwylI83Fe8DlKbcXLjPcvr4BBbglIUnAppGVRKrh+0QzELKiOQzC71cQ4OykKxvqf0w56Dj7eKZtgs2rxe8O0oZpG81px64flsv0/to/BHYyJ8f8MHu9+nuqeG0MvGKazNlYQdgpD2X2rB5xLJoh07/261SVAT554zW7kDH4Ex2ut/7rwtbA72g9dTomjfjiVFRyTVKxYic5DA5+2dBOatYPbp0sFNcdCgIGGEFKHf3CGoUtuODf8cp6NK1kILcaZLlTG9vOtb1Bs+OiHbOgA== 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=IYB3aQq5E5HSxpjVSG+RHcLXuDkNoT5fOy83l0MSG1Q=; b=k9S/36PajArzsIo02GjKwQZKxmP52OEds/5ZnENgAWXME1kSyNJnxaYOf2qaR7QWMd5BWy0jViliduedeeS/Xup9xuUMzvTvcmSb/Mw/M7Ru/D17i5ozCl3O3bijo0+HFreYaY50VqkP5d3yo0IQLez651yR0KMVFOWHxMF51Yw= 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:16 +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:16 +0000 From: Vasily Averin Subject: [PATCH 4/9] memcg: accounting for fib_rules To: cgroups@vger.kernel.org, linux-mm@kvack.org Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov Message-ID: Date: Tue, 9 Mar 2021 11:04:14 +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: AM0PR02CA0004.eurprd02.prod.outlook.com (2603:10a6:208:3e::17) 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 AM0PR02CA0004.eurprd02.prod.outlook.com (2603:10a6:208:3e::17) 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:15 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5daca13a-0ad6-4586-647f-08d8e2d1ef28 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: AQsP0HD960peReqG8hvynQS3s3uC4sDuEDRNHkrbrRdFoXu4j6gn/2SBkjb9XErO/FkejlgVtJH8Ev7zqKwv67xZ0DApiVmiVQB9AghCzqhUxsUQoArlf9e++i5aCpdTgtZvsjK2u6n+tqshlK2j6Wh08yQCd73w89wwYdIao5qCQmKbudyB9XYaEnTs2DTIWcnT05JUIYxSpJthyEw+Y7q1tUz+OANFZLQL3IIgr+uNMZwbCXLCUg5IhHIWQ0okdoMdYUEhPTvIQOpYeTf+ba3ZfKSdSnLxYNO/nqXFnYkgf6yHuMrSyDYQhW8tQtP7YDxrmrSGrxrn+XPNXVwU7JLX9g7tn/oZxsQhn19DinkHi+T/SHNFBhkkGVPp4DjaZ6hWomtPdbuF8SDkxo2mIe2gPo5IHgbCrYf4IL6FS3xPbzUuyEhhmDQPPssk4Tb0LgaSWNuSYoILD8XzzVqGSdHe7JMBZ+y5S+RTAr3OzCUBKnmAfFHbVdLLeg2JNhIP4fxd8xjkPMhWSXWpZ9cfOXJSfEZNGP5/G+8e0kZIYXe+9SGWKv3elHNT4RjB6Ayx/dOfqGf/GjzJc6lrDgxBpGNzfVmIWySNhPNQ11ZDZSc= 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?WsHq6RDRxRIVqGAUk9kNGniJjGyf7J?= =?utf-8?q?yt6p7QLlkP/sTGah8k/iUttOc9boHlu7e1UywpybB6uP6KEY0E8re+Cs+XdJuBrWF?= =?utf-8?q?qqr8tjrZlw9GBFrB3lQL/9mu4Gr11AIEBfDzjBLqdZeyELMZoPQF1uPN9CmcMSuzs?= =?utf-8?q?PbDJfG4GAUX0oUObSNSQTTWeex7Vjxq70WSetYNwz3E36Y/9O6dK2yQiYqXG9CBgn?= =?utf-8?q?r5wqznxjYnacSXcgoYMYMdpl8fWlQHQ7iDjWRFZVplSMfw+n09+zQMAo6y+duSqmQ?= =?utf-8?q?27PzydG1o9RIaoV0ewBYjvIKT8KBiomPqVBxRPd+8mdiBM1m6axCBMC83vyIvSDs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?q?l1tyKTUF19Bx9FYLhtZAwTPhpZ+inSwMJc+aa3ajFa5ROCwi3G7CaVajbt532fXmh?= =?utf-8?q?IH1DLzTool29yl?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5daca13a-0ad6-4586-647f-08d8e2d1ef28 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:16.3398 (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: ninxQwVCvzpSjxluAV+petqXUNI1tlV7mv7X2Xbm+qfXnByWUedmCCZIvS7YruvHx6YKjCBys9el78FHM14cjQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2511 X-Stat-Signature: tj6tiky3e5t9atpx1bmbhuk4x67dj7c5 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 2DFE4A0009E0 Received-SPF: none (virtuozzo.com>: No applicable sender policy available) receiver=imf24; identity=mailfrom; envelope-from=""; helo=EUR01-HE1-obe.outbound.protection.outlook.com; client-ip=40.107.13.131 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615277056-398128 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/core/fib_rules.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index cd80ffe..65d8b1d 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c @@ -57,7 +57,7 @@ int fib_default_rule_add(struct fib_rules_ops *ops, { struct fib_rule *r; - r = kzalloc(ops->rule_size, GFP_KERNEL); + r = kzalloc(ops->rule_size, GFP_KERNEL_ACCOUNT); if (r == NULL) return -ENOMEM; @@ -541,7 +541,7 @@ static int fib_nl2rule(struct sk_buff *skb, struct nlmsghdr *nlh, goto errout; } - nlrule = kzalloc(ops->rule_size, GFP_KERNEL); + nlrule = kzalloc(ops->rule_size, GFP_KERNEL_ACCOUNT); if (!nlrule) { err = -ENOMEM; goto errout; 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?uPvovnp7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?utf-8?q?nO1ItTZNbCG7zl/pREd92PqszizWhP11oEx4ahP67NQVachdDs+sJ94jbdJDO76cW?= =?utf-8?q?tWGzOBaI9xKaxBlmAzB6jePHsig6Dem6GnJXkQWEJntSs8LcAEqXEuxY/PSld5Ubt?= =?utf-8?q?7gLDUbgz7oAPbaBIyC/0vMZ4DCG0f/b3VBBFlwWbDknTPxPPSaYZg+F4gdbXuJDYI?= =?utf-8?q?HJJ+sbfgotpQEv?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-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) From patchwork Tue Mar 9 08:04:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Averin X-Patchwork-Id: 12124317 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 60500C433DB for ; Tue, 9 Mar 2021 08:04:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DA13C65228 for ; Tue, 9 Mar 2021 08:04:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA13C65228 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 632198D00C1; Tue, 9 Mar 2021 03:04:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E0E58D007F; Tue, 9 Mar 2021 03:04:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4348B8D00C1; Tue, 9 Mar 2021 03:04:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0133.hostedemail.com [216.40.44.133]) by kanga.kvack.org (Postfix) with ESMTP id 2B2438D007F for ; Tue, 9 Mar 2021 03:04:37 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D6A232471 for ; Tue, 9 Mar 2021 08:04:36 +0000 (UTC) X-FDA: 77899598952.01.0546A9C Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10134.outbound.protection.outlook.com [40.107.1.134]) by imf18.hostedemail.com (Postfix) with ESMTP id B4C0820001EA for ; Tue, 9 Mar 2021 08:04:36 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HfMDCP2bd3MCDIQ8Yez5702uqV2KtOfifqeC8sDxboYg7dZCc8efCqoe0KkVyP+MoTKrJC9Rw2331YMDZFrtG6fpgUY6crEwNcgaQZ+uj76H6rOatBeyXpTp9Am8lU6dI5T5PZu+GP0Nz3/L5W1ME0HFF96xpBQLZhYhYzr07go92vouzqq9zpriLPCDzrtoImUeR4FReJ8xE0sc8Yrwe0vb67B9W5Lzw8F6qHwFLZBv+BcLswK9LmLDlmM8JO58K6TjuA3utPbCH6JPj16VKIK6/f7lts0bdV5CvgKSNZg2//qAdsjbeGqIOCfE9vNxV8g76peYc49O/dW5U4BiTQ== 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=VAPlJ23nmyUC/3g97olMrSpPlXIx1ZJBbDYNe6ym1cE=; b=U6wW1jDr5NEsvSqw66PNgou18+eDyMDCHQHTGPcoeKHVaMAQFXkA1NGQfVxtK887v+wDBLTiAjahy39Bgfj10aFHSZeKn/9BJSY+UwqXUhI6cWnpVU88Vwu/04pWK3uE0ZZh6bizyhzAuj7vBa2TOcua4DGJj0TeWScv/236v8UKRWEneRrQjhw5hDTXSriJYioVFRYO1ejMIQIccArkfrglliF3QYDk019QjHRRBbbHzBDwjDuZhZu6OhJjZK85Q9uB27NAJjOa8NC6+XoCVbAoRYpwk+T6tFYcCdFmheHSS4SWJn17FD60RQMjhkN0BUEP4bj1TukoCVMGD1ZVpA== 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=VAPlJ23nmyUC/3g97olMrSpPlXIx1ZJBbDYNe6ym1cE=; b=j8VAwy80Uqb5L95Fd9+7SCOODVdHayijarY5FJ8bJaKZTc7LyWwpn2kJAI/ZCjdCsNGK96zTzTqqb29v2NvOrOOijhnPqL2sugNzAvHjVNt6RZAuaklMnRx46/38BxiZ1BT+L7Ies70fNSuGagZlJLmtQETW3HC7/IQfLeNIV6A= 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:32 +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:32 +0000 From: Vasily Averin Subject: [PATCH 6/9] memcg: accounting for fasync_cache To: cgroups@vger.kernel.org, linux-mm@kvack.org Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov Message-ID: Date: Tue, 9 Mar 2021 11:04:30 +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: AM0PR02CA0030.eurprd02.prod.outlook.com (2603:10a6:208:3e::43) 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 AM0PR02CA0030.eurprd02.prod.outlook.com (2603:10a6:208:3e::43) 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:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3e8bace2-bed3-4092-de69-08d8e2d1f866 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: muijSe248Fa9Yt/qA0Vz8U9HmXerToIGe+MXdNSK0u+iqs0WphLaPd6vfpC65+bEaH2NADSjjB0VMHthJ7VN3LQnpRxlkK6tDzWi5lsRohm4k89OaJkfK35Qn8nBzleEr8FVYKBzmLSZAdLzdAa5OBFZDX83dxgLwDhONFkGVZAlgZXFyanKvLoqBjlZ/xyT0D4VHX+P+gIXZX8uurqsGpTGiIYV8R9jTKOucylBxX2/pq2zXbUBspUF8HtGKifPWSAVBcEVSSiGyWQQ/lb7mCNlOz30G5QM9KzXjuQ8Uu7wVLa8EpXb9vyJ08ao1pchLO/mjSzSrkJITNVJsw47vZalT+3G2F8LmQibQrM1S1FPcQKSMNv0xW+Zyy4woYGXjXLDCqNZRcCLUwGRqmsE1ii+kXLAIudIhlRTabYVOwDufnSXPnJa3h9NPG6AROtzAvpjSRHml2DuYxwRe0rAmJ4Mu66zfnFGkW5SPY/7S5WHqTI4dDdFM7CXXz0EbU/xWbUkOzEzgNmhR0eeYU2Ue9hx5bIw9hNIPVAkYAWnBOe2fYuxwtRm8M9Qtxo0FTrTJAmsp73jscyY7L2XJ4LvOnyri9kPuFqbQtawHXClVmY= 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?ZfxRKhjeBxdNJNhThcNsmCxiBia9ou?= =?utf-8?q?XRrCgyA7VnlhOePBrdRLaES2d60vuYcPCyJ9IOwKNg4N1SEEy4ZGfonQQBHPuR8MO?= =?utf-8?q?TAPvFYZ62nW1XHBMYaKUSMm6TfHqr4FW9B3kZqYxvV2vH8FccB/5EJlK+Il46j9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f-8?q?elJpTk0diTb1GmqUJlWRzSzv+WYNxtTz2ea8fNuL15bzcEzPw6vTGISG47bu5EXbY?= =?utf-8?q?0hFxYGUQl7Q9jHF7cKRswBjloFUadusbD2JgiFlCNpezy0DRgf4h3SDRcEnimQWhp?= =?utf-8?q?O5IG4+mNmQkbvZARhngCh9IL6+WpJqH0uH7l5HeK4988wpiCrLzzTFH6JXQ5ijNlo?= =?utf-8?q?EnINMl7K0/Ecq+r5BChqKs/WRospzPUasOCH0N2bk1E73bj8TG04vX0vOqSo6GgGL?= =?utf-8?q?braZMlHmPhUIU0?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e8bace2-bed3-4092-de69-08d8e2d1f866 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:31.9237 (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: jkDc5DsoLp9Qe+CWuIGIT9NofGE5j+0P4jaN0AwpJZWpSihFGljlrQZpvpYqoulob5zN25cVrs+RnOGcf0ny7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5789 X-Stat-Signature: knsd7ykhcwsbuye8bt4qkwwjgo5p9898 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B4C0820001EA Received-SPF: none (virtuozzo.com>: No applicable sender policy available) receiver=imf18; identity=mailfrom; envelope-from=""; helo=EUR02-HE1-obe.outbound.protection.outlook.com; client-ip=40.107.1.134 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615277076-977117 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 --- fs/fcntl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/fcntl.c b/fs/fcntl.c index dfc72f1..7941559 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -1049,7 +1049,8 @@ static int __init fcntl_init(void) __FMODE_EXEC | __FMODE_NONOTIFY)); fasync_cache = kmem_cache_create("fasync_cache", - sizeof(struct fasync_struct), 0, SLAB_PANIC, NULL); + sizeof(struct fasync_struct), 0, + SLAB_PANIC | SLAB_ACCOUNT, NULL); return 0; } From patchwork Tue Mar 9 08:04:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Averin X-Patchwork-Id: 12124319 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 E2D16C433E0 for ; Tue, 9 Mar 2021 08:04:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 57A4C652A4 for ; Tue, 9 Mar 2021 08:04:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57A4C652A4 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 D5DD98D00C2; Tue, 9 Mar 2021 03:04:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D34F78D007F; Tue, 9 Mar 2021 03:04:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BAEA88D00C2; Tue, 9 Mar 2021 03:04:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0139.hostedemail.com [216.40.44.139]) by kanga.kvack.org (Postfix) with ESMTP id A013E8D007F for ; Tue, 9 Mar 2021 03:04:43 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 6DD7D1730875 for ; Tue, 9 Mar 2021 08:04:43 +0000 (UTC) X-FDA: 77899599246.17.847998B Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10128.outbound.protection.outlook.com [40.107.1.128]) by imf27.hostedemail.com (Postfix) with ESMTP id CC50C8019147 for ; Tue, 9 Mar 2021 08:04:39 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j30trE3Gx3jX4N+6Fsir22+p7RUNllwpJeLjOu60oSpYLFW0/oiRvJgCjLB1BxJL/h5nDOWCtKwG52Sb2VwucScsIdQJLmqDjIwxfMxM8W3pNzWTFhJ+rMOKDA57L4eMRxZt1ENpOW015Fa9gzOEINF6eLc1jdZsLWGj8nX7CX0ieeyRh6LEo9JSW0tGW1hdr3g8IRrAjD2ItpTDdrP37+8feztq+xp4an8kvu6ig7O1GgfHJQoNLsYBgBFBv/QAt60vihjARvx/0Uv2rArKfNhrDrfZBXJMnJYUHwCMcs3IRWLp/M1z6n818IQDJYAGkBD2vs3/SFP2B58xpdSRdA== 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=BAP5eGj196itQT+6h6oG7CKJMncsxWZSup9LhBVScPQ=; b=BaDsCd2lhEh5e73r4JAZB1CzghXh6ZoB/ibYjOsbo/inegg7Q4YQeH5CsKRN7IfvXC0tRtn1xLxs5/pUoSOhclblPVtsYReJTvmHzJ4kXqwdQtIWZdu4Gs63gG8Y6pdyKDKUEnj3mM57iZF8cdHVCmZG3c68cVqKDkpuvTl5qBrTIYreTyQDcYyVyHbaymP+RjJx5YHshJqz8C73tJgmOJIU8WRNZaaATwBI8SlyDcZwPpo3YcPLghGS+pmDe/9jL3bYk5UoqYU+QmCV7Doq3RIOw/C8LkhwiK5m7ltOK7xxKPQODLLNYkPodd4jo5shHKV5EpNEAKHZGeCFgECZAg== 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=BAP5eGj196itQT+6h6oG7CKJMncsxWZSup9LhBVScPQ=; b=iKSI0MPDk7yTjfzZlHbD2wKDxRX+/WxqCg+TBlcnl40IsfcyXCNAdgVqzBQXL90OSKszyft7y1DJP5eNn3qwmpl0tpaBzlv7HjLayIt3zNLu4OVP9O3GUk68eQMNbjIRYFkcVHwY/LkwUR0mM5jtwvAzYW7p/mop1M9DdaEeFTw= 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:41 +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:41 +0000 From: Vasily Averin Subject: [PATCH 7/9] memcg: accounting for mnt_cache entries To: cgroups@vger.kernel.org, linux-mm@kvack.org Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov Message-ID: Date: Tue, 9 Mar 2021 11:04:39 +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: AM0PR02CA0013.eurprd02.prod.outlook.com (2603:10a6:208:3e::26) 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 AM0PR02CA0013.eurprd02.prod.outlook.com (2603:10a6:208:3e::26) 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:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c7fd6177-658f-4782-c37f-08d8e2d1fdf8 X-MS-TrafficTypeDiagnostic: VE1PR08MB5789: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:561; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5F8og98Vu33Wgc4OvuV3SoRrFEUNmhfyBDxKzos/xgVBcyx43TWkGyua4yC6gaxd+faSxu8qKF7ToTN+WnlK7P1ggKoRUPElg2VtomxJrwlZOp9BMHf/ApwXK3s4FK2q6QLwP6rojFfVYFS/TdjS9sSSbjQ+zhzxiVi74UdWNspOos6Bjh1ns3G9lZDLWz45r60ZT0rYDL39hXJMCgJJTYf9oo9R6JUIYXcZcgFzb02a58j+gqZfYXiIA5FYZ1SAUdYMxO1L0EB5G5AuEM4rs5hEbuE17wZu59Uc3rv21eGNbCyAp2x+hK/C4rN7ZUrX4ZP3d/Gb7UJoDr4hlz4xcXXt7KVfTqO+FazXqLwmfmNVz66HUXfXVvy2aDu3Rz9QpWEdUezzSUHPmn3SAGd/lhRGhmglvQusNmfWRllmKq3KrY/PoRDnV/xOVO6hGr+juIXAUdNtyKpVrDHEcZz/vFCXiH+L8Ko0M4B3H1aKA/3nhSpGo1ACPPyzKYx1ErjMO6D2s6RQlBqp8RVFBY00YAocwmmbZfwHAWl8izaPRElpSSmgpABKR9n04oiz22bHdKOzpcUZj3spc+aLMFoHUapm/RFs48tyKm7KvbkaWI4= 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?WJ7uWleKIfxUZJWXCTBS+UqX8xId+0?= =?utf-8?q?X+uYD4Od/qCo0dKkWGAnCgXzfKfgggh796AiHlCSoeblIY8GVtPEr6Y0OPBcszVrN?= =?utf-8?q?JIBYlIYQ2lg9FQEK2NecoeWB7fLE0wbOfOHycQvnT7H5diODI7o7QnjEoa9POl/EP?= =?utf-8?q?mVFT07lv42UFK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ftI51Tmi4o/DS6e0zO89Gszg+Ed7c3tfff4S1McbwmsAqflUo6Rax?= =?utf-8?q?5v+4S38o/VoAn6WX2g2E3dNFkdbx92uDHyG8Yyl+Bv/5R4YOdt7PVkYHOEpRbEfLx?= =?utf-8?q?+NLLw/NjS6spPdfGao6WKgqqnlfIfIGp7E4cMUBUI5G/MFt+vwoNSbYPaamwHL0/R?= =?utf-8?q?Nb1n+to3bVedxp5do4F2TRVjQtubU5Hx0TEmSXgOxswEKyaBrXBsZhy5W2q4AbdVr?= =?utf-8?q?97eayphqSkMvPc?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: c7fd6177-658f-4782-c37f-08d8e2d1fdf8 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:41.1295 (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: s4PW4pEP5EDmOrTOG+uC+r1kYKoXkHO18awIoXGFiQGb/epDScnWut1vR4kOcnRqrbY32qVKM2bwH6/qeRXrwA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5789 X-Stat-Signature: 9kofnpmqctgf938udbohxkphsftb5bbj X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: CC50C8019147 Received-SPF: none (virtuozzo.com>: No applicable sender policy available) receiver=imf27; identity=mailfrom; envelope-from=""; helo=EUR02-HE1-obe.outbound.protection.outlook.com; client-ip=40.107.1.128 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615277079-265699 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 --- fs/namespace.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index 56bb5a5..d550c2a 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -203,7 +203,8 @@ static struct mount *alloc_vfsmnt(const char *name) goto out_free_cache; if (name) { - mnt->mnt_devname = kstrdup_const(name, GFP_KERNEL); + mnt->mnt_devname = kstrdup_const(name, + GFP_KERNEL_ACCOUNT); if (!mnt->mnt_devname) goto out_free_id; } @@ -4213,7 +4214,7 @@ void __init mnt_init(void) int err; mnt_cache = kmem_cache_create("mnt_cache", sizeof(struct mount), - 0, SLAB_HWCACHE_ALIGN | SLAB_PANIC, NULL); + 0, SLAB_HWCACHE_ALIGN|SLAB_PANIC|SLAB_ACCOUNT, NULL); mount_hashtable = alloc_large_system_hash("Mount-cache", sizeof(struct hlist_head), From patchwork Tue Mar 9 08:04:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Averin X-Patchwork-Id: 12124321 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 A7EF8C433E0 for ; Tue, 9 Mar 2021 08:04:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 20657652AC for ; Tue, 9 Mar 2021 08:04:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20657652AC 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 A50648D00C3; Tue, 9 Mar 2021 03:04:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9FEF18D007F; Tue, 9 Mar 2021 03:04:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 852EC8D00C3; Tue, 9 Mar 2021 03:04:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0058.hostedemail.com [216.40.44.58]) by kanga.kvack.org (Postfix) with ESMTP id 6C6808D007F for ; Tue, 9 Mar 2021 03:04:52 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 347D98249980 for ; Tue, 9 Mar 2021 08:04:52 +0000 (UTC) X-FDA: 77899599624.14.5215A12 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10115.outbound.protection.outlook.com [40.107.1.115]) by imf04.hostedemail.com (Postfix) with ESMTP id 9F2FC138 for ; Tue, 9 Mar 2021 08:04:50 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K5fcqg6x48afdt/MwTDf4vGqfqJxhvaL/72BQi+B9Z64HS0/T/dXjfLtABQf5Obpg33KjT/5y1UOy2ps32waJ7Z5ymgXmy7speIKcS7dcpLTq408PTFDwoiyOniZBYNDufU0VliX2lrUpQD1emq4Bw/WVocZ6DwPSeTR5lKHbQ4Uqz16yV7jCpbgZGImHqpui9f0rQHLyvr7suBfVJQTWAO/tIwJtw61qjDVDnp5rx6AgHqUWf4c4/mCMQhjGXxCBip4Eopl5Oj3QTxMnyptizmNEW7A+7vuqrgU35mk2dIq34W/QYyKJ7hCHx9gAChUiWanD89m6U3ydPnBNQjE4Q== 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=lvOGfhU67Ne0x55U1mi/eYx3RQi6tluzUKRhpEayLOQ=; b=htqVM9LoYTJdiML2nqRENLcuRAVcfaMGYZf3CGnwep16SGlqM48PYRyeH88u8ls2so4jYVWf2IZhlCSdLnhBtseP7SGEq/KE5uHY0B7/kOdDK7ArYP6JXNJfJyGCmeg3N6c436FryVUl5V9G5jAT4Q4q3pA7KCFUDEXSk8ZBE3DdGS8KgTGJJ7/0U8fmPUvlXJOYxv+v1GzfNcHTmJ1UoEp2IEA9Kdyk3gKcHOCVsWm2ct8JupU4o5Egw3TMoAUTE7uld8tbLe0YTBPB1vwy+BIqaGYnPblmRVkvj6iFviDVLF1H+wOBNa2WjwlmWcyjJewD9WlZdEdMZnLErMTPqw== 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=lvOGfhU67Ne0x55U1mi/eYx3RQi6tluzUKRhpEayLOQ=; b=DoOD/d2xRXZgq6ijyDzejbWsDTKzgy+BN6kj4WqlAqakaRvL6hjpP/ysI0/aIQCTA4qqCsmJrYCGEQle/STjhDD1D5iXQB7Kz8H+frxGHtEbY84YIkVZFYjRlDhastTkGPPJZncc2PcnrR75dwidXtX+1VPaMKeK63H1sVqu8gs= 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:50 +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:49 +0000 From: Vasily Averin Subject: [PATCH 8/9] memcg: accounting for tty_struct objects To: cgroups@vger.kernel.org, linux-mm@kvack.org Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov Message-ID: Date: Tue, 9 Mar 2021 11:04:47 +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: AM0P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::27) 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 AM0P190CA0017.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.18 via Frontend Transport; Tue, 9 Mar 2021 08:04:48 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bf97c14f-3276-4124-25c7-08d8e2d2032f X-MS-TrafficTypeDiagnostic: VE1PR08MB5789: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LJpJ+0JYzbfC7J0ifI+cV3c3JabegO/vNmwXzQqEvCjFdn0iHTjk1e9FmuZbAH88JKGgkVb21GbWm3tF+iTOgb10sYh5jBtFF2A9LKys2iBNHGXFOnTpOUsK+l5EtUXGMicO9H+wLW4EXVu6FwNKfYkzrTclkUemSayhSSM83NrPuddmY5vuBv1ZmhsAJnogXQaHa4NbGK9Zhr9Lx7KjVrAPffYuAjGjGJVPUMnucw4PIKefNGZA56FkhwTj25JexByKxg8LBu/T57FZA1QR5kaJnsCc1ds7ncK96kGDeRhcI3LiPdCCPxI5QoqsepFqbgPmnlTVrqRblvsY5+OFg/teuQgElWvvr62hRd5Q2uht1915E6o7L9c+1NIX4jRMaqjQsfz/qkdmlxWZn1tmQPe58hk6mfIag+LdzA/SsEO6FQCg+6JFD9p8CIZRNh0WOa+MxIO+rgejmyowNe5EkeMy5Wu6qNDKEvN0MuDeM8X2P1XOkc19UWyTOIf5nZ4lEN/j8CE9BkN7ShCTkjH1joAUVfPzwYyNcJzCrf+M5DNb4ik39AHC0Ac7ew2pVicKM/wD1fyr1jflBAp8Ee5B2Utlf0Xb/eTp5dnnNgVa7wU= 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?+AUp5bUQacfSZrR7mo3WQoTG5oUKc0?= =?utf-8?q?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Sf3bNod7eTkjk7I9zwKzsC6Hy6o9/9f1WVnAX33THmiK8wd4vlZxt8Czq?= =?utf-8?q?uCswZ/eYDaajOE1oJSeqTJcDky4Pq4/Hyq2/uUR3EbARGtNYbWk00dhGPNThTPSgW?= =?utf-8?q?3A1bKfManbwbiNrmNpg4/y7HnbyFssxDO2zNc0h4+Ln7u+i2P97VhXKkIxc0bw9aE?= =?utf-8?q?SyETONqRBaNfluO67nFcBuGpiSiROilsDdhcYP7de15QADJevbM9oOxDV9CF8XnmR?= =?utf-8?q?4/vQ91gKHpIBH8ARPrsckXPC03nQ2nBW6b4HkfUZOoEAyQEIr4uDJEJOWoN04ZrCV?= =?utf-8?q?F9a9sNPKPca9q+K1rPpDzjyyzy2pq9K+CXK17pYf7uSkr4s98Mr2f5UFWsw1uKUp6?= =?utf-8?q?4nn2bAXoVDpbUE?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: bf97c14f-3276-4124-25c7-08d8e2d2032f 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:49.8885 (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: BJcBd532SwBQ/BQYMPtdZZpEBpniAhObyXJvN0+1onZxrVM210Ee+ZkCHaF2lD7d2hOppXt77YPvC2di4c3WOw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5789 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 9F2FC138 X-Stat-Signature: dfa9ch3qnpgsfezaxcg3ygyszik59znw Received-SPF: none (virtuozzo.com>: No applicable sender policy available) receiver=imf04; identity=mailfrom; envelope-from=""; helo=EUR02-HE1-obe.outbound.protection.outlook.com; client-ip=40.107.1.115 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615277090-499194 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 --- drivers/tty/tty_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 74733ec..a3b881b 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -1503,7 +1503,7 @@ void tty_save_termios(struct tty_struct *tty) /* Stash the termios data */ tp = tty->driver->termios[idx]; if (tp == NULL) { - tp = kmalloc(sizeof(*tp), GFP_KERNEL); + tp = kmalloc(sizeof(*tp), GFP_KERNEL_ACCOUNT); if (tp == NULL) return; tty->driver->termios[idx] = tp; @@ -3128,7 +3128,7 @@ struct tty_struct *alloc_tty_struct(struct tty_driver *driver, int idx) { struct tty_struct *tty; - tty = kzalloc(sizeof(*tty), GFP_KERNEL); + tty = kzalloc(sizeof(*tty), GFP_KERNEL_ACCOUNT); if (!tty) return NULL; From patchwork Tue Mar 9 08:04:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Averin X-Patchwork-Id: 12124323 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 378F6C433DB for ; Tue, 9 Mar 2021 08:05:02 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C732A652AB for ; Tue, 9 Mar 2021 08:05:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C732A652AB 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 67E9E8D00C4; Tue, 9 Mar 2021 03:05:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6555D8D007F; Tue, 9 Mar 2021 03:05:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D0328D00C4; Tue, 9 Mar 2021 03:05:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0114.hostedemail.com [216.40.44.114]) by kanga.kvack.org (Postfix) with ESMTP id 3345B8D007F for ; Tue, 9 Mar 2021 03:05:01 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id E63474DB8 for ; Tue, 9 Mar 2021 08:05:00 +0000 (UTC) X-FDA: 77899599960.12.E475273 Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10114.outbound.protection.outlook.com [40.107.1.114]) by imf14.hostedemail.com (Postfix) with ESMTP id EE5EAC0007CA for ; Tue, 9 Mar 2021 08:04:55 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kfn9HUyO0797SZOLr9eZPUj8VIJuy3dHFysJo8GIg2jAaWYpDP+sqjJp/c18slEuYQyuzX11DNKwdHUFpg9fdE+ReumNWX2BTqMnUQFPuxTlIhN7BF/CDeoKQTRHFqj9JXjCRDD16jRKVACQjrQo0kuERNi4cXfXSmAxs+iFCaBJKYpMdMHUvdSfDgapz8MQIqL95MWGsj7afslcGWTSqpsu3g1FoUn6nZnSZMfcTJtcbsDPvNeS9QTJh3fDYxChSla8NnRtl4M0gVVYynlHRHe/8n0eyvR7Ahl1yfJc1hLFCw2VwGf/iD2vXcpQRBt2s4j/F8htIu2Oi86p1r1XzA== 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=DETAgUIoY/Yh+88xtrJ0p4ub3J39q3mROrB0pV7+7iY=; b=XtEYBmV3dSl7P42kwK/ipnoyUZDc5M5mZcWy1CEPKBOJzZZXTk3XqeyL7jcCBhJsmpxOkaknscF8UzHc3NLXx8LuhRsIOIgkicvvVruOjpsNAqRNaeS8c+PF6Hp2Ub8QpcaAMgaj4v37esuXaLK/WJChIeHkwrBE6fqJhXTkUnr/mCQ/vTY9aMZcbmPyX/sU5dq3SfZDJ4jzR0i6ekBR0q9QQMd5ngXUUc2W3+qkUCgSHf7J7lv+2R/+egez0+Ri0zJhb9Af8/IVdAhIWWH+VYCUWnZc2+xEa3nLnTRdcBBQt8nvk4LIk1ewgUdRj95ASiyYGMkoJfdV/BgA/+aArw== 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=DETAgUIoY/Yh+88xtrJ0p4ub3J39q3mROrB0pV7+7iY=; b=s1VeK+kL/60lgVPBobVfRF82ESE/ZrQt6G7tL6f0LBe3D+HFVMTQU6ILix5Gf/uZWUi+lQDaluVNyWxT2qFCLctf8EqjgL47nG/6eBAOi58InqTwljsuG4JiZBg4eLf5OvcLW7HzQ6NtliUXsI1QlCTcq/Yf50HgWzw+AdY/cNY= 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:58 +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:58 +0000 From: Vasily Averin Subject: [PATCH 9/9] memcg: accounting for ldt_struct objects To: cgroups@vger.kernel.org, linux-mm@kvack.org Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov Message-ID: <05c448c7-d992-8d80-b423-b80bf5446d7c@virtuozzo.com> Date: Tue, 9 Mar 2021 11:04:56 +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: AM0P190CA0019.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::29) 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 AM0P190CA0019.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::29) 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:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd3af80f-71a7-40ce-eac1-08d8e2d20815 X-MS-TrafficTypeDiagnostic: VE1PR08MB5789: 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: 6wz4CtwHx1MUT8YX9OB2Xwo7jEpC7AZMVaf4LSNVU2LrEFMEzmFFqcbmh/AcaqDfhoaYIYQtGfXKM1n7PE/sS+SV4misZG8NmPn1AGbU3R/qzuJRYbHBZ6BJsEsusdw5QnMaXWT+c0Af/H9yldaxEpAKMY52U436G/1m30bFcPLXXLptUYU5qZihELSS6pCEmZuL2w0askVOGCAQOvaPhDQkaQ7ZZZARmR6BR9IyD32N+Uh6DG99aho/0EzlexZRfGPUNZtNug4AENpOwIfaePsAGxsR+RjiL5g/PTOFNTs/dUL+t2ZODnFi4ZeYqL+J8YxUsFVHFjLzUtYJdi+45A0PweMl1vjOcnunsQYUJph1zEbwNxe9KVt0ofcfxzllv0m47GzuGU9NyRh4u/lImZ1e2u/XUUfuzgPrBchs/0hz15xMfMrVJwfZUDufXk+AP9qbXX/fuyGSgyCJnXLPmIHqZ2vi0oqiWUN+VEHqgKC0lC+IWTppfqI6khtTTechfVjg5CfmQ2OiWTDBCkmY6+U99pnYZT3ND2rTT3XuZib/wMkqBlDIp77gX9AnzhEJE9ivMqSrpO2kVqNknQdc+sNvHDrTWipt6ESbqw01+cY= 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)(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?98QtP1NGjEK3l9pG1kMkcmG3/ottRF?= =?utf-8?q?lOvFdhrRyEXhL0eil5HwVsRoHCxRJbsnIQjaZxFu0DFonx9dTTBeJK5MB0c2xYMjj?= =?utf-8?q?NlXWBBZIaocq1KF9ApsEN9uUj/lNemM4jPWQKGiwuaS4zmY8VYOqwOxw6YveIdyj8?= =?utf-8?q?/Ho5toeZKD3ELr28HPdPP/Pu5GgEzhUoyyF6nJb8v9TzAWPi31rcwaY5x8gw+XcXv?= =?utf-8?q?YYiLYEvzIyzZ8b3VBG99ZvEZcg2yY7CsY/i7SImAXFKl1Cr6CFJNA9cnUbNbjWUlG?= =?utf-8?q?x75Ekvg9JJeTdNt1qB/iUnsnWFKigahF4lZfjZakazfn0jxjYr8m9oj7uL+pvwz6W?= =?utf-8?q?XKbpdHPFHdRieWyB4m+KyeqGcOqgqVkzO8D/wueEu7lxViIoPvERuNWko04CUaogd?= =?utf-8?q?kz8ApfCmfq/qAQvQWrN3XrRyBYaLVThdYlIcowVg9eIT1N/8u9j/U/RWy0iY0Lo4P?= =?utf-8?q?EVU/E5NnGBaNty3a0WV2SeokqejHoswhUz6jDnqZ0g1c0aJkZq2Ro8R29qyGfTgQA?= =?utf-8?q?+Iyx8Oq4q+VZnV7IiVFwHekl093yAnGdpeBQsGl8Ubvnp0SMrps9hmyf6ceVKVtE4?= =?utf-8?q?QKiBbpD0uv2N+b9/byYB5o6faUGMgcSxqkv0wuYiyJJIF7edd5er4zfqjvi2HI6Qh?= =?utf-8?q?1KbcmhSbxDys1Gw0ks8KpUvLQfV2rqJCA+MOkEmNVFLed6BTEZmfaweWxViGAa1ol?= =?utf-8?q?y3PWnTypgaX96OP+mdHy7Mx4WC97nyM5L8B0Msza1I6RtrqOqgjeCwmDU2uIrJVq8?= =?utf-8?q?bpT45uvBOsippyvgKXpWm8iSH9w4ZTScvmwlDut0+rA95sik4uYXupT0VweFP/1hE?= =?utf-8?q?O6pQLR6gOiD1g+3MDfjmh6mBLk77A65GdITgxJ4li3ywVTKfok6ZuppOI+AGe8RTl?= =?utf-8?q?tnE/3f8c8Z04qWT2Agm5CFSu0xh+WWeiwenvx+K9Va2Mz0AO66TpkJhK8WLzUAKyE?= =?utf-8?q?phg0FIy/fGeXMyaR6T2cqqNXQglIQol6xwyrewAF+iScYqadUT0Y2VzJUKtxr0MoE?= =?utf-8?q?MbKvukNij/U2iLvFpm4NXMxIRg5hQZHDCYg60F5WIvq1O6pOZb8gr5QvrEnOxBAcL?= =?utf-8?q?7lof42hbmJl6UsHUvp+otKZPHYoLjw9UPA4lXL2MREWaKKgd/f+PbUs05a8v+yD28?= =?utf-8?q?RCHNY8oYqSmibyi98Q7a6i/Tdb6Xw/irbTQ0mkpxtubQjwFyzXL9pmvnjRgNge0LM?= =?utf-8?q?T69NH0MJyEKpFmDMD5o9SmftZ9d7VwLWVhSDe/Bcp0ECqr4NxEXzgUG6CDu4mZuw1?= =?utf-8?q?EE+IcG6Zol9nAJ?= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd3af80f-71a7-40ce-eac1-08d8e2d20815 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:58.1128 (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: KlmVPULP6W+42BzgND7cArqD4SaS2ZDhjHBj8SaSum4XBlbPHf3DXdMKyrAFvBUtIEam/4FFMEdsX+514xXARQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5789 X-Stat-Signature: oc4ot7sx8uijsxe69g4zyy3xhk8ndpcc X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: EE5EAC0007CA Received-SPF: none (virtuozzo.com>: No applicable sender policy available) receiver=imf14; identity=mailfrom; envelope-from=""; helo=EUR02-HE1-obe.outbound.protection.outlook.com; client-ip=40.107.1.114 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1615277095-803755 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 --- arch/x86/kernel/ldt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index aa15132..a1889a0 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c @@ -154,7 +154,7 @@ static struct ldt_struct *alloc_ldt_struct(unsigned int num_entries) if (num_entries > LDT_ENTRIES) return NULL; - new_ldt = kmalloc(sizeof(struct ldt_struct), GFP_KERNEL); + new_ldt = kmalloc(sizeof(struct ldt_struct), GFP_KERNEL_ACCOUNT); if (!new_ldt) return NULL; @@ -168,9 +168,10 @@ static struct ldt_struct *alloc_ldt_struct(unsigned int num_entries) * than PAGE_SIZE. */ if (alloc_size > PAGE_SIZE) - new_ldt->entries = vzalloc(alloc_size); + new_ldt->entries = __vmalloc(alloc_size, + GFP_KERNEL_ACCOUNT | __GFP_ZERO); else - new_ldt->entries = (void *)get_zeroed_page(GFP_KERNEL); + new_ldt->entries = (void *)get_zeroed_page(GFP_KERNEL_ACCOUNT); if (!new_ldt->entries) { kfree(new_ldt);