Re: [PATCH] mm/memcg: Skip high limit check in root memcg

From: Michal Hocko
Date: Tue Feb 21 2023 - 10:21:23 EST


On Tue 21-02-23 22:21:45, Haifeng Xu wrote:
[...]
> >> The test result show that with or without the patch, the time taken is almost the same.
> >
> > This is in line with my expectation. So the question is whether the
> > additional check is really worth it.
>
> This patch doesn't bring any obvious benifit or harm, but the high
> limit check in root memcg seems a little weird. Maybe we can add this
> check

Well, I do not see the code to look weird TBH. There is nothing wrong in
doing the check for the root memcg. It is a bit pointless but it is not
incorrect.

> It all depends on your viewpoint.

>From my POV, I prefer changes that either fix something (correctness
issue or a performance issue/improvement) or improve readbility. The
check doesn't fix anything and I am not convinced about an improved
readabilit either.

Thanks for the patch anyway!
--
Michal Hocko
SUSE Labs