Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp589265rdb; Thu, 21 Dec 2023 21:15:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVor6T/b9KzA4K/2zzVgcT0Zk7mgKeoGwVGk3yS4VrzgFVg/mKtRn2DcHfb5coqtAnNj/P X-Received: by 2002:a17:903:41c4:b0:1d3:e539:b593 with SMTP id u4-20020a17090341c400b001d3e539b593mr635362ple.79.1703222115283; Thu, 21 Dec 2023 21:15:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703222115; cv=none; d=google.com; s=arc-20160816; b=xAnQk5uL7te5qdOIJjB8m03c3IV3Sa1bHSDz2G+3Rilqwhk2z4JQVV5leFyNqCdVj9 cN6du99N9AKLR2SfSdPd0D8g7HV8rvsZyxw6fSHq/B/iFoXVUy6C35YjTtKUBhLlVrSA YssLAhsh6/LFF1B7lYDfkEZyAtL7/31gkWzzDJ7frKFO8+D/9DLdx3VRwKFjlWeuCo9D aSDA9wsD+17m7o/9UbSTwVrhxv4FRFBYcyPIJz2XBL3wfpRRQZkwhcTnKfTGYzv31/VS sxXgyrFESlHjHj+nqtFTFYq7S36h+tmj3P9cR/SDfCCcDq11DZ0f9xX1RLNQ/XM1wonX J6sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=8EpVJPwV8xdpCi/BHsDHoW6FS2qv5qcoyo7OpZbQn6A=; fh=QEI1gMNkC/37qvdNqH0L5TdW8qnI7E5vYhHUHHtSVFM=; b=alx80/bLUvymQR26q0d7jiIiReh4sshwPktmj7KWU4ZCgMPv5UmQdpixAaV0prO1kj ZxGY1JgS6ysqXrLwDDAYdvbKLdVSqhWQodbWyixZWq2cxSBE59JHxvqLg33JQ1FUZ5FI cAMWAlFzlkLGckPy/JHlIUXKBzdX9yEhNbeJpxsRasYAvN2N+VUZpIYL0g8blFXaosiD xpWg4kayL6s8HoGlZKeu3SVsZ3T+OF5QoF0BiNktNngL54AgmfevpZ0fIo0L9ofk8E5X pmch4TnCNrGfIRIgI0y8oIimoq/M26WvdVs70OK7mRO9rE3GOPb1nHiHgt/+yLvo5S+R x/SA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=WCx9S3m7; spf=pass (google.com: domain of linux-kernel+bounces-9362-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9362-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u8-20020a170902e80800b001d36df58b93si2657333plg.544.2023.12.21.21.15.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 21:15:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9362-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=WCx9S3m7; spf=pass (google.com: domain of linux-kernel+bounces-9362-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9362-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id DCEBAB22936 for ; Fri, 22 Dec 2023 05:15:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 696B5B666; Fri, 22 Dec 2023 05:14:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="WCx9S3m7" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5912AB64C for ; Fri, 22 Dec 2023 05:14:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1d3fde109f2so70465ad.1 for ; Thu, 21 Dec 2023 21:14:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1703222094; x=1703826894; darn=vger.kernel.org; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=8EpVJPwV8xdpCi/BHsDHoW6FS2qv5qcoyo7OpZbQn6A=; b=WCx9S3m7pk1lihD5xJoDSKjIa9xo9tRYe3zQ9eUez0o1qJW2zagmSpFDObFRmIOdTi k9ox3oU6BN6FwFNEIhoJ4EnwYJ2XexVBJ9lrkW57IXwNsquUGo9b/yLgaPydp85awA3x NY1E/d0fvasvkSRJaMbcPKQrwPbcYkTBBFKTMi9s8c2MEkl71AbPei+bAAmN6V9Sw509 fh4pHV8g9Acn0MfpYf2N3iEaWxWWIn/fVDGEY1L7Xb936i2pZ+UGlLOFaQzW0KvrMCDz LksD8UqiJlhaXYAm7zWWeADf+Nm6vfy0Dg3PgScKI4my/ECTWEeUfk/AFDQDulrncwTz cDrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703222094; x=1703826894; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8EpVJPwV8xdpCi/BHsDHoW6FS2qv5qcoyo7OpZbQn6A=; b=DcHcmwGtmrPZ0BYJhiACMhe56WEHCh9/ry3c59UolRzKssaIHGAZVNtAzTd4uK2rUh F9T2bYzGqxzfz8T3EgpzxF9ZxD7v2/B6Z8C/E7ufnRJFmyP/6i3XjjTNqtHXogkasmhV 6MjdQEEHVpniCx6BBoLfFLAvMNgz35/W04GDY9fT4jCn/zTpsg4vI1fk93sSbg6ttZst +BLa5l0CwRqDo5ixE93dKQfyp/GOV92oCYNXcB9DWg+FzOYSUb/9h6IGO8o4ttn+0qod gkO9GBEW531besfC2QEp2Lh515wRxuE02bAl/SD71M/0SbxhjDhA2n3FsrX40n0LO9aG oGgw== X-Gm-Message-State: AOJu0Yya0eHh+h7R4e0saUcnjZRjTm4HDQTy58NK15yAGR8CLdu12cXE T4al7UlIF52nRHdt4vrGnuseB8Z986gK X-Received: by 2002:a17:903:2310:b0:1d3:dc24:31c with SMTP id d16-20020a170903231000b001d3dc24031cmr61138plh.3.1703222094173; Thu, 21 Dec 2023 21:14:54 -0800 (PST) Received: from [2620:0:1008:15:a7bc:c7f0:fb7e:556d] ([2620:0:1008:15:a7bc:c7f0:fb7e:556d]) by smtp.gmail.com with ESMTPSA id y21-20020a17090ad71500b0028b43d3250csm2653671pju.43.2023.12.21.21.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 21:14:53 -0800 (PST) Date: Thu, 21 Dec 2023 21:14:52 -0800 (PST) From: David Rientjes To: Yu Zhao cc: Henry Huang , yuanchu@google.com, akpm@linux-foundation.org, =?UTF-8?B?6LCI6Ym06ZSL?= , linux-kernel@vger.kernel.org, linux-mm@kvack.org, =?UTF-8?B?5pyx6L6JKOiMtuawtCk=?= Subject: Re: [RFC v2] mm: Multi-Gen LRU: fix use mm/page_idle/bitmap In-Reply-To: Message-ID: <931f2e6d-30a1-5f10-e879-65cb11c89b85@google.com> References: <20231222024458.12441-1-henry.hj@antgroup.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="2003067076-520779642-1703222093=:711362" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --2003067076-520779642-1703222093=:711362 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Thu, 21 Dec 2023, Yu Zhao wrote: > > Thanks for replyting. > > > > On Fri, Dec 22, 2023 at 07:16 AM Yuanchu Xie wrote: > > > How does the shared memory get charged to the cgroups? > > > Does it all go to cgroup A or B exclusively, or do some pages get > > > charged to each one? > > > > Some pages get charged to cgroup A, and the other get charged to cgroup B. > > Just a side note: > We can potentially "fix" this, but it doesn't mean this is a good > practice. In fact, I think this is an anti-pattern to memcgs: > resources should be preferably isolated between memcgs, or if a > resource has to be shared between memcgs, it should be charged in a > predetermined way, not randomly to one of the memcgs sharing it. > Very interesting thread, a few questions for Henry to understand the situation better: - is the lack of predeterministic charging a problem for you? Are you initially faulting it in a manner that charges it to the "right" memcg and the refault of it after periodic reclaim can causing the charge to appear "randomly," i.e. to whichever process happened to access it next? - are pages ever shared between different memcg hierarchies? You mentioned sharing between processes in A and A/B, but I'm wondering if there is sharing between two different memcg hierarchies where root is the only common ancestor? - do you anticipate a shorter scan period at some point? Proactively reclaiming all memory colder than one hour is a long time :) Are you concerned at all about the cost of doing your current idle bit harvesting approach becoming too expensive if you significantly reduce the scan period? - is proactive reclaim being driven by writing to memory.reclaim, by enforcing a smaller memory.high, or something else? Looking forward to learning more about your particular issue. --2003067076-520779642-1703222093=:711362--