[ovs-dev] [PATCH 4/4] conntrack: compact the size of conn structure.

Gaëtan Rivet grive at u256.net
Tue Mar 2 20:01:26 UTC 2021


On Sun, Nov 29, 2020, at 03:32, hepeng.0320 wrote:
> From: hepeng <hepeng.0320 at bytedance.com>
> 
> This patch tries to use ovs_spin_lock as an alternative to reduce the
> size of each conn. The ovs_mutex_lock consumes 48 bytes while the
> ovs_spin_lock only uses 16 bytes.

Using a spin-lock means that the thread won't yield. It might be fine for userland datapath threads, but those are not the only one locking the connections. The ct_clean thread will do, and will execute on randomly assigned CPUs, potentially blocking other threads from being scheduled there. As many conn critical sections are not short, this could impair other modules beyond conntrack.

Gaining some bytes is good, but it needs more thought and opinions. There might be other venues available, less risky, to reduce the size.

>                                                            Also, we remove the alg info into an
> extra space as alg is not common in the real world userspace ct use case.
> (mostly used as security group and nat in the cloud).

Can you submit this as a separate commit?

> 
> The size of conn_tcp: 312 -> 240.
> 
> Signed-off-by: Peng He <hepeng.0320 at bytedance.com>

Regards,
-- 
Gaetan Rivet


More information about the dev mailing list