Re: [PATCH bpf-next 1/4] cgroup, psi: Init PSI of root cgroup to psi_system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Dec 23, 2023 at 1:47 AM Tejun Heo <tj@xxxxxxxxxx> wrote:
>
> Hello,
>
> On Fri, Dec 22, 2023 at 11:30:59AM +0000, Yafang Shao wrote:
> > By initializing the root cgroup's psi field to psi_system, we can
> > consistently obtain the psi information for all cgroups from the struct
> > cgroup.
> >
> > Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx>
> > ---
> >  include/linux/psi.h    | 2 +-
> >  kernel/cgroup/cgroup.c | 5 ++++-
> >  2 files changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/linux/psi.h b/include/linux/psi.h
> > index e074587..8f2db51 100644
> > --- a/include/linux/psi.h
> > +++ b/include/linux/psi.h
> > @@ -34,7 +34,7 @@ __poll_t psi_trigger_poll(void **trigger_ptr, struct file *file,
> >  #ifdef CONFIG_CGROUPS
> >  static inline struct psi_group *cgroup_psi(struct cgroup *cgrp)
> >  {
> > -     return cgroup_ino(cgrp) == 1 ? &psi_system : cgrp->psi;
> > +     return cgrp->psi;
> >  }
>
> How have you tested this change? Looking at the code there are other

After implementing the modification, I solely focused on validating
the functionality of root_cgrp->psi to ensure its compatibility with
the recent changes, akin to the self-tests performed in the previous
version [0]. However, it's noteworthy that building the kernel
necessitates clang-14+, hence, I refrained from incorporating this
into the current version.

Regarding the alterations made to /proc/pressure/, I haven't yet
conducted thorough verification to confirm if the adjustments are
comprehensive enough. I will analyze the potential impact on
/proc/pressure/* in the next phase.

[0]. https://lore.kernel.org/bpf/20230801142912.55078-4-laoar.shao@xxxxxxxxx/

> references to psi_system, e.g. to show it under /proc/pressure/* and to
> exempt it from CPU FULL accounting. I don't see how the above change would
> be sufficient.

Thanks for your suggestion.

-- 
Regards
Yafang





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux