From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=bkaSeVmQ; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 1735B5A026F for ; Tue, 07 Oct 2025 14:15:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1759839309; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZoKelfDuG9XveYso+dS2QllZvBo3ra/F6c7vV08O+4I=; b=bkaSeVmQC81pqgyjj+Dd/bj48ov5w7Wbq99QkLOuIH6ctElp7m4LfEZN+EyfmAwhGyUhtJ BxEAgS04+4vASWKyCt4Tioq69zV958fOm42dOspRR7kvxny3kpXrOgqMm5SlLeq+Yk4P5m hzVAMKYcv4DY6t+gExgCdlLOjUrdIoA= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-695-gJqNftFlPMmnxUEIaco2Iw-1; Tue, 07 Oct 2025 08:15:07 -0400 X-MC-Unique: gJqNftFlPMmnxUEIaco2Iw-1 X-Mimecast-MFC-AGG-ID: gJqNftFlPMmnxUEIaco2Iw_1759839306 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-46e25f5ed85so38672515e9.3 for ; Tue, 07 Oct 2025 05:15:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759839306; x=1760444106; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ZoKelfDuG9XveYso+dS2QllZvBo3ra/F6c7vV08O+4I=; b=JjyuDiRJffQaabHNxtAO4GIgeyoIHK4zSIIQdnGF2k8UdXafajJ/zkisRoDUbigFHz /1odBJmhADIdDzmm5fkRjbHkH2XvhLkaQi3tQV/oCabBd5RT63DDPTrqU9m4Qu5whgoC dpPhYqDtzJmV4wgHPCSDCUIoVqqu9efD1ZIZ5IiSYTYQfS2yt0/asOcCriEtk8O3qOx9 yAMiotwDVb2/4/3FKOPT/93J8E4QCYVEHoNbdEfvYTLd3Jtk43MYQlNfd3TTEUE5qQd6 PHBachwZyu+tTpZHpBTA0hDIBiw/NAeTRKdVnFZQ6L546/NUEeOQ4TQc5Hv68iFwaqhd fHDw== X-Forwarded-Encrypted: i=1; AJvYcCW1JlOcSCxuG9qzIG2FYDu0niqqIDTTwCR+kRYuNiSU2zh8PjA23+/7H2xEdbRJ+vS+ETmmOZUkjv8=@passt.top X-Gm-Message-State: AOJu0YzhjayZt0bhAk01VZGKY3eQFyAQ/N6wQzR94vSeNtU72Dl3yk70 ALh7BtK/e9ZK8GATjJrxgZu/ICsGl83NYLztqg+PrzF2INACbnhMWZ0mxGpU3ADaAY9myvq/gZg y7Qwiu49DtmYYft8NTu3hDqNXjZ33E5f/iv/pYkXURJ625XsksoOVIw== X-Gm-Gg: ASbGncvfDu38zzspY2oJiWZmkb0Ua912JFhUs3lFoeOyYwwlVOvqwyeKSfFuSAzgR7j dvVB9sjeXLRZMwi8sXfTNMi3NPCxlKg6A4wRc2Vv60yK80in+m2fNe2lTMsndaITjYEGp+j/3b3 muI/z+L0qJKV8zrwSxSGpV6zR1oSSNF2qb+5oIYb++F1YCwMkJMX+tVvUHNdWMyxM4aMU5geR6R 9ACwlSf6GEBmNNjPf7kM4TqJDgTriAUsjNoTlUWzJikQCFm4DEbwlg0kBHJXoBvW+T/HQAJ987r 2k5MGNDtm7xk3nCG4VZLvmOP+5t4cR+RQq/FSFl1jm4H3ThJ/9GL6Vbr X-Received: by 2002:a05:600c:37cd:b0:46e:23d3:6413 with SMTP id 5b1f17b1804b1-46e710b23cfmr113073925e9.0.1759839306273; Tue, 07 Oct 2025 05:15:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTvldMQup3EXWx2DwFZdnIjq28GIhWUvPn6szcPRvytTF6PS1KrJIdQKnM3eqtEmgsfxYPXQ== X-Received: by 2002:a05:600c:37cd:b0:46e:23d3:6413 with SMTP id 5b1f17b1804b1-46e710b23cfmr113073565e9.0.1759839305688; Tue, 07 Oct 2025 05:15:05 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-46e675b557fsm302187215e9.0.2025.10.07.05.15.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Oct 2025 05:15:05 -0700 (PDT) Date: Tue, 7 Oct 2025 14:15:03 +0200 From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH 3/5] tcp, flow: Replace per-connection in_epoll flag with epollfd in flow_common Message-ID: <20251007141503.1a79ae57@elisabeth> In-Reply-To: References: <20251003152717.2437765-1-lvivier@redhat.com> <20251003152717.2437765-4-lvivier@redhat.com> <20251007115117.3ba165a4@elisabeth> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: ejYrkYIQz4-VhUk-2X1H7N_qIdLyKEgFPJb1ENg8bO8_1759839306 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: RK32YXWQZFBK6QM36OSVERQA3CP4BDOU X-Message-ID-Hash: RK32YXWQZFBK6QM36OSVERQA3CP4BDOU X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson , passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, 7 Oct 2025 14:07:39 +0200 Laurent Vivier wrote: > On 07/10/2025 11:51, Stefano Brivio wrote: > > On Tue, 7 Oct 2025 17:07:37 +1100 > > David Gibson wrote: > > > >> On Fri, Oct 03, 2025 at 05:27:15PM +0200, Laurent Vivier wrote: > >>> The in_epoll boolean flag in tcp_tap_conn and tcp_splice_conn only tracked > >>> whether a connection was registered with epoll, not which epoll instance. > >>> This limited flexibility for future multi-epoll support. > >>> > >>> Replace the boolean with an epollfd field in flow_common that serves dual > >>> purpose: zero indicates not registered (replacing in_epoll=false), non-zero > >> > >> Don't use 0, since that's a valid fd. > >> > >>> stores the actual epoll fd (replacing in_epoll=true). > >> > >> I am a bit nervous about adding 31-bits to every flow, since I think > >> we're fairly close to a cacheline threshold. > > > > I mentioned to Laurent in our weekly call on Monday the same concern > > and that I would look into it (first step, I would say, actually check > > with pahole?) and, if it's an issue, into possible tricks to avoid > > making the struct too big. I still plan to do this. > > I think it already doesn't fit in a cacheline: > > struct flow_common { > enum flow_state state:8; /* 0: 0 4 */ > enum flow_type type:8; /* 0: 8 4 */ > > /* Bitfield combined with next fields */ > > uint8_t pif[2]; /* 2 2 */ > struct flowside side[2]; /* 4 72 */ > > /* size: 76, cachelines: 2, members: 4 */ > /* last cacheline: 12 bytes */ > }; Look at union flow, as we have an array of those, not flow_common. It's two cachelines at the moment, we shouldn't go beyond that, and keeping some margin would be nice as TCP might need some more bits eventually. -- Stefano