Subject: Re: [PATCH 6/7] tcp: cache result of earlier divides when mss-aligning things

From: Evgeniy Polyakov <[email-masked]>
Date: Sun, 15 Mar 2009 12:08:51 +0300

On Sun, Mar 15, 2009 at 10:45:16AM +0200, Ilpo Järvinen ([email-masked]) 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()?
> 
> So gcc won't read my comment? :-)

I heared the next gcc version will be linked with the libastral.so, but
we have to maintain backward compatibility.

> Updated below.

The whole series looks good.

-- 
	Evgeniy Polyakov