From: Patrick Porlan <patrick.porlan@linux.intel.com>
To: ofono@ofono.org
Subject: Re: [PATCH] PPP: Optimize write buffer management
Date: Tue, 08 Mar 2011 17:08:48 +0100 [thread overview]
Message-ID: <1299600528.2528.9.camel@pporlan-linux> (raw)
In-Reply-To: <4D6E6209.6030908@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1786 bytes --]
Hi Denis,
On Wed, 2011-03-02 at 09:28 -0600, Denis Kenzior wrote:
> >> 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.
I just sent a new version of my patch that does it (forgot to tag it as
v2, sorry).
> >> You change BUFFER_SIZE from 2048 to 4096 and remove the multiplication
> >> here.
Having a constant named BUFFER_SIZE whose value is half a buffer size
did not seem right though. I reinstantated the multiplication, but at
the macro definition level.
> >> 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.
I checked with random data, and get some frames dropped with a 128
margin, but none with 256. Using a much larger margin might be
detrimental to memory usage, so I chose to leave it like this. We can
address this in a further patch if you wish.
> Yes, we definitely want to have some sort of buffer pool management
> strategy to share a pool of buffers between different entities (e.g.
> GAtMux, GAtServer, GAtHDLC). Have you looked at g_slice* inside glib
> yet? I think we can take advantage of the fact that most of our ring
> buffers are sized at 4k.
It looks like this allocator should be used in ringbuffer.c. Let's
discuss that and follow up with another patch.
Regards,
-- Patrick
next prev parent reply other threads:[~2011-03-08 16:08 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
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 [this message]
-- 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=1299600528.2528.9.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 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.