All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-next 0/2] mptcp: sched: reduce size for unused data
@ 2025-02-21 15:08 Matthieu Baerts (NGI0)
  2025-02-21 15:08 ` [PATCH mptcp-next 1/2] " Matthieu Baerts (NGI0)
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-02-21 15:08 UTC (permalink / raw)
  To: mptcp; +Cc: Matthieu Baerts (NGI0)

I was going to send "mptcp: sched: split get_subflow interface into two"
commit, when I saw again that the "data" structure was no longer used.

Because it will be removed later, when "use bpf_iter in bpf schedulers"
series will be applied, a first step is to save 64B from the stack for
each scheduling operation.

The first patch can be placed after "mptcp: sched: split get_subflow
interface into two", and the second one before or squashed into "mptcp:
add sched_data helpers": this commit can be dropped when "use bpf_iter
in bpf schedulers" series will be applied, no need to keep it for future
use. Same for the struct mptcp_sched_data.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
Matthieu Baerts (NGI0) (2):
      mptcp: sched: reduce size for unused data
      Squash to "mptcp: add sched_data helpers"


---
base-commit: 98f1e7131283309b4684ce977f28c9703d16b516
change-id: 20250221-mptcp-sched-data-ptr-8740fecdbbae

Best regards,
-- 
Matthieu Baerts (NGI0) <matttbe@kernel.org>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH mptcp-next 1/2] mptcp: sched: reduce size for unused data
  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)
  2025-02-21 15:08 ` [PATCH mptcp-next 2/2] Squash to "mptcp: add sched_data helpers" Matthieu Baerts (NGI0)
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-02-21 15:08 UTC (permalink / raw)
  To: mptcp; +Cc: Matthieu Baerts (NGI0)

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH mptcp-next 2/2] Squash to "mptcp: add sched_data helpers"
  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 ` [PATCH mptcp-next 1/2] " Matthieu Baerts (NGI0)
@ 2025-02-21 15:08 ` 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 16:23 ` MPTCP CI
  3 siblings, 0 replies; 6+ messages in thread
From: Matthieu Baerts (NGI0) @ 2025-02-21 15:08 UTC (permalink / raw)
  To: mptcp; +Cc: Matthieu Baerts (NGI0)

"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) <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 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);
 }

-- 
2.47.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH mptcp-next 0/2] mptcp: sched: reduce size for unused data
  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 ` [PATCH mptcp-next 1/2] " Matthieu Baerts (NGI0)
  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 ` Matthieu Baerts
  2025-02-21 15:56   ` Matthieu Baerts
  2025-02-21 16:23 ` MPTCP CI
  3 siblings, 1 reply; 6+ messages in thread
From: Matthieu Baerts @ 2025-02-21 15:33 UTC (permalink / raw)
  To: MPTCP Linux

Hello,

On 21/02/2025 16:08, Matthieu Baerts (NGI0) wrote:
> I was going to send "mptcp: sched: split get_subflow interface into two"
> commit, when I saw again that the "data" structure was no longer used.
> 
> Because it will be removed later, when "use bpf_iter in bpf schedulers"
> series will be applied, a first step is to save 64B from the stack for
> each scheduling operation.

I suggest applying this now, not to block the other patch: this small
modification is trivial, and undo only in our tree.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH mptcp-next 0/2] mptcp: sched: reduce size for unused data
  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
  0 siblings, 0 replies; 6+ messages in thread
From: Matthieu Baerts @ 2025-02-21 15:56 UTC (permalink / raw)
  To: MPTCP Linux

On 21/02/2025 16:33, Matthieu Baerts wrote:
> Hello,
> 
> On 21/02/2025 16:08, Matthieu Baerts (NGI0) wrote:
>> I was going to send "mptcp: sched: split get_subflow interface into two"
>> commit, when I saw again that the "data" structure was no longer used.
>>
>> Because it will be removed later, when "use bpf_iter in bpf schedulers"
>> series will be applied, a first step is to save 64B from the stack for
>> each scheduling operation.
> 
> I suggest applying this now, not to block the other patch: this small
> modification is trivial, and undo only in our tree.

Just did:

New patches for t/upstream:
- 70c366a0a40e: mptcp: sched: reduce size for unused data
- 46de2641147f: conflict in t/mptcp-add-sched_data-helpers-2
- f3c111c797d2: "squashed" patch 2/2 in "mptcp: add sched_data helpers"
- Results: 9afc9d6ddf8b..b5dbbb68e432 (export)

Tests are now in progress:

- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/e62e41e330fd89c538f76910906c828684a9ce44/checks

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH mptcp-next 0/2] mptcp: sched: reduce size for unused data
  2025-02-21 15:08 [PATCH mptcp-next 0/2] mptcp: sched: reduce size for unused data Matthieu Baerts (NGI0)
                   ` (2 preceding siblings ...)
  2025-02-21 15:33 ` [PATCH mptcp-next 0/2] mptcp: sched: reduce size for unused data Matthieu Baerts
@ 2025-02-21 16:23 ` MPTCP CI
  3 siblings, 0 replies; 6+ messages in thread
From: MPTCP CI @ 2025-02-21 16:23 UTC (permalink / raw)
  To: Matthieu Baerts; +Cc: mptcp

Hi Matthieu,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/13459912721

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/4f91f5c000d9
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=936464


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-02-21 16:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH mptcp-next 1/2] " Matthieu Baerts (NGI0)
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

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.