From nobody Tue Dec 28 23:29:47 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 886D11923D36; Tue, 28 Dec 2021 23:29:14 +0000 (UTC) (envelope-from zec@fer.hr) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00072.outbound.protection.outlook.com [40.107.0.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "DigiCert Cloud Services CA-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JNrMt22Fgz4jL0; Tue, 28 Dec 2021 23:29:14 +0000 (UTC) (envelope-from zec@fer.hr) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n2QXVaN7v4/ZALl+EkvFnAzM3W2N1/0ftKyvDJfjF6vLVxH4Ns689Bzm5Ckzm+CdMbIfYvCRX2RmZpj8lfSip2WxK7JAp6Z6P2TlOgzsqXI4Jjzb5h0WFLqJah34QaYlkBahb1Tg/Bhls050Oca3N3bRetMkamoINdIHZKieeSGfmnqvy4Hvdr4lrYYr0IO3e+ge6DOqVBcgQ9yK4lgYfzWmFyvhl2TZJqZOMo+10VI7KeGtHcMd+5ZQhFjF7K/xczfnrSk/urXlURPnTfJDqVs7sWGFC0L7LVExuIKElKGZVGaKTnromUNgjEVJ71uXgilYoCXXO9A74/FMoftd/A== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kJ6qBMCsHU5Pgxx7EFIjD+ps6aaLMAeRsMk7AFZ5NfE=; b=g+HVDNOy3PO3JkZyntapGNvCJ+baYu0zcS+qpbGcOS5/KKxpSzFN9K0hd7TMqzo7GJCZVRhg5hDT2dncT+SGJ1RNHt58DykEovL0KAFnpXGXFm3tLx54khl/UkQlq4Rn6qfZ8bIWvCbUTBDIIcsof153A4B+QGkpfgsbZBByuW1K940jT3fYZXtngCL2akmDghYwf1041vF9uH4VsjAnGMBwWHndPeXFbVYDDFb/TNq02olZIxPZLQLiQLSQjknJDJ4tt4fED0Tc+1Dep7tJT9N7fRQmAzSfl/0U5AfbZoUQ+ckSntsmiX5ozQOdIl1qhnNfT7H+UIm3nEhopuXhFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fer.hr; dmarc=pass action=none header.from=fer.hr; dkim=pass header.d=fer.hr; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ferhr.onmicrosoft.com; s=selector2-ferhr-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kJ6qBMCsHU5Pgxx7EFIjD+ps6aaLMAeRsMk7AFZ5NfE=; b=Qu/WOil6/DziRcXu+6vfJTg9QBOZ3fSbRGZxHwqkIGf/hxUJRxC7IRtToYYCaEkYIqqcxD9J0kOb57LpGk12o8Rq0oMy+/kS0bAsV6HZPaGCWzeEpXnfjEefm0yPiaNOLXSTrb4wuhwuC3TryU6e75gCSUiUroCRwsANe7OKVH8= Received: from VE1PR08MB4783.eurprd08.prod.outlook.com (2603:10a6:802:a9::16) by VI1PR08MB3981.eurprd08.prod.outlook.com (2603:10a6:803:ed::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Tue, 28 Dec 2021 23:29:05 +0000 Received: from VE1PR08MB4783.eurprd08.prod.outlook.com ([fe80::7543:98bd:1322:f4da]) by VE1PR08MB4783.eurprd08.prod.outlook.com ([fe80::7543:98bd:1322:f4da%6]) with mapi id 15.20.4823.022; Tue, 28 Dec 2021 23:29:05 +0000 Date: Wed, 29 Dec 2021 00:29:47 +0100 From: Marko Zec To: Gleb Smirnoff Cc: Kristof Provost , src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: eb93b99d6986 - main - in_pcb: delay crfree() down into UMA dtor Message-ID: <20211229002947.7b7d5e94@x23> In-Reply-To: References: <202112051847.1B5Il2GP030287@gitrepo.freebsd.org> <28AE53F1-2B22-444B-B1EC-1600FA741FE2@FreeBSD.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; amd64-portbld-freebsd11.4) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: VI1PR0202CA0010.eurprd02.prod.outlook.com (2603:10a6:803:14::23) To VE1PR08MB4783.eurprd08.prod.outlook.com (2603:10a6:802:a9::16) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: af581f41-6a65-4fe7-aba0-08d9ca59d6c4 X-MS-TrafficTypeDiagnostic: VI1PR08MB3981:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zFNHQck+HfYbNWMVCFnQ4/JfYxSbATMENXvxks8lZjF48s76hUwINdJA8I2Wa4KWXFTF87V1LLot1ycZoebCAsTM9vs8IfdiQ/M/2lhOQh41M4Y8izgr8SfWBb/qVgG7ospw/kvgTlvCPkPIqyWu14xwuXzFhXL4o2PphQ52WbmOoQ5NWrrrVEEGuMCfiayJ6jmynIwey3/SVnONF49xg7sKK143pviPhN6LpF4vQKmKf2wOhhdfAU+ogIN+HldR9mV6tj8U29B8nQVf3vhgEQPbsXWWDMWM0zHRUkgtfH0Qre3hT2B77CdnpHpX0p1K0a5zzsf1hMgR842v5itrgo4XvOVEVRjpDsmrw6UY/lv9OrULyD30ZrZ0VH388/BYjeRbdraERwwzTCBJZUxvwRinXxuooCNImpYPsffudCQBrqrYeF9oi6D43/fpnHrspcAls9zyPgCCpX/QoiRBJV/Wys4K+R8N8ULmzJ27pBkxqXz9SPd+oa7OVOudGbZa08p3n3NbPe+Y5IzbMmiK0bk7TsjRqjdmlAhTDScmbGL7nn63mkujfr+byhSJo+HT1oEn3WXU8CiGDpxRS1JL91MS9waEUPzI6EDopvbzirqRIj8pWZUA8QOvPpmp3MlueykCpYCo+ZpVPUo0tRbxSRvr6NI1WTNACcNI7bS5Hnx0BP996RoEsrclzLh9tcLbW8gqd80K8VaQH1nG86+2ZLMqwwZaTdmSTk5g/uARIrp5Bxi1pM1vDfryl9zTzH4YJ7mh6LCWTYI7fYNnUZAMr2UKQANCFwH+5+ITwvmspBI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR08MB4783.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(7916004)(366004)(38350700002)(66476007)(86362001)(9686003)(66556008)(6666004)(966005)(1076003)(6506007)(66946007)(38100700002)(6486002)(786003)(508600001)(6512007)(316002)(4326008)(8936002)(450100002)(6916009)(2906002)(33716001)(186003)(52116002)(8676002)(83380400001)(26005)(5660300002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RURMMTk2RXFoUUdyOTkwWUZFeDc1OTBMSFl3d3YxWUs4Z3ZwVzk0LzZWUjlu?= =?utf-8?B?bjBmVVIwTUpvTXMzSHBGdDZ5a1NyeDZNMnV5cExNRXNHVk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VmbU5xZk9UN0U0WFRFTVloZ3RTbE9iMmVLVFY3SkVKTnM3R3l1?= =?utf-8?B?MUhQRWEwZmpKWHhoM0doUkNNYzVOUi9wQlBmekE5bzdoT1o2R0ZOU01TcGM3?= =?utf-8?B?aWF0cjdGaFBDVXdTbFF3aFppVjlmRDlLb0lTbHBGanZOQU52WEM5WGdNOEYw?= =?utf-8?B?RG9PREs1NmZCdWc5ZHBTeHc3M2hPK0gxdWI3RDNDSG5NZEJZaFlPTTdSZ2lF?= =?utf-8?Q?vTBg=3D?= X-OriginatorOrg: fer.hr X-MS-Exchange-CrossTenant-Network-Message-Id: af581f41-6a65-4fe7-aba0-08d9ca59d6c4 X-MS-Exchange-CrossTenant-AuthSource: VE1PR08MB4783.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2021 23:29:05.6287 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: ca71eddc-cc7b-4e5b-95bd-55b658e696be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wXiXy69bgw1SsmEdeGB7KT3lpFyJruOTubiNpHoc9Fis426hjCxyM40FaYno8/Th X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3981 X-Rspamd-Queue-Id: 4JNrMt22Fgz4jL0 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Mon, 27 Dec 2021 16:46:54 -0800 Gleb Smirnoff wrote: > On Fri, Dec 17, 2021 at 10:17:55PM -0800, Gleb Smirnoff wrote: > T> T> K> The jails created by that test never go away. It=E2=80=99s as if= =20 > T> T> K> `crfree(inp->inp_cred);` doesn=E2=80=99t actually get called. An= d > T> T> K> indeed, it looks like inpcb_dtor() does not get called at > T> T> K> all. =20 > T> T>=20 > T> T> Yes, I faced this problem today, too. :( > T> T>=20 > T> T> My radical opinion is that per-VNET pcb zones should just be > T> T> eliminated. The only thing they serve is imposing maxsockets > T> T> limit separately for each VNET. But we already have the > T> T> maxsocket limit on the socket zone, which is _global_! > T> T>=20 > T> T> Anybody to explain me the sense of the per-VNET per-pcb zone > T> T> limit set to the same maxsockets value? You can't create a pcb > T> T> without a socket, which is guaranteed by the in_pcballoc() > T> T> prototype. Of course I understand that pcbs may outlive the > T> T> socket. But those pcbs that outlive a socket, are eventually > T> T> garbage collected as their lifetime is finite. Anyway jail/VNET > T> T> was never declared as a resource management framework anyway! > T> T>=20 > T> T> So, for this particular problem I would suggest just eliminate > T> T> per-VNET pcb zones, but in general the fact that idle SMR zone > T> T> may never purge its cache sucks and needs improvement. =20 > T>=20 > T> I have created a patch that would mitigate that problem. Once the > T> zones are global, the jails will eventually die if there is some > T> pcb zone traffic. > T>=20 > T> https://reviews.freebsd.org/D33542 =20 >=20 > Despite I still believe that PCB zones belong to global state rather > than to a VNET, the patch doesn't help to mitigate massive memory > leaks with vnet jails on a machine that is dedicated solely to run a > test suite. If machine does nothing except a test suite, there is > almost zero pcb traffic. If there is no pcb zone traffic, the SMR > caches stay, and thus destroyed jails will also stay. Our vnet jail > "weights" a lot! Even with the global PCB zone patch applied, each > vnet jail creates 33 UMA zones! >=20 > I think we need a KPI to purge the SMR caches, and we also need to put > vnet jails on a diet. These are two independent problems, of course. +1 for nuking all per-vnet PCB zones and the alike! At the time I V_irtualized them during the early stages of VNET implementaion, the focus was on correctnes and tracking of inter-vnet resource leaks. Once that step was reasonably completed (circa 15 years ago!), per-VNET zones became a pure waste of memory, amplified with per-CPU local free pools for each zone, not to mention the PITA with VNET cleanups... If memory still serves me well, a few folks asserted that per-VNET zones could be useful for hypothetical VNET snapshots / live migration to another machine, a project I heard about on several occasions but have never seen it... So, by all means go ahead and devirtualize them all... Cheers, Marko