On Wed, Jun 17, 2020 at 10:01 PM John Fastabend <john.fastabend@xxxxxxxxx> wrote: > > Martin KaFai Lau wrote: > > The cache_idx is currently picked by RR. There is chance that > > the same cache_idx will be picked by multiple sk_storage_maps while > > other cache_idx is still unused. e.g. It could happen when the > > sk_storage_map is recreated during the restart of the user > > space process. > > > > This patch tracks the usage count for each cache_idx. There is > > 16 of them now (defined in BPF_SK_STORAGE_CACHE_SIZE). > > It will try to pick the free cache_idx. If none was found, > > it would pick one with the minimal usage count. > > > > Signed-off-by: Martin KaFai Lau <kafai@xxxxxx> > > --- > > net/core/bpf_sk_storage.c | 41 +++++++++++++++++++++++++++++++++++---- > > 1 file changed, 37 insertions(+), 4 deletions(-) > > > > Acked-by: John Fastabend <john.fastabend@xxxxxxxxx> Applied. Thanks