Re: [PATCH -next] cgroup: Introduce css_is_online() helper

From: Jan Kara
Date: Tue Apr 23 2024 - 17:19:31 EST


On Tue 23-04-24 05:56:38, Tejun Heo wrote:
> Hello,
>
> On Tue, Apr 23, 2024 at 03:49:23PM +0200, Jan Kara wrote:
> > On Sat 20-04-24 09:44:28, Xiu Jianfeng wrote:
> > > Introduce css_is_online() helper to test if whether the specified
> > > css is online, avoid testing css.flags with CSS_ONLINE directly
> > > outside of cgroup.c.
> > >
> > > Signed-off-by: Xiu Jianfeng <xiujianfeng@xxxxxxxxxx>
> >
> > Looks good. Feel free to add:
> >
> > Reviewed-by: Jan Kara <jack@xxxxxxx>
>
> I'm a bit skeptical about these trivial helpers. If the test is something
> more involved or has complications which need documentation (e.g. regarding
> synchronization and what not), the helper would be useful even if it's just
> as a place to centrally document what's going on. However, here, it's just
> testing one flag and I'm not sure what benefits the helper brings.

Yeah OK. I felt the motivation was so that writeback code doesn't have to
peek into cgroup "internals" so I'm fine with the change from writeback
POV. But if you don't see the point from cgroup side than sure I'm fine
without this change as well.

Honza

--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR