Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10213783rwp; Thu, 20 Jul 2023 17:00:43 -0700 (PDT) X-Google-Smtp-Source: APBJJlEEqiBKcvYN1M9xA+ijQTQ5KsC1tvJwnCVGhl8msZpmwxVJ+R8VympQZL/s7aSD6F3VfGVC X-Received: by 2002:a17:902:e742:b0:1b6:7f96:42ca with SMTP id p2-20020a170902e74200b001b67f9642camr337028plf.66.1689897642622; Thu, 20 Jul 2023 17:00:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689897642; cv=none; d=google.com; s=arc-20160816; b=h1hU5w1BXUtBtvViNlCc0dpCbixJc3zCSrQQfDvAWc/q9G5yaEUa3pp3IGgEDQghwb UBY7nDXaDidrYgHlwD67PEF77xotBQxQhvgBHFc4TPDIbPZhqAVt1pRuHSZ3NmH9Nsmi iX73/tP0WFQp7741QN6fYHn1DlKI4g3ixZLDHWGdbVNAYzIqH02yPRwkz9KJZHRML1Xs HIzsLUCJgeHwCav9X7zEqqz2fTi53YWCSbIpKkEhimoAj3JmdYitGSyCYcXUygmIHZKV OLBkrpb/egXuLeED+Zz/3E0uyD/KW7xYpZi0d4f0h/XOkj/RlSPVg/c5vvtryPvJwWzm 8Gwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=QDyB0fNg8iWGoLzY4kcY3n9F15g3W1rTkoIJoBTRg3A=; fh=+tKKFn7RRllkbQdEDYa3Lku4wgQbUD1Z/HiEa4fR2/c=; b=0U0MOKibHdt8T2NAFxnas4V1CkS6911a4psBcJU+0aFxtovGA6JQFfMx/TUBaZ87qX vSEW5jjljsVvHuQg4NyklSw5L+W7XJdf15Eng3Wy0Oc8/odXY7MES/+tR/UGTITxS7Mq nVlgh/SIM36x34jU9mpsy9rBdsv/HvzRWH4KEwyQeoaTJco0x3+rnYGI+mzz9+6BKDND P5eomnTJpQ56Vy4NbhUvVNHcIVoHynBYFmP0LcvBymZzaHtY9NoHSo8Yj1rUZ5O4ouVH 1cL2ikMsBx01n0BMRq9uh9d9XVJjpm/QDnx3a09xt9B1e9jZ95r0Us/FXtq5NPcpkvSk AWMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=p+DjGaqx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kh5-20020a170903064500b001b8955938ccsi1722160plb.331.2023.07.20.17.00.29; Thu, 20 Jul 2023 17:00:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=p+DjGaqx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229665AbjGTXew (ORCPT + 99 others); Thu, 20 Jul 2023 19:34:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbjGTXeu (ORCPT ); Thu, 20 Jul 2023 19:34:50 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D746A358C; Thu, 20 Jul 2023 16:34:27 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-55ba895d457so746263a12.0; Thu, 20 Jul 2023 16:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689896031; x=1690500831; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=QDyB0fNg8iWGoLzY4kcY3n9F15g3W1rTkoIJoBTRg3A=; b=p+DjGaqxAYYqPCdrR2BuBFrntop3OtvaJ9VPhfM4o2gjf3vqRJipbYIu7R0l45bmex qOYSyJjyvqVatCS3/cx/jCT624c+7E64DfOD4mxB7fVWiy9qgxpagCj5Oq7t63/bbEbd 7XlvJpp22DUAqDFFOk1rUNh/4XL1OEyZ9/FICeZEWEvKrC3C2DaExZWPQbFmbi8btTih OdWniYrypHRj+r7hruEGoY+OT/ko57kNTp34phNCjotDBg6lkZQug5+DcQiRLL+PYgyn Urb767YbMH2gYYyExrPkfBmm/0ZwTrS0pZGlBY0dMuyw8WfHFCJ1y0ZDpbMza1FBy9MC D1mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689896031; x=1690500831; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QDyB0fNg8iWGoLzY4kcY3n9F15g3W1rTkoIJoBTRg3A=; b=NRiO54Rn8lbgKuokkNTepZppMGMOFYrCkQVoxv0Ad0EFubLQleHkEpk6xCnh4o/peO YLLuCLPHj+TGCO6T1llA3AG3s8F68RJbjLjpOS+Q3IlcI2OKG7IjJPr/pBYnBf47iV2J 2CYrERtybiMoiNZ00fNMTaAwtvPjYqQ0E38Jh7G2HKm93g3RpoRZrpWlyzSa3RU333ee UkRizE60IMyPAeGyZwBws1Ggia3JieNceOgS9BuvENiSZlZyEqWxgYaNurCwvJc+LfcM 1kVj2PhLeB01wnME9CYKfyXqfO8B7VnzurnFCSjOX3ymqMaeBHgG5zPdLmfZTDlSnbYU OF6w== X-Gm-Message-State: ABy/qLaWWkAIobOMSg3mbIX51AQa5zRisvuHCJRCI/W774kP9EqvSPA4 nOZ59PhDySnZzAQLOKwGkQ0= X-Received: by 2002:a17:90a:6b4f:b0:262:b22b:8ab5 with SMTP id x15-20020a17090a6b4f00b00262b22b8ab5mr128498pjl.17.1689896030994; Thu, 20 Jul 2023 16:33:50 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::5:fbd8]) by smtp.gmail.com with ESMTPSA id 3-20020a17090a01c300b00263c8b33bcfsm1576834pjd.14.2023.07.20.16.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jul 2023 16:33:50 -0700 (PDT) Sender: Tejun Heo Date: Thu, 20 Jul 2023 13:33:49 -1000 From: Tejun Heo To: "T.J. Mercier" Cc: Yosry Ahmed , Johannes Weiner , Andrew Morton , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , "Matthew Wilcox (Oracle)" , Zefan Li , Yu Zhao , Luis Chamberlain , Kees Cook , Iurii Zaikin , Greg Thelen , linux-kernel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org Subject: Re: [RFC PATCH 0/8] memory recharging for offline memcgs Message-ID: References: <20230720070825.992023-1-yosryahmed@google.com> <20230720153515.GA1003248@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Thu, Jul 20, 2023 at 04:24:02PM -0700, T.J. Mercier wrote: > > Hmm... so, usually, the problems we see are resources that are persistent > > across different instances of the same application as they may want to share > > large chunks of memory like on-memory cache. I get that machines get > > different dynamic jobs but unrelated jobs usually don't share huge amount of > > memory at least in our case. The sharing across them comes down to things > > like some common library pages which don't really account for much these > > days. > > > This has also been my experience in terms of bytes of memory that are > incorrectly charged (because they're charged to a zombie), but that is > because memcg doesn't currently track the large shared allocations in > my case (primarily dma-buf). The greater issue I've seen so far is the > number of zombie cgroups that can accumulate over time. But my > understanding is that both of these two problems are currently > significant for Yosry's case. memcg already does reparenting of slab pages to lower the number of dying cgroups and maybe it makes sense to expand that to user memory too. One related thing is that if those reparented pages are written to, that's gonna break IO isolation w/ blk-iocost because iocost currently bypasses IOs from intermediate cgroups to root but we can fix that. Anyways, that's something pretty different from what's proposed here. Reparenting, I think, is a lot less conroversial. Thanks. -- tejun