Re: TSO trimming question

2007-12-21 Thread Bill Fink
On Fri, 21 Dec 2007, Ilpo Järvinen wrote: > On Fri, 21 Dec 2007, Bill Fink wrote: > > > On Fri, 21 Dec 2007, Bill Fink wrote: > > > > > Or perhaps even: > > > > > > /* Ok, it looks like it is advisable to defer. */ > > > tp->tso_deferred = jiffies; > > > > > > /* need to return a non-ze

Re: TSO trimming question

2007-12-21 Thread Ilpo Järvinen
On Fri, 21 Dec 2007, Bill Fink wrote: > On Fri, 21 Dec 2007, Bill Fink wrote: > > > Or perhaps even: > > > > /* Ok, it looks like it is advisable to defer. */ > > tp->tso_deferred = jiffies; > > > > /* need to return a non-zero value to defer, which means won't > > * defer if

Re: TSO trimming question

2007-12-21 Thread Bill Fink
On Fri, 21 Dec 2007, Bill Fink wrote: > Or perhaps even: > > /* Ok, it looks like it is advisable to defer. */ > tp->tso_deferred = jiffies; > > /* need to return a non-zero value to defer, which means won't >* defer if jiffies == 0 but it's only a 1 in 4 billion event

Re: TSO trimming question

2007-12-21 Thread Bill Fink
On Fri, 21 Dec 2007, David Miller wrote: > From: Herbert Xu <[EMAIL PROTECTED]> > Date: Fri, 21 Dec 2007 17:29:27 +0800 > > > On Fri, Dec 21, 2007 at 01:27:20AM -0800, David Miller wrote: > > > > > > It's two shifts, and this gets scheduled along with the other > > > instructions on many cpus so

Re: TSO trimming question

2007-12-21 Thread David Miller
From: Herbert Xu <[EMAIL PROTECTED]> Date: Fri, 21 Dec 2007 17:29:27 +0800 > On Fri, Dec 21, 2007 at 01:27:20AM -0800, David Miller wrote: > > > > It's two shifts, and this gets scheduled along with the other > > instructions on many cpus so it's effectively free. > > > > I don't see why this is

Re: TSO trimming question

2007-12-21 Thread Herbert Xu
On Fri, Dec 21, 2007 at 01:27:20AM -0800, David Miller wrote: > > It's two shifts, and this gets scheduled along with the other > instructions on many cpus so it's effectively free. > > I don't see why this is even worth mentioning and discussing. I totally agree. Two shifts are way better than

Re: TSO trimming question

2007-12-21 Thread Ilpo Järvinen
On Fri, 21 Dec 2007, Ilpo Järvinen wrote: > On Fri, 21 Dec 2007, Bill Fink wrote: > > > If so it seems like a lot of unnecessary > > work just to avoid a 1 in 4 billion event, since it's my understanding > > that the whole tcp_tso_should_defer function is just an optimization > > and not a critic

Re: TSO trimming question

2007-12-21 Thread David Miller
From: Bill Fink <[EMAIL PROTECTED]> Date: Fri, 21 Dec 2007 03:06:48 -0500 > What's with all the shifting back and forth? Here with: > > ((jiffies<<1)>>1) - (tp->tso_deferred>>1) > > and later with: > > /* Ok, it looks like it is advisable to defer. */ > tp->tso_deferred = 1

Re: TSO trimming question

2007-12-21 Thread Ilpo Järvinen
On Fri, 21 Dec 2007, Bill Fink wrote: > I meant to ask about this a while back but then got distracted by > other things. But now since the subject has come up, I had a couple > of more questions about this code. > > What's with all the shifting back and forth? Here with: > > ((jiffies<<

Re: TSO trimming question

2007-12-21 Thread Bill Fink
On Thu, 20 Dec 2007, David Miller wrote: > From: "Ilpo_Järvinen" <[EMAIL PROTECTED]> > Date: Thu, 20 Dec 2007 13:40:51 +0200 (EET) > > > [PATCH] [TCP]: Fix TSO deferring > > > > I'd say that most of what tcp_tso_should_defer had in between > > there was dead code because of this. > > > > Signed

Re: TSO trimming question

2007-12-20 Thread David Miller
From: John Heffner <[EMAIL PROTECTED]> Date: Thu, 20 Dec 2007 11:02:21 -0500 > David Miller wrote: > > From: "Ilpo_Järvinen" <[EMAIL PROTECTED]> > > Date: Thu, 20 Dec 2007 13:40:51 +0200 (EET) > > > >> [PATCH] [TCP]: Fix TSO deferring > >> > >> I'd say that most of what tcp_tso_should_defer had i

