From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A499BC43334 for ; Tue, 12 Jul 2022 17:36:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3AF709400BD; Tue, 12 Jul 2022 13:36:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 310ED940063; Tue, 12 Jul 2022 13:36:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 18A809400BD; Tue, 12 Jul 2022 13:36:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 029A3940063 for ; Tue, 12 Jul 2022 13:36:29 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id BFDCE34470 for ; Tue, 12 Jul 2022 17:36:29 +0000 (UTC) X-FDA: 79679152098.23.F261723 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by imf07.hostedemail.com (Postfix) with ESMTP id 4818340039 for ; Tue, 12 Jul 2022 17:36:29 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id o3-20020a17090a744300b001ef8f7f3dddso9050391pjk.3 for ; Tue, 12 Jul 2022 10:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RfyxacdG5IBfbLaiFP2j7TVDH6sp4yfvSyLKPWelm6k=; b=CD/x8J0HVROAHqRiCfTs/QVrM6JiSO4KL/DiAEZBOmWr9E2Bsxl+gQy7zzOCWSogUT EiNV0LsSZBzJM6agV8sin+F5q9ztsTaEAQIfjpuSQfD/B1gA5Wbp9lSo0+LtAxk11+Bl J77eE//HmXsLTmr6jZauLbdhagd4GFv2TfkPwqCYy4jmoedpKC1TEbS6QLJTSEI5RvKa UNLFn3wMwnVTzOsvj0OJzHNba8JMVzs7PqGp54+3MdiBA9wXlR02wJppDKd8zT+IF81K 7Hw08LYy4l1hl4gIFft0+X+zGXqylt7i5EIjVwnwrfUAjlDyQjGwdP3bTZR75odsxRcm 0LAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=RfyxacdG5IBfbLaiFP2j7TVDH6sp4yfvSyLKPWelm6k=; b=zKUzybfu4G2oga3ftqAIHcFoWtrPD3Ex7+p8jQ9hKm5HzEABVT77JdBNOT+1t14jjY Vi42iQGIWThmBJ78kP8QQyRqj4a4fmyRjCAgyE+e/Je6eP2zUrJM9VuyEuPAEIyVAZwj jSUrAjIb2IaIdoxDeylOfKQpTzZPU8SNJBhsnWc3Y3K+z4aDo8CbPfsXSN2vBLAXEAv8 YbOJF1dcI/5+OS0yc2U2RoflXOiaHAiUPaxOLyQNXc96cEEq765iZW6OZb1/uNiHU21j 7nPJniYm3XfiZQGGjNbACsxwVVQcxM/mZCyb1quw5MvTwjFY/ctKT0T94FF3RmC3f4tA 9n3Q== X-Gm-Message-State: AJIora8pDAV+OcLk0RKxmRhY9ft4CyVPJr5+nKFs1XCAiTjYFjnaYuqD bS8gLuw0UxtmLmMrWAm54r8= X-Google-Smtp-Source: AGRyM1uPiM4XB+sGsiyBgP+kGPc094jqM3zJi0w8a2Mp8psGHVrhbPHoS90xy5TK6RKQjaprsqzuEQ== X-Received: by 2002:a17:902:ef8f:b0:16a:463e:296c with SMTP id iz15-20020a170902ef8f00b0016a463e296cmr14090025plb.138.1657647388128; Tue, 12 Jul 2022 10:36:28 -0700 (PDT) Received: from localhost (2603-800c-1a02-1bae-a7fa-157f-969a-4cde.res6.spectrum.com. [2603:800c:1a02:1bae:a7fa:157f:969a:4cde]) by smtp.gmail.com with ESMTPSA id x13-20020a17090a46cd00b001ef7c7564fdsm9309170pjg.21.2022.07.12.10.36.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Jul 2022 10:36:27 -0700 (PDT) Date: Tue, 12 Jul 2022 07:36:25 -1000 From: Tejun Heo To: Shakeel Butt Cc: Michal Hocko , Yosry Ahmed , Muchun Song , Johannes Weiner , Yafang Shao , Alexei Starovoitov , Matthew Wilcox , Christoph Hellwig , "David S. Miller" , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , bpf , Kernel Team , linux-mm , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka Subject: Re: [PATCH bpf-next 0/5] bpf: BPF specific memory allocator. Message-ID: References: <20220710073213.bkkdweiqrlnr35sv@google.com> <20220712043914.pxmbm7vockuvpmmh@macbook-pro-3.dhcp.thefacebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657647389; a=rsa-sha256; cv=none; b=z75BZSPvHCLi1DaFeKH9o5RYadzUqWkswI88/eoogbwDcp2dSuTGCNcraOShtuxARabXdv bSZdx5AVEiy3dFqAoQjNvSM4xaZPiEckTBB47asL5CzKkKRWgHkF992Mm8cb8aJXUIdu6m ABQOGTpBnfktBMl9uljyeBR8nnnHiko= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="CD/x8J0H"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=pass (imf07.hostedemail.com: domain of htejun@gmail.com designates 209.85.216.54 as permitted sender) smtp.mailfrom=htejun@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657647389; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RfyxacdG5IBfbLaiFP2j7TVDH6sp4yfvSyLKPWelm6k=; b=Mc5o67rF0XYvnx68gs3B8fqtBkMNPLe6j9sYfRWrSYW0oziqAakX7zZ4Hknv2IS0WQxUjP j6BWLo7v+7Ec0cS+qhq/+BFnayX0m4bpJerjrDIMKXfp6Myr5UrQ9EHiWLdmHmqxk6uVpv jANMJ2qvxlmUAjs5IQupnEDRFeG9P7A= X-Rspam-User: X-Stat-Signature: ddocxgu9atw9zccospkzkt5t1ru3mwwk X-Rspamd-Queue-Id: 4818340039 Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="CD/x8J0H"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=pass (imf07.hostedemail.com: domain of htejun@gmail.com designates 209.85.216.54 as permitted sender) smtp.mailfrom=htejun@gmail.com X-Rspamd-Server: rspam03 X-HE-Tag: 1657647389-590449 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: Hello, On Tue, Jul 12, 2022 at 10:26:22AM -0700, Shakeel Butt wrote: > One use-case we have is a build & test service which runs independent > builds and tests but all the build utilities (compiler, linker, > libraries) are shared between those builds and tests. > > In terms of topology, the service has a top level cgroup (P) and all > independent builds and tests run in their own cgroup under P. These > builds/tests continuously come and go. > > This service continuously monitors all the builds/tests running and > may kill some based on some criteria which includes memory usage. > However the memory usage is nondeterministic and killing a specific > build/test may not really free memory if most of the memory charged to > it is from shared build utilities. That doesn't sound too unusual. So, one saving grace here is that the memory pressure in the stressed cgroup should trigger reclaim of the shared memory which will be likely picked up by someone else, hopefully, under less memory pressure. Can you give more concerete details? ie. describe a failing scenario with actual ballpark memory numbers? FWIW, at least from generic resource constrol standpoint, I think it may make sense to have a way to escape certain resources to an ancestor for shared resources provided that we can come up with a sane interface. Thanks. -- tejun