[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABi4-ogLNdQw=gLTRZ4aJ8qiQWiovHaO19sx5uz29Es6du8GKg@mail.gmail.com>
Date: Mon, 7 Apr 2025 16:30:46 -0700
From: Jordan Rife <jordan@...fe.io>
To: Kuniyuki Iwashima <kuniyu@...zon.com>
Cc: aditi.ghag@...valent.com, bpf@...r.kernel.org, daniel@...earbox.net,
martin.lau@...ux.dev, netdev@...r.kernel.org, willemdebruijn.kernel@...il.com
Subject: Re: [RFC PATCH bpf-next 2/3] bpf: udp: Avoid socket skips and repeats
during iteration
> We may need to iterate all visited sockets again in this bucket if all
> unvisited sockets disappear from the previous iteration.
If the next socket disappears between iterator stop and start, the
outer loop would need to keep going until it finds a socket from last
time that still exists. In most cases, it seems unlikely that the next
socket will disappear between iterator reads, so in general the outer
loop would only need to iterate once; the common case should perform
the same as before with the offset approach. The worst case indeed
would be if all the sockets disappear between reads. Then you'd have
to scan through all items in the bucket n_cookies times. Again though,
this is hopefully a rare case.
> When the number of the unvisited sockets is small like 1, the duplicated
> records will not be rare and rather more often than before ?
Sorry if I'm missing something, but what's the relationship between
the number of unvisited sockets and rarity of duplicated records?
-Jordan
Powered by blists - more mailing lists