All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
To: mptcp@lists.linux.dev
Cc: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Subject: [PATCH mptcp-next 1/2] mptcp: sched: reduce size for unused data
Date: Fri, 21 Feb 2025 16:08:44 +0100	[thread overview]
Message-ID: <20250221-mptcp-sched-data-ptr-v1-1-dbaec476fa6b@kernel.org> (raw)
In-Reply-To: <20250221-mptcp-sched-data-ptr-v1-0-dbaec476fa6b@kernel.org>

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) <matttbe@kernel.org>
---
 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);
 }

-- 
2.47.1


  reply	other threads:[~2025-02-21 15:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-21 15:08 [PATCH mptcp-next 0/2] mptcp: sched: reduce size for unused data Matthieu Baerts (NGI0)
2025-02-21 15:08 ` Matthieu Baerts (NGI0) [this message]
2025-02-21 15:08 ` [PATCH mptcp-next 2/2] Squash to "mptcp: add sched_data helpers" Matthieu Baerts (NGI0)
2025-02-21 15:33 ` [PATCH mptcp-next 0/2] mptcp: sched: reduce size for unused data Matthieu Baerts
2025-02-21 15:56   ` Matthieu Baerts
2025-02-21 16:23 ` MPTCP CI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250221-mptcp-sched-data-ptr-v1-1-dbaec476fa6b@kernel.org \
    --to=matttbe@kernel.org \
    --cc=mptcp@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.