From: Evgeniy Polyakov <zbr@ioremap.net>
To: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
Cc: David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: [PATCH 6/7] tcp: cache result of earlier divides when mss-aligning things
Date: Sun, 15 Mar 2009 11:36:42 +0300 [thread overview]
Message-ID: <20090315083642.GA31423@ioremap.net> (raw)
In-Reply-To: <12370756752721-git-send-email-ilpo.jarvinen@helsinki.fi>
Hi Ilpo.
On Sun, Mar 15, 2009 at 02:07:54AM +0200, Ilpo Järvinen (ilpo.jarvinen@helsinki.fi) wrote:
> @@ -676,7 +676,17 @@ static unsigned int tcp_xmit_size_goal(struct sock *sk, u32 mss_now,
> tp->tcp_header_len);
>
> xmit_size_goal = tcp_bound_to_half_wnd(tp, xmit_size_goal);
> - xmit_size_goal -= (xmit_size_goal % mss_now);
> +
> + /* We try hard to avoid divides here */
> + old_size_goal = tp->xmit_size_goal_segs * mss_now;
> +
> + if (old_size_goal <= xmit_size_goal &&
> + old_size_goal + mss_now > xmit_size_goal) {
> + xmit_size_goal = old_size_goal;
If this is way more likely condition than changed xmit size, what about
wrapping it into likely()?
> + } else {
> + tp->xmit_size_goal_segs = xmit_size_goal / mss_now;
> + xmit_size_goal = tp->xmit_size_goal_segs * mss_now;
> + }
> }
>
> return xmit_size_goal;
> --
> 1.5.6.5
--
Evgeniy Polyakov
next prev parent reply other threads:[~2009-03-15 8:36 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1237075675426-git-send-email-ilpo.jarvinen@helsinki.fi>
2009-03-16 3:10 ` [PATCH 1/7] tcp: remove pointless .dsack/.num_sacks code David Miller
[not found] ` <12370756753599-git-send-email-ilpo.jarvinen@helsinki.fi>
2009-03-16 3:10 ` [PATCH 2/7] tcp: kill dead end_seq variable in clean_rtx_queue David Miller
[not found] ` <12370756754094-git-send-email-ilpo.jarvinen@helsinki.fi>
2009-03-16 3:10 ` [PATCH 3/7] tcp: consolidate paws check David Miller
[not found] ` <12370756752410-git-send-email-ilpo.jarvinen@helsinki.fi>
2009-03-16 3:10 ` [PATCH 4/7] tcp: don't check mtu probe completion in the loop David Miller
[not found] ` <12370756751028-git-send-email-ilpo.jarvinen@helsinki.fi>
[not found] ` <12370756752721-git-send-email-ilpo.jarvinen@helsinki.fi>
2009-03-15 8:36 ` Evgeniy Polyakov [this message]
2009-03-15 8:45 ` [PATCH 6/7] tcp: cache result of earlier divides when mss-aligning things Ilpo Järvinen
2009-03-15 9:08 ` Evgeniy Polyakov
2009-03-16 3:11 ` David Miller
[not found] ` <12370756754020-git-send-email-ilpo.jarvinen@helsinki.fi>
2009-03-16 3:11 ` [PATCH 7/7] tcp: make sure xmit goal size never becomes zero David Miller
2009-03-16 3:10 ` [PATCH 5/7] tcp: simplify tcp_current_mss David Miller
2009-03-15 0:23 [PATCH 1/7] tcp: remove pointless .dsack/.num_sacks code Ilpo Järvinen
2009-03-15 0:23 ` [PATCH 2/7] tcp: kill dead end_seq variable in clean_rtx_queue Ilpo Järvinen
2009-03-15 0:23 ` [PATCH 3/7] tcp: consolidate paws check Ilpo Järvinen
2009-03-15 0:23 ` [PATCH 4/7] tcp: don't check mtu probe completion in the loop Ilpo Järvinen
2009-03-15 0:23 ` [PATCH 5/7] tcp: simplify tcp_current_mss Ilpo Järvinen
2009-03-15 0:23 ` [PATCH 6/7] tcp: cache result of earlier divides when mss-aligning things Ilpo Järvinen
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=20090315083642.GA31423@ioremap.net \
--to=zbr@ioremap.net \
--cc=davem@davemloft.net \
--cc=ilpo.jarvinen@helsinki.fi \
--cc=mingo@elte.hu \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).