mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shakeel Butt <shakeel.butt@linux.dev>
To: Qi Zheng <qi.zheng@linux.dev>
Cc: hughd@google.com, baolin.wang@linux.alibaba.com,
	usama.arif@linux.dev,  brauner@kernel.org,
	akpm@linux-foundation.org, david@kernel.org, linux-mm@kvack.org,
	 linux-kernel@vger.kernel.org,
	Qi Zheng <zhengqi.arch@bytedance.com>
Subject: Re: [PATCH v4 2/4] mm: memcontrol: make obj_cgroup_memcg() handle NULL objcg
Date: Mon, 17 Aug 2026 09:05:35 -0700	[thread overview]
Message-ID: <aoMxN97qg8uzk04R@linux.dev> (raw)
In-Reply-To: <09bcf74312246a6e4146be8a0cb9787f8beddb28.1786955972.git.zhengqi.arch@bytedance.com>

On Mon, Aug 17, 2026 at 05:03:26PM +0800, Qi Zheng wrote:
> From: Qi Zheng <zhengqi.arch@bytedance.com>
> 
> obj_cgroup_memcg() currently requires a non-NULL objcg, so callers that
> may hold a NULL objcg must guard the call with an explicit NULL check.
> This pattern is duplicated in folio_memcg(), folio_memcg_check(),
> mm/page_owner.c, and mm/zswap.c.
> 
> Teach obj_cgroup_memcg() to accept NULL and return NULL in that case, then
> remove the redundant NULL checks at the call sites.  Also remove the
> mem_cgroup_from_entry() wrapper in zswap, which existed solely to provide
> this NULL-safe behaviour, and replace its two callers with direct
> obj_cgroup_memcg() calls.
> 
> No functional change intended.
> 
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>

Acked-by: Shakeel Butt <shakeel.butt@linux.dev>


  parent reply	other threads:[~2026-08-17 16:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17  9:03 [PATCH v4 0/4] make unused huge shrinker memcg aware Qi Zheng
2026-08-17  9:03 ` [PATCH v4 1/4] fs: fix missed removal of super_fs_objects_eligible() Qi Zheng
2026-08-17  9:03 ` [PATCH v4 2/4] mm: memcontrol: make obj_cgroup_memcg() handle NULL objcg Qi Zheng
2026-08-17 11:29   ` Qi Zheng
2026-08-17 16:05   ` Shakeel Butt [this message]
2026-08-17  9:03 ` [PATCH v4 3/4] mm: shmem: move unused huge shrinklist queuing past the truncation check Qi Zheng
2026-08-17  9:03 ` [PATCH v4 4/4] mm: shmem: make unused huge shrinker memcg aware Qi Zheng
2026-08-18  3:54   ` Baolin Wang

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=aoMxN97qg8uzk04R@linux.dev \
    --to=shakeel.butt@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=brauner@kernel.org \
    --cc=david@kernel.org \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=qi.zheng@linux.dev \
    --cc=usama.arif@linux.dev \
    --cc=zhengqi.arch@bytedance.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

all inboxes | Powered by JetHome®