On Tue, Jul 30, 2024 at 8:02 AM Pasha Tatashin <pasha.tatashin@xxxxxxxxxx> wrote: > > From: Shakeel Butt <shakeel.butt@xxxxxxxxx> > > At the moment the valid index for the indirection tables for memcg stats > and events is < S8_MAX. These indirection tables are used in performance > critical codepaths. With the latest addition to the vm_events, the > NR_VM_EVENT_ITEMS has gone over S8_MAX. One way to resolve is to > increase the entry size of the indirection table from int8_t to int16_t > but this will increase the potential number of cachelines needed to > access the indirection table. > > This patch took a different approach and make the valid index < U8_MAX. > In this way the size of the indirection tables will remain same and we > only need to invalid index check from less than 0 to equal to U8_MAX. > In this approach we have also removed a subtraction from the performance > critical codepaths. > > Signed-off-by: Shakeel Butt <shakeel.butt@xxxxxxxxx> > Co-developed-by: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx> > Signed-off-by: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx> Reviewed-by: Yosry Ahmed <yosryahmed@xxxxxxxxxx>