Messages in this thread | | | Date | Tue, 30 Apr 2024 10:45:06 -0700 | From | Shakeel Butt <> | Subject | Re: [PATCH v3 4/8] memcg: reduce memory for the lruvec and memcg stats |
| |
On Tue, Apr 30, 2024 at 10:30:51AM -0700, T.J. Mercier wrote: > On Mon, Apr 29, 2024 at 11:06 PM Shakeel Butt <shakeel.butt@linux.dev> wrote: > > > > + > > +static inline int memcg_stats_index(int idx) > > +{ > > + return mem_cgroup_stats_index[idx] - 1; > > Could this just be: return mem_cgroup_stats_index[idx]; > with a postfix increment of j in init_memcg_stats instead of prefix increment? >
The -1 is basically for error checking but I will do a followup patch to initialize the array/indirection-table with -1 and remove the subtraction from the fast path.
Thanks for the review.
| |