Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10324240rwl; Wed, 11 Jan 2023 18:27:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXvBvw1MWoetp2y/Oa5PH+UNgmhjUna+x03uVW1sswScmvluNGBg2vvMJeAKPBUss3H3Gs9p X-Received: by 2002:a05:6402:610:b0:499:bffb:7e58 with SMTP id n16-20020a056402061000b00499bffb7e58mr9806127edv.20.1673490430314; Wed, 11 Jan 2023 18:27:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673490430; cv=none; d=google.com; s=arc-20160816; b=qqRV+eYx2QhZg+lrACAIYKAhVPmajq0I5G6h0J8goEYOJkeXokm5+o/7GoPbBvCkxb HZrkJetD2CylaAh2+5DGrWiQ+Bi2wCppqyi4GWll6YS6mYdDrE2RYqbhmvXP+DRSbetP lAYEirXNwZDuOJMtK0hsoCHrHo4PzeJQAnfhm3gvOrkBjRdcC0Sjc6QrsmDeAsOtw1lD Oxyu7lE1rtWoxy+2xspMHMEukItx94EuqVQpnQSU1doCnukskapFNdWqp6YJmZ1sQWRm SeC1juxU4rS4rauG8yZsbkByQ0BqI1RiR91moIn7ky0K3aSU1mGnpf+2g1soO226Ra+I nKxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UI4K5mRi88yph1Y15SVIzngc8V0hAChiN1WwnseNjSo=; b=fUmQ6UFmpQuU/k3++k8RU4vd9k1i4KkXa5EkPBdrBZi0yQEXSSHa+PdgSREZjaNMIs aMSMGOQMmfB6ixJ4v7cbMFasFd9HN0xW4qC7C16h8sy6E40RdiQPqIJND+EJcF5bwkaI /mDuqMcSsN2V9bGM5VHt0ct6TaTgrAdudfSlapRcM5q9aGQHCb+3M5mmRbRgEW9IkpeN vjB1pSQXLJZquFSCdayuYkSf0RRLKUmAQm3Qq5CioYTRftpFBQHQ1fsocmpYa+XUZYOy J0Gg5bgX70IH7QQCx3w2xFTFhzUKnWgNA6VSsNQLBHBjJGEB5+UKHKsRqpWQTMcRKDqT 3e3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=iX6gRZV8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bq25-20020a056402215900b00499d35c5777si4235655edb.107.2023.01.11.18.26.58; Wed, 11 Jan 2023 18:27:10 -0800 (PST) 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=@google.com header.s=20210112 header.b=iX6gRZV8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235706AbjALBuR (ORCPT + 50 others); Wed, 11 Jan 2023 20:50:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbjALBuO (ORCPT ); Wed, 11 Jan 2023 20:50:14 -0500 Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EB714101D for ; Wed, 11 Jan 2023 17:50:13 -0800 (PST) Received: by mail-yb1-xb2c.google.com with SMTP id 188so17059583ybi.9 for ; Wed, 11 Jan 2023 17:50:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=UI4K5mRi88yph1Y15SVIzngc8V0hAChiN1WwnseNjSo=; b=iX6gRZV8sICaehqfIKKCsTSZN1Qto1VW/o+R0dPGvkB24JZnDkCpMXaGC1UFCMCDAc 65kuNToXIj4iXR4wXhLwWIDCeYuJgxjaQ/q+do9MI07FludH6aZA3vLr/9IkjsITho1/ ZgBV3Si+v22hTmbdtckw6PN7PpNig1Dew2+7PUya3A5kMFGyHhvVHfD+DbOlVm71omPW 1SwwzDe4Gs6f0NzLBZ+IIXwOGRD9kSi2XJe8Qd8ijsWWpakPWge0tVjudFgQAW3GGS2R cIJHdBLnBJ4GCsGFjMH/J/n5H+PMYqXtd3GCNGPPiJ91I14Hcy8XzkCIj2evn8CIcQit LY4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=UI4K5mRi88yph1Y15SVIzngc8V0hAChiN1WwnseNjSo=; b=IUdwCnkMH5zhdpJ9wyJ/e8jVb//DNvNSbiotevvs5QUuRxfgoVsNr2PTmY7A7V3Q9e o7bw3t7jr7VNPFH2DBz8XAIn5tOfv71j2NJXOpxA8GgOxTN9QFZN+Rd2LDCqWVTyNCXX 0ygmF3WD3/oaRz6XJ9Jf2YiGV1ngc4x6zBgHXJwUzobEemZ2gayeWzitCoX1OqUvlw/j 7bUsJnnKF8wgIQ21TATkmKBbdezfnnIw/1taxuMW1U1pjNTPBCtBgCeHgirzzegkcTEH 9MNOEMaate9njrZCVhVOUiBO4UaTm5ZrMjIKKUX7+5gQnxFkcFdP2AZJtCxrimq9oI8b d6OQ== X-Gm-Message-State: AFqh2kqahOGLonBd4ZsNI0p2thuqYF9+PD4Ws4/Jzt+1/UbMuVwTqeUH 0PVocWpVFAtKXqZq2RC6DaJQ34IP58mtrud1GnHo2w== X-Received: by 2002:a05:6902:1029:b0:77d:eb9f:1381 with SMTP id x9-20020a056902102900b0077deb9f1381mr7180187ybt.475.1673488213106; Wed, 11 Jan 2023 17:50:13 -0800 (PST) MIME-Version: 1.0 References: <20221214225123.2770216-1-yuanchu@google.com> <87k01ulxdd.fsf@linux.ibm.com> In-Reply-To: <87k01ulxdd.fsf@linux.ibm.com> From: Yuanchu Xie Date: Wed, 11 Jan 2023 17:50:02 -0800 Message-ID: Subject: Re: [RFC PATCH 0/2] mm: multi-gen LRU: working set extensions To: "Aneesh Kumar K.V" Cc: Johannes Weiner , Michal Hocko , Roman Gushchin , Yu Zhao , Andrew Morton , Shakeel Butt , Muchun Song , linux-kernel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham 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 On Mon, Jan 9, 2023 at 10:25 PM Aneesh Kumar K.V wrote: > > Yuanchu Xie writes: > > > Introduce a way of monitoring the working set of a workload, per page > > type and per NUMA node, with granularity in minutes. It has page-level > > granularity and minimal memory overhead by building on the > > Multi-generational LRU framework, which already has most of the > > infrastructure and is just missing a useful interface. > > > > MGLRU organizes pages in generations, where an older generation contains > > colder pages, and aging promotes the recently used pages into the young > > generation and creates a new one. The working set size is how much > > memory an application needs to keep working, the amount of "hot" memory > > that's frequently used. The only missing pieces between MGLRU > > generations and working set estimation are a consistent aging cadence > > and an interface; we introduce the two additions. > > So with kold kthread do we need aging in reclaim ? Should we switch reciam > to wakeup up kold kthread to do aging instead of doing try_to_inc_max_seq? > This would also help us to try different aging mechanism which can run > better in a kthread. If I understand correctly, MGLRU tries to put off aging as much as possible for reclaim, and prefers aging uniformly in kswapd, so that already sort of happens. With periodic aging on, reclaim only triggers aging when it reclaims memory less than (MIN_NR_GENS * aging_interval) cold.