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 AC17DC433EF for ; Tue, 12 Jul 2022 18:11:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 430C79400C6; Tue, 12 Jul 2022 14:11:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3B9A3940063; Tue, 12 Jul 2022 14:11:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2334F9400C6; Tue, 12 Jul 2022 14:11:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0E177940063 for ; Tue, 12 Jul 2022 14:11:39 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id B8D48120DB6 for ; Tue, 12 Jul 2022 18:11:38 +0000 (UTC) X-FDA: 79679240676.03.63441F4 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by imf23.hostedemail.com (Postfix) with ESMTP id 25465140079 for ; Tue, 12 Jul 2022 18:11:37 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id i8-20020a17090a4b8800b001ef8a65bfbdso9220551pjh.1 for ; Tue, 12 Jul 2022 11:11:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tBx1pY9EtMlCrqsynZvCfTIrEDWjv6gTf74UrxEZY3g=; b=XxQywCdn8RqM7IzctJY8fSm81TTjLI+j9OKbMS6SyhstOOeyzCWq82FgGBaCuAcuHt TlmgoihNElsRQR6XtFv4jbFo7DwzOI1vavRgrq1ggecAWoY3cNyULssdPe4oP5E0qRpd Zhd6NuiM5fDm9/yrtqXAwiy5J9nftFEVQxzteWGgj+R/8Q+RDRRdoWpFf5wp2Nw0WjTG mtGb1Zayr4BcySzVySUuc+FN4xdhXu4o91t4wjWbzklRNB4fXjpqYlW4PHomcFTR6y87 eKxrrS1robHB1LRe5LL4NAM1SZN6caeXVT5v3B+DjRdwwVejmmAG17m3FjKopkWf4dSb r1Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tBx1pY9EtMlCrqsynZvCfTIrEDWjv6gTf74UrxEZY3g=; b=mKt4qWsRmEOX+VYw3v1tF3gZ5GgN6In1lny3HVTJAqSy6vD+liXQLE6Rnyr+ybDu7r rEz0sMziwK999qJR/qxuj/cQpuAP/Dq5amETOlsoD03elapgZWGmObR51SALof4le/lG OtDo2py6A0w09yjTxfBneJeyny++ApmbH2bE2n3b2jQJ8/CVy4sY983bkFyGhTYBe+g+ KaMlHzZbnaxTdpaYuEqAv0QQrK02ClGsvHBvUvAJSWX3avBqSDW0tiVbG/QA/Tb4W7VE FpGSXoFnMFV6te/q5bT9KIhHvi7ZGxWN6HflyHgncK/wxOhGnpfjHhZ3T7/sMhdCQO+P gsog== X-Gm-Message-State: AJIora8VT3zJewAK/qlnSDs/D/LuMrlM6t45kg+w1Yp0PgR1xDXTCr62 htCI6HS21tAqB7EXuwQzJWF7UH5hBPz57J1w3/ygeg== X-Google-Smtp-Source: AGRyM1uHTzCyVAEwaQCgt07MuKAtpwBktlsdB7zVhwi/2LgdETQvt5b+Q8RLNFBkOTDSMkk6P/3EQaKIW5AMQdCfLcU= X-Received: by 2002:a17:90b:1d91:b0:1f0:7824:1297 with SMTP id pf17-20020a17090b1d9100b001f078241297mr242040pjb.126.1657649496958; Tue, 12 Jul 2022 11:11:36 -0700 (PDT) MIME-Version: 1.0 References: <20220710073213.bkkdweiqrlnr35sv@google.com> <20220712043914.pxmbm7vockuvpmmh@macbook-pro-3.dhcp.thefacebook.com> In-Reply-To: From: Shakeel Butt Date: Tue, 12 Jul 2022 11:11:25 -0700 Message-ID: Subject: Re: [PATCH bpf-next 0/5] bpf: BPF specific memory allocator. To: Tejun Heo , Mina Almasry 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 Content-Type: text/plain; charset="UTF-8" ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=XxQywCdn; spf=pass (imf23.hostedemail.com: domain of shakeelb@google.com designates 209.85.216.54 as permitted sender) smtp.mailfrom=shakeelb@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657649498; a=rsa-sha256; cv=none; b=rizLzzO08sPPPanxTiZMdpIzPHi3a59f/vMSUHZH/VXv4gM8tuw9WDxCwv1lBbtmiQAHFg jJ0GV0ur3bDwCC2ABDsgfG4reMwbzw8Oy+3QTYQ60oWAXUDKvbpN5EW+uolgdzi3znEbAm Y3aBjnYLrL3/st3ilOlnzd5Phn+dWB8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657649498; h=from:from: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=tBx1pY9EtMlCrqsynZvCfTIrEDWjv6gTf74UrxEZY3g=; b=f1LHOBoSAeGpu2i4uMV6UgEIBPGcHxGXoMW3mK83l2ktdeyma6Vsqhrsf9ZAmB63CdvLn7 V+F/QY2pzfi06EbNFAzPeW1SS2XUjsYM5rLZAXYt9ymu1750W5OLRzmAtLAL+EDAUsjzTW uf9jWZ1EflecilE8+T2a3WFSP+zlGyI= X-Rspamd-Queue-Id: 25465140079 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=XxQywCdn; spf=pass (imf23.hostedemail.com: domain of shakeelb@google.com designates 209.85.216.54 as permitted sender) smtp.mailfrom=shakeelb@google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 1ethcpr3n7r5p3swiydsbujww81tgz3k X-HE-Tag: 1657649497-206705 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: Ccing Mina who actually worked on upstreaming this. See [1] for previous discussion and more use-cases. [1] https://lore.kernel.org/linux-mm/20211120045011.3074840-1-almasrymina@google.com/ On Tue, Jul 12, 2022 at 10:36 AM Tejun Heo wrote: > > 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? Mina, can you please provide details requested by Tejun? > > 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