All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@helsinki.fi>
To: Andreas Petlund <apetlund@simula.no>
Cc: Franco Fichtner <franco@lastsummer.de>,
	Netdev <netdev@vger.kernel.org>,
	eric.dumazet@gmail.com, hannemann@nets.rwth-aachen.de,
	LKML <linux-kernel@vger.kernel.org>,
	shemminger@vyatta.com, william.allen.simpson@gmail.com,
	damian@tvk.rwth-aachen.de, ebiederm@xmission.com,
	David Miller <davem@davemloft.net>
Subject: Re: [net-next PATCH v4 2/3] net: TCP thin linear timeouts
Date: Thu, 18 Feb 2010 11:24:38 +0200 (EET)	[thread overview]
Message-ID: <alpine.DEB.2.00.1002181120240.9961@melkinpaasi.cs.helsinki.fi> (raw)
In-Reply-To: <4B7D05ED.4060900@simula.no>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2838 bytes --]

On Thu, 18 Feb 2010, Andreas Petlund wrote:

> On 02/18/2010 10:09 AM, Ilpo Järvinen wrote:
> > On Thu, 18 Feb 2010, Franco Fichtner wrote:
> > 
> >> Andreas Petlund wrote:
> >>> On 02/18/2010 09:41 AM, Ilpo Järvinen wrote:
> >>>   
> >>>> On Wed, 17 Feb 2010, David Miller wrote:
> >>>>
> >>>>     
> >>>>> From: Andreas Petlund <apetlund@simula.no>
> >>>>> Date: Tue, 16 Feb 2010 15:40:41 +0100
> >>>>>
> >>>>>       
> >>>>>> @@ -341,6 +342,8 @@ struct tcp_sock {
> >>>>>>  	u16	advmss;		/* Advertised MSS
> >>>>>> */
> >>>>>>  	u8	frto_counter;	/* Number of new acks after RTO */
> >>>>>>  	u8	nonagle;	/* Disable Nagle algorithm?
> >>>>>> */
> >>>>>> +	u8      thin_lto    : 1,/* Use linear timeouts for thin
> >>>>>> streams */
> >>>>>> +		thin_undef  : 7;
> >>>>>>          
> >>>>> There is now a gap of 3 unused bytes here in this critical
> >>>>> core TCP socket data structure.
> >>>>>
> >>>>> Please either find a way to avoid this hole, or document
> >>>>> it with a comment.
> >>>>>       
> >>>> There would be multiple bits free for use in both frto_counter and nonagle
> >>>> byte.
> >>>>
> >>>>     
> >>>
> >>> I was playing aroud with this setup:
> >>>
> >>> =========
> >>> u8	nonagle     : 4,/* Disable Nagle algorithm?             */
> >>> 	thin_lto    : 1,/* Use linear timeouts for thin streams */
> >>> 	thin_dupack : 1,/* Fast retransmit on first dupack      */
> >>> 	thin_undef  : 2;
> >>> =========
> >>>
> >>> Do you think that would do the trick?
> >>>   
> >>
> >> According to Ilpo, it would be ok to reduce both ftro_counter and
> >> nonagle, so why not join all these into u16 and leave the remaining
> >> free bits documented for other people. Like this:
> >>
> >>    u16 frto_counter:x; /* Number of new acks after RTO */
> >>    u16 nonagle:y; /* Disable Nagle algorithm? */
> >>    u16 thin_lto:1; /* Use linear timeouts for thin streams */
> >>    u16 unused:15-x-y;
> >>
> >> Not sure about the y and x. Ilpo, can you comment on those values?
> > 
> > I don't remember top of the hat how much of nonagle used, but for 
> > frto_counter max value was 3 iirc. 
> 
> I think nonagle uses 4 bits:
> ======
> #define TCP_NAGLE_OFF           1       /* Nagle's algo is disabled */
> #define TCP_NAGLE_CORK          2       /* Socket is corked         */
> #define TCP_NAGLE_PUSH          4       /* Cork is overridden for already queued data */
> ======
> 
> > However, I'm unsure if compiler is 
> > nowadays wise enough to handle bitfields in some not all so stupid way.
> 
> Would you then recommend to use a byte for each value, thus avoiding the 
> bitfields? 

I don't know about the current compilers but at least in past there has 
been a bias against bitfields. Alternative would be to combine and code 
the accessors manually (thus bypassing any "too clever" compiler 
intelligence).

-- 
 i.

  reply	other threads:[~2010-02-18  9:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-16 14:40 [net-next PATCH v4 2/3] net: TCP thin linear timeouts Andreas Petlund
2010-02-18  0:32 ` David Miller
2010-02-18  8:41   ` Ilpo Järvinen
2010-02-18  8:44     ` Andreas Petlund
2010-02-18  9:01       ` Franco Fichtner
2010-02-18  9:09         ` Ilpo Järvinen
2010-02-18  9:18           ` Andreas Petlund
2010-02-18  9:24             ` Ilpo Järvinen [this message]
2010-02-18  9:25             ` Franco Fichtner

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=alpine.DEB.2.00.1002181120240.9961@melkinpaasi.cs.helsinki.fi \
    --to=ilpo.jarvinen@helsinki.fi \
    --cc=apetlund@simula.no \
    --cc=damian@tvk.rwth-aachen.de \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=eric.dumazet@gmail.com \
    --cc=franco@lastsummer.de \
    --cc=hannemann@nets.rwth-aachen.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    --cc=william.allen.simpson@gmail.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.