On Thu, Jun 04, 2026 at 06:41:43AM +0200, Stefano Brivio wrote:
On Thu, 28 May 2026 15:02:12 +1000 David Gibson
wrote: We have a special path that avoids updating conn->pending when the amounts read and written are equal. This has a conceptual complexity cost, in particular, it means that conn->pending[] is not accurate to its normal meaning for a section of the loop body.
conn->pending[] shares a cacheline with conn->pipe[] and conn->s[], so it's almost certainly cache-hot. It's questionable that avoiding the update of pending even outweighs the extra conditional branch, let alone saves anything of significance. Remove it.
I added this when we still had 64-bit counters, that is, two weeks before commit 37c228ada88b ("tap, tcp, udp, icmp: Cut down on some oversized buffers"), but now, as you point out, it doesn't make sense anymore.
Ah, that makes some sense. -- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson