[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090315083642.GA31423@ioremap.net>
Date: Sun, 15 Mar 2009 11:36:42 +0300
From: Evgeniy Polyakov <zbr@...emap.net>
To: Ilpo Järvinen <ilpo.jarvinen@...sinki.fi>
Cc: David Miller <davem@...emloft.net>, netdev@...r.kernel.org,
Ingo Molnar <mingo@...e.hu>
Subject: Re: [PATCH 6/7] tcp: cache result of earlier divides when mss-aligning things
Hi Ilpo.
On Sun, Mar 15, 2009 at 02:07:54AM +0200, Ilpo Järvinen (ilpo.jarvinen@...sinki.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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists