linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Henry Huang" <henry.hj@antgroup.com>
To: yuanchu@google.com
Cc: akpm@linux-foundation.org, "Henry Huang" <henry.hj@antgroup.com>,
	谈鉴锋 <henry.tjf@antgroup.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	rientjes@google.com, "朱辉(茶水)" <teawater@antgroup.com>,
	yuzhao@google.com
Subject: Re: [RFC v2] mm: Multi-Gen LRU: fix use mm/page_idle/bitmap
Date: Fri, 12 Jan 2024 12:40:22 +0800	[thread overview]
Message-ID: <20240112044026.58580-1-henry.hj@antgroup.com> (raw)
In-Reply-To: <CAJj2-QG3jJcA=71n5imx+OjhMapPMN-1bfT5XQRjswxOPG9MvA@mail.gmail.com>

Thanks for replying.

On Thu, Jan 11, 2024 at 03:24 AM Yuanchu Xie <yuanchu@google.com> wrote:
> Does this present a problem with setting memcg limits or OOMs? It
> seems like deterministically charging shared pages would be highly
> desirable. Mina Almasry previously proposed a memcg= mount option to
> implement deterministic charging[1], but it wasn't a generic sharing
> mechanism. Nonetheless, the problem remains, and it would be
> interesting to learn if this presents any issues for you.
>
> [1] https://lore.kernel.org/linux-mm/20211120045011.3074840-1-almasrymina@google.com/

In this case, total size of shared memory usually is small(< 100MB).
What's more, almost shared pages were file cache. So it doesn't present any problems.

> I'm working on a kernel driver/per-memcg interface to perform aging
> with MGLRU, including configuration for the MGLRU page scanning
> optimizations. I suspect scanning the PTE accessed bits for pages
> charged to a foreign memcg ad-hoc has some performance implications,
> and the more general solution is to charge in a predetermined way,
> which makes the scanning on behalf of the foreign memcg a bit cleaner.
> This is possible nonetheless, but a bit hacky. Let me know you have
> any ideas.

Wow! per-memcg interface is also what we need.
It's hardly to control user's behaviors in our envrionment. We can't promise that all
process who share memory would be in same memcg.
Maybe kernel should provide new interface to make shared page charge more predictable.
I think it would take some overhead to do this.

The key problem of us is that we can't check whether page is accesed(no gen or ref changed) 
in this case.
page belongs to A, but maybe process in B read/write this page more frequently.
we may treat this page as cold page but accutly hot page.
Maybe just call folio_mark_accessed instead of folio_update_gen(should hold memcg lru lock)
for those remote memcg pages?

-- 
2.43.0



  reply	other threads:[~2024-01-12  4:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06 12:50 Henry Huang
2023-12-06 12:50 ` Henry Huang
2023-12-07  1:30   ` Yu Zhao
2023-12-08  7:12     ` Henry Huang
2023-12-15  6:46       ` Yu Zhao
2023-12-15 10:53         ` Henry Huang
2023-12-16 21:06           ` Yu Zhao
2023-12-17  6:59             ` Henry Huang
2023-12-21 23:15           ` Yuanchu Xie
2023-12-22  2:44             ` Henry Huang
2023-12-22  4:35               ` Yu Zhao
2023-12-22  5:14                 ` David Rientjes
2023-12-22 15:40                   ` Henry Huang
2024-01-10 19:24                     ` Yuanchu Xie
2024-01-12  4:40                       ` Henry Huang [this message]
2023-12-15  7:23   ` Yu Zhao
2023-12-15 12:44     ` Henry Huang

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=20240112044026.58580-1-henry.hj@antgroup.com \
    --to=henry.hj@antgroup.com \
    --cc=akpm@linux-foundation.org \
    --cc=henry.tjf@antgroup.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.com \
    --cc=teawater@antgroup.com \
    --cc=yuanchu@google.com \
    --cc=yuzhao@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox