Open Source Telephony
 help / color / mirror / Atom feed
From: Patrick Porlan <patrick.porlan@linux.intel.com>
To: ofono@ofono.org
Subject: Re: [PATCH] PPP: Optimize write buffer management
Date: Wed, 02 Mar 2011 09:42:29 +0100	[thread overview]
Message-ID: <1299055349.1964.25.camel@pporlan-linux> (raw)
In-Reply-To: <4D6DBDC2.8000400@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2207 bytes --]

Hi Denis,

On Tue, 2011-03-01 at 21:47 -0600, Denis Kenzior wrote:
> This is a great description, but right after reading it one should
> realize that this patch is better broken down into two.  The first patch
> addressing the ringbuffer performance improvements and the second one
> dealing with PPP/HDLC queuing.  In fact, if there were two patches, then
> ringbuffer changes could go in right away.

Fair enough ; I'll separate the changes.


> Please try to avoid going over 80 characters a line.  Sometimes it is
> unavoidable, but lets try very hard to avoid it.

Understood.


> Is there a particular reason why you chose to use a ring buffer of ring
> buffers? A simple GQueue might be much easier to understand.  If you are
> worried about 'infinite queuing' then a simple counter might help to
> alleviate that.

Well, this implementation opens the door to further optimizations, such
as reusing cells (buffers) to avoid frequent allocation/deallocation.


> You change BUFFER_SIZE from 2048 to 4096 and remove the multiplication
> here.  It is a good idea to send these types of changes in a separate
> patch for two reasons:
> 	- Logically they should be separate
> 	- It is much easier to review for correctness outside the context of a
> large patch

Got it. By the way, why is it written this way? Is it to stress that we
want space for two frames?


> Please watch out for space / tab indentation mixups. 

OK. I'll fix that.


> So I think we have to be a bit careful here.  HDLC framing can in theory
> (if you're maximally unlucky) result in doubling of the data size once
> it is framed.  This means that we might have enough space in the current
> buffer according to this estimate, but still exceed it once the actual
> framing is performed.  If so, then we have to drop the frame.
> 
> There are two possibilities:
> 	- Retry again with a full buffer this time
> 	- Always pick a buffer if we have less than 2x size available
> 

Thanks for the insight. Picking a new buffer may be best. That will
cause more buffer "run away" though, strengthening the case for better
buffer recycling strategies.

Regards,

-- Patrick


  reply	other threads:[~2011-03-02  8:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01 15:07 [PATCH] PPP: Optimize write buffer management Patrick Porlan
2011-03-02  3:47 ` Denis Kenzior
2011-03-02  8:42   ` Patrick Porlan [this message]
2011-03-02  9:59     ` patch to fix BMC #13679 Huawei EM770: ofonod crash when disable/enable 3G technology Xu, Martin
2011-03-03  5:22       ` Denis Kenzior
2011-03-04  6:53         ` Xu, Martin
2011-03-04 15:19           ` Denis Kenzior
2011-03-02 15:28     ` [PATCH] PPP: Optimize write buffer management Denis Kenzior
2011-03-08 16:08       ` Patrick Porlan
  -- strict thread matches above, loose matches on Subject: below --
2011-03-08 15:58 Patrick Porlan
2011-03-15 19:28 ` Denis Kenzior
2011-03-16  9:00   ` Patrick Porlan

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=1299055349.1964.25.camel@pporlan-linux \
    --to=patrick.porlan@linux.intel.com \
    --cc=ofono@ofono.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