All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tao Cui <cui.tao@linux.dev>
To: Ren Wei <n05ec@lzu.edu.cn>, cgroups@vger.kernel.org
Cc: tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com,
	pandit.parav@gmail.com, yuantan098@gmail.com,
	zcliangcn@gmail.com, bird@lzu.edu.cn, tr0jan@lzu.edu.cn,
	d4n.for.sec@gmail.com
Subject: Re: [PATCH 1/1] cgroup: rdma: free idle pools during cgroup teardown
Date: Thu, 11 Jun 2026 13:25:54 +0800	[thread overview]
Message-ID: <0b1099e8-e124-4073-a0e8-2d4e85bc26dc@linux.dev> (raw)
In-Reply-To: <9eb365a37ab83f38686007f8a61a656759d39bd7.1781092143.git.d4n.for.sec@gmail.com>

Hi,

在 2026/6/11 02:13, Ren Wei 写道:
> From: Daming Li <d4n.for.sec@gmail.com>
> 
> rdmacg_css_offline() converts each pool to all-max limits so the
> existing reclaim path can free it after the last uncharge. However,
> zero-usage pools are already reclaimable at that point and leaving them
> linked until rdmacg_css_free() lets later device teardown hit a
> use-after-free when free_cg_rpool_locked() deletes cg_node from a freed
> cgroup list head.
> 
> Free zero-usage pools directly from rdmacg_css_offline() while holding
> rdmacg_mutex. This keeps the existing reclaim rule, avoids new lifetime
> states, and ensures a cgroup cannot be freed with reclaimable rdmacg
> pools still attached.
Looks good to me.

One minor note: the offline path skips rpool_has_persistent_state()
and frees idle pools unconditionally. This means peak/event stats are
lost earlier than before (at offline vs. at free). This is fine given
the cgroup is dying, and css_free() cleans up remaining pools anyway.

Reviewed-by: Tao Cui <cuitao@kylinos.cn>

Thanks,
--
Tao

  reply	other threads:[~2026-06-11  5:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1781092143.git.d4n.for.sec@gmail.com>
2026-06-10 18:13 ` [PATCH 1/1] cgroup: rdma: free idle pools during cgroup teardown Ren Wei
2026-06-11  5:25   ` Tao Cui [this message]
2026-06-11 17:29   ` Michal Koutný

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=0b1099e8-e124-4073-a0e8-2d4e85bc26dc@linux.dev \
    --to=cui.tao@linux.dev \
    --cc=bird@lzu.edu.cn \
    --cc=cgroups@vger.kernel.org \
    --cc=d4n.for.sec@gmail.com \
    --cc=hannes@cmpxchg.org \
    --cc=mkoutny@suse.com \
    --cc=n05ec@lzu.edu.cn \
    --cc=pandit.parav@gmail.com \
    --cc=tj@kernel.org \
    --cc=tr0jan@lzu.edu.cn \
    --cc=yuantan098@gmail.com \
    --cc=zcliangcn@gmail.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.