Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp879701rdb; Fri, 22 Dec 2023 07:41:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxM2dilE4erHc17Be0vWgeDQJLFbumumui+I/W8kVNCFqbsWqqa2/r0tVYMLw8vGgM6K+N X-Received: by 2002:a50:cd95:0:b0:553:71a8:9ead with SMTP id p21-20020a50cd95000000b0055371a89eadmr450234edi.16.1703259683927; Fri, 22 Dec 2023 07:41:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703259683; cv=none; d=google.com; s=arc-20160816; b=UFauWSs2k8YH6l8h9ToeHJ4CVWrO2Jj4TKxx7Bl4jbiNWQacexHgvWcWUWptfxBf1t E5pKDEEtgk/40KWzyfGDBk/JfTN2E6lRPLM4MJtZU9E6su36uHVePaN8vPsVV9DG1eEm SRguWmoxBkIAaaiE58gOWYT+I1hDC7ljmxDFUA8qnRx1VTAof7L0RSTJI5BCktdw5SR2 E3YX28HPyvudBu6gR+TElYPcDxDsn7P1JynWP7qVljdaVa9qkw5Q6bx1trpo9jqMy0T1 IiXZ04uV8698tmLXECu/fgQ25ChmWarDT6A6vxnHWXtleyiyR8KiX6kK1nvESVYEgvEQ C62A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=umQ1Kf4ezSraBidPnhVIzeWunCloE/CW0wcXFbztK+A=; fh=WdlE9OHYDmZp78PFuz8eQSKXtwhhnFgdn4zRCcFYspo=; b=yeMXmNHHgFIOrejDCN1EgEFo0w9ofVUWgEVz3Ik4k82l2LmtPlHMnY20V6yeFamMu2 VNGDpUhqZOhhcS1RY9eYouhU5BmwZfhH7aXFAVsmd0L7Ifjvf6IjDxvg3w/AHG5gqe7A 8xayZuAGfacUwELR+eNppf5chJbu6+600SvioQzoO1lOmrT6/cszNPHe8joTEFaikIl4 MyIb90cxCH7ArdVXYYmr8SlGlP2YcCNa555gbGx8s2tWaNFtyvxrIRSZIb+qqHXK890M o8JNjK1nig9ixLp9MXNbyilk2bLMUPksp03zp4j3DKK2QtShSj9dC3sQfQqZt4UpKTwb H2fA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-9850-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9850-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id y59-20020a50bb41000000b00552dc1dd9cesi1805941ede.654.2023.12.22.07.41.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 07:41:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9850-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-9850-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9850-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.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 am.mirrors.kernel.org (Postfix) with ESMTPS id B9A811F23439 for ; Fri, 22 Dec 2023 15:41:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B53082377E; Fri, 22 Dec 2023 15:41:01 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from out187-3.us.a.mail.aliyun.com (out187-3.us.a.mail.aliyun.com [47.90.187.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1B189241E6 for ; Fri, 22 Dec 2023 15:40:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=antgroup.com X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047198;MF=henry.hj@antgroup.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---.Vqjmyjt_1703259637; Received: from localhost(mailfrom:henry.hj@antgroup.com fp:SMTPD_---.Vqjmyjt_1703259637) by smtp.aliyun-inc.com; Fri, 22 Dec 2023 23:40:38 +0800 From: "Henry Huang" To: rientjes@google.com Cc: , "Henry Huang" , "=?UTF-8?B?6LCI6Ym06ZSL?=" , , , "=?UTF-8?B?5pyx6L6JKOiMtuawtCk=?=" , , Subject: Re: [RFC v2] mm: Multi-Gen LRU: fix use mm/page_idle/bitmap Date: Fri, 22 Dec 2023 23:40:33 +0800 Message-ID: <20231222154037.62823-1-henry.hj@antgroup.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <931f2e6d-30a1-5f10-e879-65cb11c89b85@google.com> References: <931f2e6d-30a1-5f10-e879-65cb11c89b85@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks for replying. On Fri, Dec 22, 2023 at 13:14 PM David Rientjes wrote: > - 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? Actually at begin, all pages got charged to cgroup A, but with memory pressure or after proactive reclaim. Some pages would be dropped or swapped. Task in cgroup B visit this shared memory before task in cgroup A, would make these pages charged to cgroup B. This is common in our enviorment. > - 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? Yes, there is a another really common case: If docker graph driver is overlayfs, different docker containers use the same image, or share same low layers, would share file cache of public bin or lib(i.e libc.so). > - 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? We don't want the owner of the application to feel a significant performance downgrade when using swap. There is a high risk to reclaim pages which idle age are less than 1 hour. We have internal test and data analysis to support it. We disabled global swappiness and memcg swapinness. Only proactive reclaim can swap anon pages. What's more, we see that mglru has a more efficient way to scan pte access bit. We perferred to use mglru scan help us scan and select idle pages. > - is proactive reclaim being driven by writing to memory.reclaim, by > enforcing a smaller memory.high, or something else? Because all pages info and idle age are stored in userspace, kernel can't get these information directly. We have a private patch include a new reclaim interface to support reclaim pages with specific pfns. -- 2.43.0