Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2166306rdb; Thu, 7 Dec 2023 23:12:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IGKGpeWmtz2XJ0rrcMS/da9xwT+0EVdpO6ULvOmryeGP6Ze+FH2Dp789iivU7LdnDb1xkn2 X-Received: by 2002:a17:90b:1206:b0:286:ab7f:af49 with SMTP id gl6-20020a17090b120600b00286ab7faf49mr3004727pjb.11.1702019573536; Thu, 07 Dec 2023 23:12:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702019573; cv=none; d=google.com; s=arc-20160816; b=AQvju+UDgFVjyp4WULohH1FWDoTlctxmX52pyotd9kmpnYqQWlNAT7/ar4FKoPr4ZL DgbdhgLqDy9q3cT2rO5kemovz/u8kPQ7lTj7whBqIFuzSpM5fXoLSKUwAj+KUd3bFTMU zqwePiSkFjKojXmABEsMwWDbx8ajp9h95FUd9OkgAvWE+1NAWc+fCstm717xALr5jNUL L6IJXMXRqR6BPr7HoQA2RCuQ2pITDKUs7LY0xDNkIIesdMwbPt87nJCWwDSZzB0eM1p9 jNDYxbi3JP3JDh78eeFW9gdUxYBdVjnLBDLuIjEM++v+cRCbvRSdrzZH8r3j7kf0nDdF bViQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=0jCKjINSeCT77PAEDxhYqvu8YaWjxfjdg/6ob432Tw4=; fh=S4lUwSxCn71a7YT201Ob8X3Hqa/Ap1E0ikdFbILLwhA=; b=1AkqCpP/1jT0SG5tXbPVQHEaYFXzxotRAqt39UMOek5czODq5zjZYurK43w7Mk20TW ARa995vHve07MgKJQkk7PdteMw5BIps1Fyg5OjTD4Fv7jyC5jOnhPvoUjGZ4yhwl1FfP rcZwdTcBXrm4Gc6cpBhRPv3PgfNCxbd0wUI1LeZNa2qdXaDu7GXjFOzCOEwa/T+CaTBq 0xyM9NTshbCiNbDI0ESRk9QF8hEDtCsO382K2r7ep596584hMjaVv5TeFOloZXjAba/Q kqkp/dRWhMqOrYkTnZ2xIaAX3TEJZWyLSyui9ua3hqZN5UhgUVKWL31lFD3MdSqtQO0l QLMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id w8-20020a17090abc0800b00285196ac998si1194731pjr.104.2023.12.07.23.12.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 23:12:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id DA87980FE286; Thu, 7 Dec 2023 23:12:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233024AbjLHHMf (ORCPT + 99 others); Fri, 8 Dec 2023 02:12:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbjLHHMe (ORCPT ); Fri, 8 Dec 2023 02:12:34 -0500 Received: from out0-222.mail.aliyun.com (out0-222.mail.aliyun.com [140.205.0.222]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E7D6D54 for ; Thu, 7 Dec 2023 23:12:39 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047190;MF=henry.hj@antgroup.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---.VfcfN-q_1702019557; Received: from localhost(mailfrom:henry.hj@antgroup.com fp:SMTPD_---.VfcfN-q_1702019557) by smtp.aliyun-inc.com; Fri, 08 Dec 2023 15:12:37 +0800 From: "Henry Huang" To: yuzhao@google.com Cc: , , "=?UTF-8?B?6LCI6Ym06ZSL?=" , "=?UTF-8?B?5pyx6L6JKOiMtuawtCk=?=" , Subject: Re: [RFC v2] mm: Multi-Gen LRU: fix use mm/page_idle/bitmap Date: Fri, 08 Dec 2023 15:12:35 +0800 Message-ID: <20231208071235.17812-1-henry.hj@antgroup.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 07 Dec 2023 23:12:51 -0800 (PST) Thanks for replying this RFC. > 1. page_idle/bitmap isn't a capable interface at all -- yes, Google > proposed the idea [1], but we don't really use it anymore because of > its poor scalability. In our environment, we use /sys/kernel/mm/page_idle/bitmap to check pages whether were accessed during a peroid of time. We manage all pages idle time in userspace. Then use a prediction algorithm to select pages to reclaim. These pages would more likely be idled for a long time. We only need kernel to tell use whether a page is accessed, a boolean value in kernel is enough for our case. > 2. PG_idle/young, being a boolean value, has poor granularity. If > anyone must use page_idle/bitmap for some specific reason, I'd > recommend exporting generation numbers instead. Yes, at first time, we try using multi-gen LRU proactvie scan and exporting generation&refs number to do the same thing. But there are serveral problems: 1. multi-gen LRU only care about self-memcg pages. In our environment, it's likely to see that different memcg's process share pages. multi-gen LRU only update gen of pages in current memcg. It's hard to judge a page whether is accessed depends on gen update. We still have no ideas how to solve this problem. 2. We set swappiness 0, and use proactive scan to select cold pages & proactive reclaim to swap anon pages. But we can't control passive scan(can_swap = false), which would make anon pages cold/hot inversion in inc_min_seq. Is it a good idea to include a interface to config passive scan option? -- 2.43.0