From: David Hildenbrand <david@redhat.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Shakeel Butt <shakeel.butt@linux.dev>
Cc: Muchun Song <muchun.song@linux.dev>,
cgroups@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/3] mm: Opencode split_page_memcg() in __split_huge_page()
Date: Tue, 5 Nov 2024 18:30:20 +0100 [thread overview]
Message-ID: <85f36754-a05d-40b7-b606-2515ac921c82@redhat.com> (raw)
In-Reply-To: <20241104210602.374975-2-willy@infradead.org>
On 04.11.24 22:05, Matthew Wilcox (Oracle) wrote:
> This is in preparation for only handling kmem pages in
> __split_huge_page().
Did you mean "in split_page_memcg()"?
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
> mm/huge_memory.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index f92068864469..44d25a74b611 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -3234,6 +3234,10 @@ static void __split_huge_page_tail(struct folio *folio, int tail,
> folio_set_large_rmappable(new_folio);
> }
>
> +#ifdef CONFIG_MEMCG
> + new_folio->memcg_data = folio->memcg_data;
> +#endif> +
> /* Finally unfreeze refcount. Additional reference from page cache. */
> page_ref_unfreeze(page_tail,
> 1 + ((!folio_test_anon(folio) || folio_test_swapcache(folio)) ?
> @@ -3267,8 +3271,11 @@ static void __split_huge_page(struct page *page, struct list_head *list,
> int order = folio_order(folio);
> unsigned int nr = 1 << order;
>
> - /* complete memcg works before add pages to LRU */
> - split_page_memcg(head, order, new_order);
> +#ifdef CONFIG_MEMCG
> + if (folio_memcg_charged(folio))
Do we have the mem_cgroup_disabled() call here?
Apart from that LGTM.
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2024-11-05 17:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 21:05 [PATCH 0/3] Introduce acctmem Matthew Wilcox (Oracle)
2024-11-04 21:05 ` [PATCH 1/3] mm: Opencode split_page_memcg() in __split_huge_page() Matthew Wilcox (Oracle)
2024-11-05 17:30 ` David Hildenbrand [this message]
2024-11-04 21:05 ` [PATCH 2/3] mm: Simplify split_page_memcg() Matthew Wilcox (Oracle)
2024-11-05 17:34 ` David Hildenbrand
2024-11-08 15:06 ` Zi Yan
2024-11-04 21:06 ` [PATCH 3/3] mm: Introduce acctmem Matthew Wilcox (Oracle)
2024-11-06 0:09 ` [PATCH 0/3] " Roman Gushchin
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=85f36754-a05d-40b7-b606-2515ac921c82@redhat.com \
--to=david@redhat.com \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=willy@infradead.org \
/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