All of lore.kernel.org
 help / color / mirror / Atom feed
From: Muchun Song <muchun.song@linux.dev>
To: Yosry Ahmed <yosryahmed@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@kernel.org>,
	Roman Gushchin <roman.gushchin@linux.dev>,
	Shakeel Butt <shakeelb@google.com>,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	cgroups@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm: memcg: remove direct use of __memcg_kmem_uncharge_page
Date: Wed, 13 Dec 2023 22:26:50 +0800	[thread overview]
Message-ID: <6F87D2CF-42AB-4225-BCF0-3F25F38A643A@linux.dev> (raw)
In-Reply-To: <20231213130414.353244-1-yosryahmed@google.com>



> On Dec 13, 2023, at 21:04, Yosry Ahmed <yosryahmed@google.com> wrote:
> 
> memcg_kmem_uncharge_page() is an inline wrapper around
> __memcg_kmem_uncharge_page() that checks memcg_kmem_online() before
> making the function call. Internally, __memcg_kmem_uncharge_page() has a
> folio_memcg_kmem() check.
> 
> The only direct user of __memcg_kmem_uncharge_page(),
> free_pages_prepare(), checks PageMemcgKmem() before calling it to avoid
> the function call if possible. Move the folio_memcg_kmem() check from
> __memcg_kmem_uncharge_page() to memcg_kmem_uncharge_page() as
> PageMemcgKmem() -- which does the same thing under the hood. Now
> free_pages_prepare() can also use memcg_kmem_uncharge_page().
> 
> No functional change intended.
> 
> Signed-off-by: Yosry Ahmed <yosryahmed@google.com>

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

Thanks


  reply	other threads:[~2023-12-13 14:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13 13:04 [PATCH] mm: memcg: remove direct use of __memcg_kmem_uncharge_page Yosry Ahmed
2023-12-13 14:26 ` Muchun Song [this message]
2023-12-13 15:01 ` Matthew Wilcox
2023-12-13 15:08   ` Yosry Ahmed
2023-12-13 15:38     ` Matthew Wilcox
2023-12-13 15:42       ` Yosry Ahmed
2023-12-13 16:23         ` Matthew Wilcox
2023-12-13 16:24           ` Yosry Ahmed
2023-12-13 16:27             ` Matthew Wilcox
2023-12-13 16:31               ` Yosry Ahmed
2023-12-13 20:23                 ` Shakeel Butt
2023-12-13 20:27                   ` Matthew Wilcox
2023-12-13 20:41                     ` Shakeel Butt
2023-12-13 20:58                       ` Shakeel Butt
2023-12-13 22:04                         ` Yosry Ahmed
2023-12-13 22:12                           ` Shakeel Butt
2023-12-13 22:15                             ` Yosry Ahmed
2023-12-14  1:46                             ` 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=6F87D2CF-42AB-4225-BCF0-3F25F38A643A@linux.dev \
    --to=muchun.song@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=roman.gushchin@linux.dev \
    --cc=shakeelb@google.com \
    --cc=willy@infradead.org \
    --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.