All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Westphal <fw at strlen.de>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [PATCH mptcp-next 2/2] mptcp: add receive buffer auto-tuning
Date: Thu, 28 May 2020 19:55:18 +0200	[thread overview]
Message-ID: <20200528175518.GN2915@breakpoint.cc> (raw)
In-Reply-To: 9d1f3c59c12898b7bf8c7fe23cc8a9ae30ea7340.camel@redhat.com

[-- Attachment #1: Type: text/plain, Size: 1343 bytes --]

Paolo Abeni <pabeni(a)redhat.com> wrote:
> On Thu, 2020-05-28 at 15:02 +0200, Florian Westphal wrote:
> > +static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied)
> > +{
> > +	struct mptcp_subflow_context *subflow;
> > +	struct sock *sk = (struct sock *)msk;
> > +	u32 time, advmss = 1;
> > +	u64 rtt_us, mstamp;
> > +
> > +	sock_owned_by_me(sk);
> > +
> > +	if (copied <= 0)
> > +		return;
> > +
> > +	msk->rcvq_space.copied += copied;
> > +
> > +	rtt_us = 0;
> > +	mptcp_for_each_subflow(msk, subflow) {
> > +		const struct tcp_sock *tp;
> > +		u64 sf_rtt_us;
> > +		u32 sf_advmss;
> > +
> > +		tp = tcp_sk(mptcp_subflow_tcp_sock(subflow));
> > +
> > +		sf_rtt_us = READ_ONCE(tp->rcv_rtt_est.rtt_us);
> > +		sf_advmss = READ_ONCE(tp->advmss);
> > +
> > +		rtt_us = max(sf_rtt_us, rtt_us);
> > +		advmss = max(sf_advmss, advmss);
> > +	}
> > +
> > +	mstamp = div_u64(tcp_clock_ns(), NSEC_PER_USEC);
> > +
> > +	time = tcp_stamp_us_delta(mstamp, msk->rcvq_space.time);
> > +	if (time < (rtt_us >> 3) || rtt_us == 0)
> > +		return;
> 
> what if you cache the rtt_ns value, too, and use it to move the above
> test before the loop? So that the receive path will loop on the subflow
> at most once every rtt_us/8.

Which rtt_us should I cache?  The one used during last measurement
window?

             reply	other threads:[~2020-05-28 17:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 17:55 Florian Westphal [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-06-16 16:09 [MPTCP] Re: [PATCH mptcp-next 2/2] mptcp: add receive buffer auto-tuning Christoph Paasch
2020-05-28 18:05 Paolo Abeni
2020-05-28 17:48 Paolo Abeni
2020-05-28 17:46 Christoph Paasch
2020-05-28 17:40 Florian Westphal
2020-05-28 16:26 Christoph Paasch

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=20200528175518.GN2915@breakpoint.cc \
    --to=unknown@example.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.