From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7144ECAAD8 for ; Sun, 18 Sep 2022 20:48:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F1D52940007; Sun, 18 Sep 2022 16:48:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ECDD86B0075; Sun, 18 Sep 2022 16:48:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D6CC8940007; Sun, 18 Sep 2022 16:48:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C93896B0074 for ; Sun, 18 Sep 2022 16:48:00 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id A3ED480A52 for ; Sun, 18 Sep 2022 20:48:00 +0000 (UTC) X-FDA: 79926393120.01.9882C14 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf22.hostedemail.com (Postfix) with ESMTP id 325CBC0018 for ; Sun, 18 Sep 2022 20:47:59 +0000 (UTC) Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-345188a7247so238910707b3.22 for ; Sun, 18 Sep 2022 13:47:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:from:to:cc:subject:date; bh=yukdN/NNiZkdpQOUkkw8VV3nsFMmM4H3QYKUUrnAd/U=; b=fS4bzBU3GIyv0KbuVZ2mzHkMN8Br35m0dNT58hAHVd1a0YnJpYGj5HG0ZGYFKes8ot kTGltQr120sEuMISpTlFs7MqNWzX9u2EwNrDY7SLDtb1+N1v2JVT4Hr2elH7Jw6UfVvB S/j2E69yjui8WW0v+wRrlMYWsT41SVqwXasx27guX1h7+aJKZGKHmwSvv8LkSMLDikBB oMd875pjB4vIEqeXkYW6YhbkPxHwdISa2lyktBTJGp+26aopdlpX215c6x4iidCRM0DQ tSO8+VcFeUJEKKGh0a4RqquQigezf7d/tg1xls1omXRtgbsFG0qDGlMHZTqHPa/f5iWb SU1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:references:mime-version:message-id:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date; bh=yukdN/NNiZkdpQOUkkw8VV3nsFMmM4H3QYKUUrnAd/U=; b=d5jHL3NvkCoobWxoz126BnrK4vivboQWOKpFWmWRKPLr52jzs3j8V281ud7qDcIpSp l3gGMNpDHXUDk1FL+E0Nscr+uwXpCRzWxsTpplIsjPcz/urVtKUr9vlzYlKEY76sJHDN q1vj6GXBwM0x4IfLItlsxB1UMNob6g6am6rZYfESq5lweGyGrZA+mqP9eI8jgNnQZTqQ /iqhB0MzNY6CoXrP/Gtx9C7IcmM88D9obCFi/PXbVuW0gzTqvEa5GEOWvEDLelX+56TS f4iKA9/1YFqgGccEHE6iErh7rEEWXJgdcSTtpTYkP7hPj1lMzHW50Ty/y5Hv3ItixwxR lagQ== X-Gm-Message-State: ACrzQf2O/sWhmg2uPlhhOF2u52PpVksBbjdm6vminobxam1l+sqTGONj aPw8KGuTTfyi2+mhja0DcigAb7WZLr4= X-Google-Smtp-Source: AMsMyM5EIZEMGRedxI/d4mtyPvfC50YMjnZSbOfZxEdEsW0skxjj99QQdYzOfAOYUD9f2WwXIoIe+K9NgQE= X-Received: from yuzhao.bld.corp.google.com ([2620:15c:183:200:ccff:7b62:4ed6:2946]) (user=yuzhao job=sendgmr) by 2002:a25:4c03:0:b0:6b3:e5e4:cf29 with SMTP id z3-20020a254c03000000b006b3e5e4cf29mr2686638yba.553.1663534079319; Sun, 18 Sep 2022 13:47:59 -0700 (PDT) Date: Sun, 18 Sep 2022 14:47:45 -0600 In-Reply-To: Message-Id: <20220918204755.3135720-1-yuzhao@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.37.3.968.ga6b4b080e4-goog Subject: [PATCH v14-fix 01/11] mm: multi-gen LRU: update admin guide From: Yu Zhao To: Andrew Morton Cc: linux-mm@kvack.org, Yu Zhao , Mike Rapoport Content-Type: text/plain; charset="UTF-8" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663534080; a=rsa-sha256; cv=none; b=sTusQDpQdLDWhgoJDqmKCiuIwBkSqsZTZd1YPA8i+SUOEA3IYGpoEiLVCIRlvBDGfmJHTr tZBt4JXfU7kiB60oD7UihrWVAdoPCePAeRByl9AeQmObYBn8SttarcBUchZIaS54nNpAI3 y0Lon7mK0Av3V1rWNVa4g0R/eLMvR0M= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=fS4bzBU3; spf=pass (imf22.hostedemail.com: domain of 3_4MnYwYKCMQ849rkyqyyqvo.mywvsx47-wwu5kmu.y1q@flex--yuzhao.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3_4MnYwYKCMQ849rkyqyyqvo.mywvsx47-wwu5kmu.y1q@flex--yuzhao.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663534080; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=yukdN/NNiZkdpQOUkkw8VV3nsFMmM4H3QYKUUrnAd/U=; b=2YGShC4I9GOoxEwdRos2jGQz484ZgunxfXXrGf1Fvg+PBSLpeYhovL3WoE6vdu3O7LI6Ma pXj6WPjfckhbihi6E7lg/+Jz1heHKQccWJighc9PZ22vlukLNziU6tCtLkcNYGJhEWT1lg PUaY7ip0yoQBQg0LfQGIUd1wuFWb8ng= Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=fS4bzBU3; spf=pass (imf22.hostedemail.com: domain of 3_4MnYwYKCMQ849rkyqyyqvo.mywvsx47-wwu5kmu.y1q@flex--yuzhao.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3_4MnYwYKCMQ849rkyqyyqvo.mywvsx47-wwu5kmu.y1q@flex--yuzhao.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: 4enqrdkee3ok3pjxe877jxgindbm9i69 X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 325CBC0018 X-HE-Tag: 1663534079-72220 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000034, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Link: https://lore.kernel.org/r/YvoOAJhJlvCr35Xc@kernel.org/ Suggested-by: Mike Rapoport Signed-off-by: Yu Zhao --- Documentation/admin-guide/mm/multigen_lru.rst | 50 +++++++++++-------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/Documentation/admin-guide/mm/multigen_lru.rst b/Documentation/admin-guide/mm/multigen_lru.rst index 6355f2b5019d..33e068830497 100644 --- a/Documentation/admin-guide/mm/multigen_lru.rst +++ b/Documentation/admin-guide/mm/multigen_lru.rst @@ -119,15 +119,18 @@ within ``age_in_ms``. E.g., ``min_gen_nr`` contains the coldest pages and ``max_gen_nr`` contains the hottest pages, since ``age_in_ms`` of the former is the largest and that of the latter is the smallest. -Users can write ``+ memcg_id node_id max_gen_nr -[can_swap [force_scan]]`` to ``lru_gen`` to create a new generation -``max_gen_nr+1``. ``can_swap`` defaults to the swap setting and, if it -is set to ``1``, it forces the scan of anon pages when swap is off, -and vice versa. ``force_scan`` defaults to ``1`` and, if it is set to -``0``, it employs heuristics to reduce the overhead, which is likely -to reduce the coverage as well. +Users can write the following command to ``lru_gen`` to create a new +generation ``max_gen_nr+1``: -A typical use case is that a job scheduler writes to ``lru_gen`` at a + ``+ memcg_id node_id max_gen_nr [can_swap [force_scan]]`` + +``can_swap`` defaults to the swap setting and, if it is set to ``1``, +it forces the scan of anon pages when swap is off, and vice versa. +``force_scan`` defaults to ``1`` and, if it is set to ``0``, it +employs heuristics to reduce the overhead, which is likely to reduce +the coverage as well. + +A typical use case is that a job scheduler runs this command at a certain time interval to create new generations, and it ranks the servers it manages based on the sizes of their cold pages defined by this time interval. @@ -137,20 +140,23 @@ Proactive reclaim Proactive reclaim induces page reclaim when there is no memory pressure. It usually targets cold pages only. E.g., when a new job comes in, the job scheduler wants to proactively reclaim cold pages on -the server it selected to improve the chance of successfully landing +the server it selected, to improve the chance of successfully landing this new job. -Users can write ``- memcg_id node_id min_gen_nr [swappiness -[nr_to_reclaim]]`` to ``lru_gen`` to evict generations less than or -equal to ``min_gen_nr``. Note that ``min_gen_nr`` should be less than -``max_gen_nr-1`` as ``max_gen_nr`` and ``max_gen_nr-1`` are not fully -aged and therefore cannot be evicted. ``swappiness`` overrides the -default value in ``/proc/sys/vm/swappiness``. ``nr_to_reclaim`` limits -the number of pages to evict. +Users can write the following command to ``lru_gen`` to evict +generations less than or equal to ``min_gen_nr``. -A typical use case is that a job scheduler writes to ``lru_gen`` -before it tries to land a new job on a server. If it fails to -materialize enough cold pages because of the overestimation, it -retries on the next server according to the ranking result obtained -from the working set estimation step. This less forceful approach -limits the impacts on the existing jobs. + ``- memcg_id node_id min_gen_nr [swappiness [nr_to_reclaim]]`` + +``min_gen_nr`` should be less than ``max_gen_nr-1``, since +``max_gen_nr`` and ``max_gen_nr-1`` are not fully aged (equivalent to +the active list) and therefore cannot be evicted. ``swappiness`` +overrides the default value in ``/proc/sys/vm/swappiness``. +``nr_to_reclaim`` limits the number of pages to evict. + +A typical use case is that a job scheduler runs this command before it +tries to land a new job on a server. If it fails to materialize enough +cold pages because of the overestimation, it retries on the next +server according to the ranking result obtained from the working set +estimation step. This less forceful approach limits the impacts on the +existing jobs. -- 2.37.3.968.ga6b4b080e4-goog