All of lore.kernel.org
 help / color / mirror / Atom feed
From: Muchun Song <muchun.song@linux.dev>
To: Mina Almasry <almasrymina@google.com>
Cc: Tejun Heo <tj@kernel.org>, Zefan Li <lizefan.x@bytedance.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Michal Hocko <mhocko@kernel.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Shakeel Butt <shakeelb@google.com>,
	Muchun Song <songmuchun@bytedance.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Huang Ying <ying.huang@intel.com>,
	Yang Shi <yang.shi@linux.alibaba.com>,
	Yosry Ahmed <yosryahmed@google.com>,
	weixugc@google.com, fvdl@google.com,
	Michal Hocko <mhocko@suse.com>,
	bagasdotme@gmail.com, cgroups@vger.kernel.org,
	Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	linux-kernel@vger.kernel.org,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [PATCH v3] mm: Add nodes= arg to memory.reclaim
Date: Sat, 3 Dec 2022 11:17:10 +0800	[thread overview]
Message-ID: <EC963F6F-75C3-4168-97B3-544C36C2600A@linux.dev> (raw)
In-Reply-To: <20221202223533.1785418-1-almasrymina@google.com>



> On Dec 3, 2022, at 06:35, Mina Almasry <almasrymina@google.com> wrote:
> 
> The nodes= arg instructs the kernel to only scan the given nodes for
> proactive reclaim. For example use cases, consider a 2 tier memory system:
> 
> nodes 0,1 -> top tier
> nodes 2,3 -> second tier
> 
> $ echo "1m nodes=0" > memory.reclaim
> 
> This instructs the kernel to attempt to reclaim 1m memory from node 0.
> Since node 0 is a top tier node, demotion will be attempted first. This
> is useful to direct proactive reclaim to specific nodes that are under
> pressure.
> 
> $ echo "1m nodes=2,3" > memory.reclaim
> 
> This instructs the kernel to attempt to reclaim 1m memory in the second tier,
> since this tier of memory has no demotion targets the memory will be
> reclaimed.
> 
> $ echo "1m nodes=0,1" > memory.reclaim
> 
> Instructs the kernel to reclaim memory from the top tier nodes, which can
> be desirable according to the userspace policy if there is pressure on
> the top tiers. Since these nodes have demotion targets, the kernel will
> attempt demotion first.
> 
> Since commit 3f1509c57b1b ("Revert "mm/vmscan: never demote for memcg
> reclaim""), the proactive reclaim interface memory.reclaim does both
> reclaim and demotion. Reclaim and demotion incur different latency costs
> to the jobs in the cgroup. Demoted memory would still be addressable
> by the userspace at a higher latency, but reclaimed memory would need to
> incur a pagefault.
> 
> The 'nodes' arg is useful to allow the userspace to control demotion
> and reclaim independently according to its policy: if the memory.reclaim
> is called on a node with demotion targets, it will attempt demotion first;
> if it is called on a node without demotion targets, it will only attempt
> reclaim.
> 
> Acked-by: Michal Hocko <mhocko@suse.com>
> Signed-off-by: Mina Almasry <almasrymina@google.com>

Acked-by: Muchun Song <songmuchun@bytedance.com>

Thanks.

  parent reply	other threads:[~2022-12-03  3:17 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02 22:35 [PATCH v3] mm: Add nodes= arg to memory.reclaim Mina Almasry
2022-12-02 23:51 ` Shakeel Butt
2022-12-03  3:17 ` Muchun Song [this message]
     [not found] ` <20221202223533.1785418-1-almasrymina-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2022-12-12  8:55   ` Michal Hocko
2022-12-12  8:55     ` Michal Hocko
     [not found]     ` <Y5bsmpCyeryu3Zz1-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-12-13  0:54       ` Mina Almasry
2022-12-13  0:54         ` Mina Almasry
2022-12-13  6:30         ` Huang, Ying
2022-12-13  7:48           ` Wei Xu
2022-12-13  8:51           ` Michal Hocko
2022-12-13 13:42             ` Huang, Ying
     [not found]           ` <87k02volwe.fsf-fFUE1NP8JkzwuUmzmnQr+vooFf0ArEBIu+b9c/7xato@public.gmane.org>
2022-12-13 13:30             ` Johannes Weiner
2022-12-13 13:30               ` Johannes Weiner
2022-12-13 14:03               ` Michal Hocko
     [not found]                 ` <Y5iGJ/9PMmSCwqLj-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-12-13 19:29                   ` Mina Almasry
2022-12-13 19:29                     ` Mina Almasry
2022-12-14 10:23                     ` Michal Hocko
2022-12-15  5:50                       ` Huang, Ying
     [not found]                         ` <87mt7pdxm1.fsf-fFUE1NP8JkzwuUmzmnQr+vooFf0ArEBIu+b9c/7xato@public.gmane.org>
2022-12-15  9:21                           ` Michal Hocko
2022-12-15  9:21                             ` Michal Hocko
2022-12-16  3:02                             ` Huang, Ying
     [not found]                       ` <Y5mkJL6I5Zlc1k97-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-12-15 17:58                         ` Wei Xu
2022-12-15 17:58                           ` Wei Xu
2022-12-16  8:40                           ` Michal Hocko
2022-12-13  8:33         ` Michal Hocko
2022-12-13 15:58           ` Johannes Weiner
     [not found]             ` <Y5iet+ch24YrvExA-druUgvl0LCNAfugRpC6u6w@public.gmane.org>
2022-12-13 19:53               ` Mina Almasry
2022-12-13 19:53                 ` Mina Almasry
2022-12-14  7:20                 ` Huang, Ying
2022-12-14  7:15             ` Huang, Ying
2022-12-14 10:43             ` Michal Hocko
2022-12-16  9:54     ` [PATCH] Revert "mm: add nodes= arg to memory.reclaim" Michal Hocko
2022-12-16 12:02       ` Mina Almasry
2022-12-16 12:22         ` Michal Hocko
2022-12-16 12:28       ` Bagas Sanjaya
     [not found]       ` <Y5xASNe1x8cusiTx-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-12-16 18:18         ` Andrew Morton
2022-12-16 18:18           ` Andrew Morton
     [not found]           ` <20221216101820.3f4a370af2c93d3c2e78ed8a-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2022-12-17  9:57             ` Michal Hocko
2022-12-17  9:57               ` Michal Hocko
     [not found]               ` <Y52Scge3ynvn/mB4-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-12-19 22:42                 ` Andrew Morton
2022-12-19 22:42                   ` Andrew Morton
2023-01-03  8:37                   ` Michal Hocko
2023-01-04  8:41                     ` Proactive reclaim/demote discussion (was Re: [PATCH] Revert "mm: add nodes= arg to memory.reclaim") Huang, Ying
2023-01-18 17:21                       ` Michal Hocko
     [not found]                         ` <Y8gqkub3AM6c+Z5y-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2023-01-19  8:29                           ` Huang, Ying
2023-01-19  8:29                             ` Huang, Ying

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EC963F6F-75C3-4168-97B3-544C36C2600A@linux.dev \
    --to=muchun.song@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=almasrymina@google.com \
    --cc=bagasdotme@gmail.com \
    --cc=cgroups@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=fvdl@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lizefan.x@bytedance.com \
    --cc=mhocko@kernel.org \
    --cc=mhocko@suse.com \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeelb@google.com \
    --cc=songmuchun@bytedance.com \
    --cc=tj@kernel.org \
    --cc=weixugc@google.com \
    --cc=yang.shi@linux.alibaba.com \
    --cc=ying.huang@intel.com \
    --cc=yosryahmed@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.