From: Simon Horman <horms@kernel.org>
To: John Ousterhout <ouster@cs.stanford.edu>
Cc: netdev@vger.kernel.org, pabeni@redhat.com, edumazet@google.com,
kuba@kernel.org
Subject: Re: [PATCH net-next v9 08/15] net: homa: create homa_pacer.h and homa_pacer.c
Date: Fri, 13 Jun 2025 15:43:40 +0100 [thread overview]
Message-ID: <20250613144340.GL414686@horms.kernel.org> (raw)
In-Reply-To: <20250609154051.1319-9-ouster@cs.stanford.edu>
On Mon, Jun 09, 2025 at 08:40:41AM -0700, John Ousterhout wrote:
> These files provide facilities to pace packet output in order to prevent
> queue buildup in the NIC. This functionality is needed to implement SRPT
> on output, so short messages don't get stuck in long NIC queues. Note: the
> pacer eventually needs to be replaced with a Homa-specific qdisc, which can
> better manage simultaneous transmissions by Homa and TCP. The current
> implementation can coexist with TCP and doesn't harm TCP, but
> Homa's latency suffers when TCP runs concurrently.
>
> Signed-off-by: John Ousterhout <ouster@cs.stanford.edu>
>
> ---
> Changes for v9:
> * Add support for homa_net objects
> * Use new homa_clock abstraction layer
> * Various name improvements (e.g. use "alloc" instead of "new" for functions
> that allocate memory)
>
> Changes for v8:
> * This file is new in v8 (functionality extracted from other files)
> ---
> net/homa/homa_impl.h | 1 +
> net/homa/homa_pacer.c | 316 ++++++++++++++++++++++++++++++++++++++++++
> net/homa/homa_pacer.h | 190 +++++++++++++++++++++++++
> 3 files changed, 507 insertions(+)
> create mode 100644 net/homa/homa_pacer.c
> create mode 100644 net/homa/homa_pacer.h
>
> diff --git a/net/homa/homa_impl.h b/net/homa/homa_impl.h
...
> +/**
> + * homa_pacer_manage_rpc() - Arrange for the pacer to transmit packets
> + * from this RPC (make sure that an RPC is on the throttled list and wake up
> + * the pacer thread if necessary).
> + * @rpc: RPC with outbound packets that have been granted but can't be
> + * sent because of NIC queue restrictions. Must be locked by caller.
> + */
> +void homa_pacer_manage_rpc(struct homa_rpc *rpc)
> + __must_hold(rpc_bucket_lock)
> +{
> + struct homa_pacer *pacer = rpc->hsk->homa->pacer;
> + struct homa_rpc *candidate;
> + int bytes_left;
> + int checks = 0;
Checks is set but otherwise unused in this function.
Probably it can be removed.
Flagged by Clang 20.1.4 as:
.../homa_pacer.c:252:6: warning: variable 'checks' set but not used [-Wunused-but-set-variable]
252 | int checks = 0;
| ^
> +
> + if (!list_empty(&rpc->throttled_links))
> + return;
> + bytes_left = rpc->msgout.length - rpc->msgout.next_xmit_offset;
> + homa_pacer_throttle_lock(pacer);
> + list_for_each_entry(candidate, &pacer->throttled_rpcs,
> + throttled_links) {
> + int bytes_left_cand;
> +
> + checks++;
> +
> + /* Watch out: the pacer might have just transmitted the last
> + * packet from candidate.
> + */
> + bytes_left_cand = candidate->msgout.length -
> + candidate->msgout.next_xmit_offset;
> + if (bytes_left_cand > bytes_left) {
> + list_add_tail(&rpc->throttled_links,
> + &candidate->throttled_links);
> + goto done;
> + }
> + }
> + list_add_tail(&rpc->throttled_links, &pacer->throttled_rpcs);
> +done:
> + homa_pacer_throttle_unlock(pacer);
> + wake_up(&pacer->wait_queue);
> +}
...
next prev parent reply other threads:[~2025-06-13 14:43 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-09 15:40 [PATCH net-next v9 00/15] Begin upstreaming Homa transport protocol John Ousterhout
2025-06-09 15:40 ` [PATCH net-next v9 01/15] net: homa: define user-visible API for Homa John Ousterhout
2025-06-09 15:40 ` [PATCH net-next v9 02/15] net: homa: create homa_wire.h John Ousterhout
2025-06-09 15:40 ` [PATCH net-next v9 03/15] net: homa: create shared Homa header files John Ousterhout
2025-06-13 14:40 ` Simon Horman
2025-06-13 18:36 ` John Ousterhout
2025-06-09 15:40 ` [PATCH net-next v9 04/15] net: homa: create homa_pool.h and homa_pool.c John Ousterhout
2025-06-09 15:40 ` [PATCH net-next v9 05/15] net: homa: create homa_peer.h and homa_peer.c John Ousterhout
2025-06-13 14:39 ` Simon Horman
2025-06-13 17:12 ` John Ousterhout
2025-06-13 17:18 ` Simon Horman
2025-06-13 18:02 ` John Ousterhout
2025-06-09 15:40 ` [PATCH net-next v9 06/15] net: homa: create homa_sock.h and homa_sock.c John Ousterhout
2025-06-13 14:42 ` Simon Horman
2025-06-13 18:47 ` John Ousterhout
2025-06-09 15:40 ` [PATCH net-next v9 07/15] net: homa: create homa_interest.h and homa_interest John Ousterhout
2025-06-09 15:40 ` [PATCH net-next v9 08/15] net: homa: create homa_pacer.h and homa_pacer.c John Ousterhout
2025-06-13 14:43 ` Simon Horman [this message]
2025-06-13 18:50 ` John Ousterhout
2025-06-09 15:40 ` [PATCH net-next v9 09/15] net: homa: create homa_rpc.h and homa_rpc.c John Ousterhout
2025-06-09 15:40 ` [PATCH net-next v9 10/15] net: homa: create homa_outgoing.c John Ousterhout
2025-06-09 15:40 ` [PATCH net-next v9 11/15] net: homa: create homa_utils.c John Ousterhout
2025-06-09 15:40 ` [PATCH net-next v9 12/15] net: homa: create homa_incoming.c John Ousterhout
2025-06-09 15:40 ` [PATCH net-next v9 13/15] net: homa: create homa_timer.c John Ousterhout
2025-06-13 14:41 ` Simon Horman
2025-06-13 18:44 ` John Ousterhout
2025-06-09 15:40 ` [PATCH net-next v9 14/15] net: homa: create homa_plumbing.c John Ousterhout
2025-06-09 15:40 ` [PATCH net-next v9 15/15] net: homa: create Makefile and Kconfig John Ousterhout
-- strict thread matches above, loose matches on Subject: below --
2025-05-26 4:28 [PATCH net-next v9 00/15] Begin upstreaming Homa transport protocol John Ousterhout
2025-05-26 4:28 ` [PATCH net-next v9 08/15] net: homa: create homa_pacer.h and homa_pacer.c John Ousterhout
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=20250613144340.GL414686@horms.kernel.org \
--to=horms@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ouster@cs.stanford.edu \
--cc=pabeni@redhat.com \
/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.