[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] pbuf.c issues
From: |
Christiaan Simons |
Subject: |
[lwip-devel] pbuf.c issues |
Date: |
Fri, 31 Mar 2006 10:39:25 +0200 |
Hi,
* Can anyone explain the idea behind the
double locking in pbuf_pool_alloc() ??
I see both SYS_ARCH_PROTECT() macro's
and some pbuf.c local flags like pbuf_pool_alloc_lock
and pbuf_pool_free_lock.
I figured the pbuf.c local flags are only used
when SYS_LIGHTWEIGHT_PROT == 0,
but I can't see their purpose in a multi- or
single-threaded system.
For a multi threaded system it this might work somehow,
but for the single threaded case it only seems to slow
things down.
Doesn't it?
* I've done a little profiling with gprof and
it seems a lot of cycles are spent in the pbuf_alloc(),
pbuf_free() and pbuf_header() functions.
I've made some tiny changes to give some
compilation hints for a 'not-so-good' compiler,
but I guess the puzzle mentioned above may
have some influence as well.
There are some other tiny improvements that
could be made. But I don't suspect this all adds
up to a significant improvement. I think most
of the pointer arithmatic may be the cause
of the relatively poor performance.
The user should disable LWIP_STATS
(thus PBUF_STATS) for production code.
I'll add this to the documentation.
* There seems to be an open issue
on memory alignment on some archs (MIPS?)
for this code.
This was reported for the 1.1.0 release,
but we didn't follow this up. A partial solution
was suggested. I suspect the MEM_ALIGN()
macro to increase the pointer arithmatic,
so I wont fix this for now.
Bye,
Christiaan Simons
Hardware Designer
Axon Digital Design
http://www.axon.tv
- [lwip-devel] pbuf.c issues,
Christiaan Simons <=