Re: TSO trimming question

2007-12-20 Thread David Miller
From: Herbert Xu <[EMAIL PROTECTED]> Date: Thu, 20 Dec 2007 22:00:12 +0800 > On Thu, Dec 20, 2007 at 04:00:37AM -0800, David Miller wrote: > > > > In the most ideal sense, tcp_window_allows() should probably > > be changed to only return MSS multiples. > > > > Unfortunately this would add an expe

Re: TSO trimming question

2007-12-20 Thread John Heffner
David Miller wrote: From: "Ilpo_Järvinen" <[EMAIL PROTECTED]> Date: Thu, 20 Dec 2007 13:40:51 +0200 (EET) [PATCH] [TCP]: Fix TSO deferring I'd say that most of what tcp_tso_should_defer had in between there was dead code because of this. Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]> Yike

Re: TSO trimming question

2007-12-20 Thread Herbert Xu
On Thu, Dec 20, 2007 at 04:00:37AM -0800, David Miller wrote: > > In the most ideal sense, tcp_window_allows() should probably > be changed to only return MSS multiples. > > Unfortunately this would add an expensive modulo operation, > however I think it would elimiate this problem case. Well you

Re: TSO trimming question

2007-12-20 Thread Ilpo Järvinen
On Thu, 20 Dec 2007, David Miller wrote: > From: "Ilpo_Järvinen" <[EMAIL PROTECTED]> > Date: Thu, 20 Dec 2007 13:40:51 +0200 (EET) > > > That's not the only case, IMHO if there's odd boundary due to > > snd_una+snd_wnd - skb->seq limit (done in tcp_window_allows()), we don't > > consider it as

Re: TSO trimming question

2007-12-20 Thread David Miller
From: "Ilpo_Järvinen" <[EMAIL PROTECTED]> Date: Thu, 20 Dec 2007 13:40:51 +0200 (EET) > That's not the only case, IMHO if there's odd boundary due to > snd_una+snd_wnd - skb->seq limit (done in tcp_window_allows()), we don't > consider it as odd but break the skb at arbitary point resulting > tw

Re: TSO trimming question

2007-12-20 Thread David Miller
From: "Ilpo_Järvinen" <[EMAIL PROTECTED]> Date: Thu, 20 Dec 2007 13:40:51 +0200 (EET) > [PATCH] [TCP]: Fix TSO deferring > > I'd say that most of what tcp_tso_should_defer had in between > there was dead code because of this. > > Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]> Yikes! John

Re: TSO trimming question

2007-12-20 Thread Ilpo Järvinen
On Wed, 19 Dec 2007, David Miller wrote: > From: "Ilpo_Järvinen" <[EMAIL PROTECTED]> > Date: Wed, 19 Dec 2007 23:46:33 +0200 (EET) > > > I'm not fully sure what's purpose of this code in tcp_write_xmit: > > > >if (skb->len < limit) { > >uns

Re: TSO trimming question

2007-12-19 Thread David Miller
From: Herbert Xu <[EMAIL PROTECTED]> Date: Thu, 20 Dec 2007 11:26:18 +0800 > Ilpo J??rvinen <[EMAIL PROTECTED]> wrote: > > > >> is the limitting factor? For latter IMHO this would be necessary: > >> > >> if (skb->len > limit) > >> limit -= limit

Re: TSO trimming question

2007-12-19 Thread David Miller
From: "Ilpo_Järvinen" <[EMAIL PROTECTED]> Date: Wed, 19 Dec 2007 23:46:33 +0200 (EET) > I'm not fully sure what's purpose of this code in tcp_write_xmit: > >if (skb->len < limit) { >unsigned int trim = skb->len % mss_now; > >

Re: TSO trimming question

2007-12-19 Thread Herbert Xu
Ilpo J??rvinen <[EMAIL PROTECTED]> wrote: > >> is the limitting factor? For latter IMHO this would be necessary: >> >> if (skb->len > limit) >> limit -= limit % mss_now; Good catch! But how about putting this logic into tcp_window_allows since t

Re: TSO trimming question

2007-12-19 Thread Ilpo Järvinen
On Wed, 19 Dec 2007, Ilpo Järvinen wrote: > I'm not fully sure what's purpose of this code in tcp_write_xmit: > >if (skb->len < limit) { >unsigned int trim = skb->len % mss_now; > >if (trim) >

TSO trimming question

2007-12-19 Thread Ilpo Järvinen
Hi all, I'm not fully sure what's purpose of this code in tcp_write_xmit: if (skb->len < limit) { unsigned int trim = skb->len % mss_now; if (trim) limit = skb->len - trim;