From patchwork Fri Feb 21 15:08:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13985652 X-Patchwork-Delegate: matthieu.baerts@tessares.net Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BF1F21019A for ; Fri, 21 Feb 2025 15:08:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740150534; cv=none; b=hHagjLACxTR08um+9X68Sq7ipRskTYHx8YC0d1JAExudSPplTRBZ5o8aMDmPMnpVCJbykRA+ohzDc4tBbBkDA61bZ5Zh7v0qd2kJ23btFQMcyrxvY8lIMxunU3YQny/UZQnkHFWXbM8KkTUuv8bGnLs9zRIw1o3BE6zKQRetr38= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740150534; c=relaxed/simple; bh=MThlESMFiVJ8eLTIi5akvzkQe7dsqviahjzAW4oHnes=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SYvI0HpEoBDUthT6EXUi64ddWffM4fv/FV1w9Zclq2T6av06TTeJE5aQ81LTMjyGkMZ1/sO9kKukqCejkLCpwTDokPWwUL/CCMtuPP6iqIJF10UkvrVpdf056/pzauFBXmVnC9SKfbAPmQPlAqB8uIAJgcXgywTLq+eF4rVu8fM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=reJqcMAE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="reJqcMAE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C18DC4CEE4; Fri, 21 Feb 2025 15:08:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740150533; bh=MThlESMFiVJ8eLTIi5akvzkQe7dsqviahjzAW4oHnes=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=reJqcMAEUDaHDVUS2p4s4fv3L/a6fw/Q315jYjUkWMZschJpVQgxIi+2jUXHlIC3I lguaqm5TvTNTU7xtkdZQ+0E97eIDBGIA3zrP+vUTBZqYiii5OIcBN7O8lXpUALgcyp iroXX+B4ueXD+BB6010EjHpTbvMiJo8kAnoy/fqlq4iafshbOE1EK0rI1VRIl/DrJz tbBeOoE/JBWXd63Am+OagJZhPueXXONLDOvHIkRXT5ntnJA8LYdN+kOBMl+KQYAMkV tcDR4uGD9ooeZju7u1elQWPWDq03spD2L1QuHmYkWOrxTZvHGMt3ic9DH1R6mYc0lG d+VpCWorHqhZA== From: "Matthieu Baerts (NGI0)" Date: Fri, 21 Feb 2025 16:08:44 +0100 Subject: [PATCH mptcp-next 1/2] mptcp: sched: reduce size for unused data Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250221-mptcp-sched-data-ptr-v1-1-dbaec476fa6b@kernel.org> References: <20250221-mptcp-sched-data-ptr-v1-0-dbaec476fa6b@kernel.org> In-Reply-To: <20250221-mptcp-sched-data-ptr-v1-0-dbaec476fa6b@kernel.org> To: mptcp@lists.linux.dev Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2510; i=matttbe@kernel.org; h=from:subject:message-id; bh=MThlESMFiVJ8eLTIi5akvzkQe7dsqviahjzAW4oHnes=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBnuJcDcRlKpkWhRNv+F7lor13Jb50iN1vPmySKI hvlgbhlJCmJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZ7iXAwAKCRD2t4JPQmmg cwsuEADta2Z3wDoo/DxBVLNZfwG/L0Tdwl7ATMM4vta5MjNhI3q1ptdCWMkDd3x1HAPBKd3BPlv CKoggzUoKFafxoYwlsxvH38Q4Tf0OzjJHq5mOUoE1XvEw3iLjJ0dGbN49r/8UaEEnaeSsp5AkRK sacpoLDxu2o9LHp1tn9XfglO5JXEiJe+Hs7kfr8tTh96xHwIITYwU3P/NIxTlnd2a311lpVM5kL 0IROhChZLsEavlhThbGOUIUeXUfZOX5KG1NjA66LZzJY33vn5UNKHUnPgxGA4JyVfypoyi2q18z qEAlyUWjbwZg0bq+7rqowgR0asQSHnYOFj9bh6VBiw8vh72boRThKgQZsRvOo9oOdPiPkHIZRw6 I35WPVJ8Ul0lztPBmv17jf/H7ooK+oRuD7S0PSYqdNmPR8+ZpLWiCU4AbVt7OU9DFJObJUmd/ri 12nqvAcJrMeZaqZGc+qNLiF6I4Zo6kzQej8snbWlHOonhcKC1085M22u4DAG3lEscJr06ONZkwI HmXMNokPfOJMstDCyKhBdvAAa/E6cBDyvdaC1YP0w4+c9eWnK4Rtd4K3up0VGHbG7/bajqsrXFA qk5306a4/Wuc+9LeIH6RmII8yaEbbodfMNmthXAjrfI1lCXoa8P7HRUBKmWE/z9Viz+DnF91IOT sOD8SfuI2bWbdiA== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 Thanks for the previous commit ("mptcp: sched: split get_subflow interface into two"), the mptcp_sched_data structure is now currently unused. This structure has been added to allow future extensions that are not ready yet. At the end, this structure will not even be used at all when mptcp_subflow bpf_iter will be supported [1]. Here is a first step to save 64 bytes on the stack for each scheduling operation. The structure is not removed yet not to break the WIP work on these extensions, but will be done when [1] will be ready and applied. Link: https://lore.kernel.org/6645ad6e-8874-44c5-8730-854c30673218@linux.dev [1] Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/sched.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/net/mptcp/sched.c b/net/mptcp/sched.c index 37d86aadaeaa523568a82ffb22254d1fb34a3d2d..c8e08f6c300d37584d3d89a01022b5677aa8b6bb 100644 --- a/net/mptcp/sched.c +++ b/net/mptcp/sched.c @@ -177,7 +177,7 @@ static void mptcp_sched_data_set_contexts(const struct mptcp_sock *msk, int mptcp_sched_get_send(struct mptcp_sock *msk) { struct mptcp_subflow_context *subflow; - struct mptcp_sched_data data; + struct mptcp_sched_data *data = NULL; msk_owned_by_me(msk); @@ -198,15 +198,15 @@ int mptcp_sched_get_send(struct mptcp_sock *msk) } if (msk->sched == &mptcp_sched_default || !msk->sched) - return mptcp_sched_default_get_send(msk, &data); - mptcp_sched_data_set_contexts(msk, &data); - return msk->sched->get_send(msk, &data); + return mptcp_sched_default_get_send(msk, data); + mptcp_sched_data_set_contexts(msk, data); + return msk->sched->get_send(msk, data); } int mptcp_sched_get_retrans(struct mptcp_sock *msk) { struct mptcp_subflow_context *subflow; - struct mptcp_sched_data data; + struct mptcp_sched_data *data = NULL; msk_owned_by_me(msk); @@ -220,10 +220,10 @@ int mptcp_sched_get_retrans(struct mptcp_sock *msk) } if (msk->sched == &mptcp_sched_default || !msk->sched) - return mptcp_sched_default_get_retrans(msk, &data); + return mptcp_sched_default_get_retrans(msk, data); - mptcp_sched_data_set_contexts(msk, &data); + mptcp_sched_data_set_contexts(msk, data); if (msk->sched->get_retrans) - return msk->sched->get_retrans(msk, &data); - return msk->sched->get_send(msk, &data); + return msk->sched->get_retrans(msk, data); + return msk->sched->get_send(msk, data); } From patchwork Fri Feb 21 15:08:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Baerts X-Patchwork-Id: 13985653 X-Patchwork-Delegate: matthieu.baerts@tessares.net Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2E8FC20A5C3 for ; Fri, 21 Feb 2025 15:08:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740150535; cv=none; b=WsF6UbJZt/ED860iDzf4xdjySt5B+pipSSfcafcx2k2FKUwyj899DlvA0sy7pjYJ2OcI6DB7lGJcNGuWQMdDQ6fDyl4udzY19JURNuZCONmp9ypcSsnaPSStwx8NXRdYRLlrgiSu8LzDEEMRPjAImhovPRnZZuYQ4+3XE9yx9D8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740150535; c=relaxed/simple; bh=gVnmfG/Jk809zxkJ47HI01joKTtxC0QiYVLumcmsEhA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=evd0z+xeA5umIAIEREoyQfShUK5B2kmGrUmvNNMDsdmGPjw4MEcuObpTrGWFLox7MsP7vAfCXXreMageVj57QABYGnY9Ibk9ZF3vjMqqqSrY436bF4f5J8raMEO6t1dicTHPtjCHIy7sQgemMaQcFrQ3N6wM/tR6cwqgXp1wAtU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WKYHtvCU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WKYHtvCU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 309D9C4CEE7; Fri, 21 Feb 2025 15:08:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740150534; bh=gVnmfG/Jk809zxkJ47HI01joKTtxC0QiYVLumcmsEhA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=WKYHtvCURe84P+jcHxKCUHuNrofokMitopvJ9xJ+FwsuUnRjS5X1tAGVFn1pesv3J AgEu9wlyEdnfN9AmPXdSphAPP6rd4kFTOeIt4bIncOYKGQHCQ/fN1m4ei8KT90r4ui WQXAAFxBDFPkM3pzwRYTKcBxaflr3cpUjd5zMfN6ngc2fBRK5O6vMl5TCS+I2TzHNP 5M2iRZFq9jwqVbxMyJZIi9wSvI++EFi6uuFkEKHU87yDE6Lf/60htIe6i+A5HexGnU lq5Cdpc9iiMPmQlxHDNFxRQffaZrCcY9LhkpRW+wDVDjdNLLJLwcl/9nG4mwgeieIE HQt3OxKTHUAPw== From: "Matthieu Baerts (NGI0)" Date: Fri, 21 Feb 2025 16:08:45 +0100 Subject: [PATCH mptcp-next 2/2] Squash to "mptcp: add sched_data helpers" Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250221-mptcp-sched-data-ptr-v1-2-dbaec476fa6b@kernel.org> References: <20250221-mptcp-sched-data-ptr-v1-0-dbaec476fa6b@kernel.org> In-Reply-To: <20250221-mptcp-sched-data-ptr-v1-0-dbaec476fa6b@kernel.org> To: mptcp@lists.linux.dev Cc: "Matthieu Baerts (NGI0)" X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2024; i=matttbe@kernel.org; h=from:subject:message-id; bh=gVnmfG/Jk809zxkJ47HI01joKTtxC0QiYVLumcmsEhA=; b=owEBbQKS/ZANAwAIAfa3gk9CaaBzAcsmYgBnuJcDUyF7hoBpqnADCOYHpHUzwVm2gjBbFog/t FXx7SrZSUKJAjMEAAEIAB0WIQToy4X3aHcFem4n93r2t4JPQmmgcwUCZ7iXAwAKCRD2t4JPQmmg c1+qD/4lu1HH8tW2XjAp16GtWgUnu1CWsKGtct5gXzeOepUwZdIwX2RqPSz9n5MaocQAEeBNmdb o9/6Xqubq2Ag0BSxP4kUrc0DqP0q8+aYB5aNqBb/NUL6RQCjRgYTedhBzF4TvwkKTqzEGBPR5XC D0QKD8tiOVto9I6Gr+y0T0JfBXZRJ5fpTXByWO+2lmuqA9zMAQvaHl0TLGuoqeyXry3E6YhYncY jf729utTyqfHs2B8VHGIJTsA6SoXwSdRz0qtR8vRYyOzYZesRwWZ5HGlyuvFSCZJVDaoykc+TB1 A8FkHHd4prV5+wCDZCspNJQ/u7jFolr7VaLi0Hf+cVZm0aFALJP7zZT0tjg2sPva5rZ60ANJ+s3 FIitWohd44hS4D+MsW/+SbQ4DkRZa6dt0hFaIBZWV+Mt3Q1NxQMs8Ys4rDUYJXM2nOLvhnBGWjB oazJeotCuKQZN7eBpcZ9we8KPtbOqMbHpi7DRaTtsjdbAbTaVOFReJWECn6/pq25Kjff9Pc8u37 FPnkR7oQN9MxWZtt+aLF72EG1yA8lCGBZijJVq0w4JjhLJelPPMlM4HeSh0jPLV/4ZuyLOmb2eT So39E9r+72RzkmIaavaoj/jehhk/DDld4GeOllctzvI5YhyV4pFPn1zD+f0uMT4JaKOOhhyZiz9 zI4jP4MuZLEmP/Q== X-Developer-Key: i=matttbe@kernel.org; a=openpgp; fpr=E8CB85F76877057A6E27F77AF6B7824F4269A073 "mptcp: add sched_data helpers" can be removed when "use bpf_iter in bpf schedulers" series will be applied. Same for the mptcp_sched_data structure. Signed-off-by: Matthieu Baerts (NGI0) --- net/mptcp/sched.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/net/mptcp/sched.c b/net/mptcp/sched.c index c8e08f6c300d37584d3d89a01022b5677aa8b6bb..37d86aadaeaa523568a82ffb22254d1fb34a3d2d 100644 --- a/net/mptcp/sched.c +++ b/net/mptcp/sched.c @@ -177,7 +177,7 @@ static void mptcp_sched_data_set_contexts(const struct mptcp_sock *msk, int mptcp_sched_get_send(struct mptcp_sock *msk) { struct mptcp_subflow_context *subflow; - struct mptcp_sched_data *data = NULL; + struct mptcp_sched_data data; msk_owned_by_me(msk); @@ -198,15 +198,15 @@ int mptcp_sched_get_send(struct mptcp_sock *msk) } if (msk->sched == &mptcp_sched_default || !msk->sched) - return mptcp_sched_default_get_send(msk, data); - mptcp_sched_data_set_contexts(msk, data); - return msk->sched->get_send(msk, data); + return mptcp_sched_default_get_send(msk, &data); + mptcp_sched_data_set_contexts(msk, &data); + return msk->sched->get_send(msk, &data); } int mptcp_sched_get_retrans(struct mptcp_sock *msk) { struct mptcp_subflow_context *subflow; - struct mptcp_sched_data *data = NULL; + struct mptcp_sched_data data; msk_owned_by_me(msk); @@ -220,10 +220,10 @@ int mptcp_sched_get_retrans(struct mptcp_sock *msk) } if (msk->sched == &mptcp_sched_default || !msk->sched) - return mptcp_sched_default_get_retrans(msk, data); + return mptcp_sched_default_get_retrans(msk, &data); - mptcp_sched_data_set_contexts(msk, data); + mptcp_sched_data_set_contexts(msk, &data); if (msk->sched->get_retrans) - return msk->sched->get_retrans(msk, data); - return msk->sched->get_send(msk, data); + return msk->sched->get_retrans(msk, &data); + return msk->sched->get_send(msk, &data); }