libblock performance question

Joel Sherrill joel.sherrill at
Mon Oct 14 12:16:17 UTC 2002

Till Straumann wrote:
> Hi.
> I am thinking about using libblock for implementing an NFS client.
> However, I am a little bit concerned about libblock using task
> preemption disabling. Code that is executed with preemption
> disabled is not trivially short - therefore, I am a bit concerned that
> using libblock might degrade dispatching latency for high priority tasks
> (who possibly are not using a FS or libblock whatsoever).
> Can anybody resolve my doubts?

I didn't do any extensive algorithmic analysis but I don't see anything
particularly alarming.  There were a handful of DISABLE_PREEMPTION
macro invocations in bdbuf.c.  Some protected AVL tree operations which
should not be O(n) but more like O(log2 n) so that isn't very bad.
You can have 255 blocks to manage and still only do 8 "operations."

The other path seems to be freeing buffers and that is no worse
than any RTEMS internal critical section -- chain append + semaphore

Do you see any O(n) loops?  

Looking at this, I don't see why DISABLE_PREEMPTION couldn't be
replaced with a mutex though.

> Cheers,
> --Till.

Joel Sherrill, Ph.D.             Director of Research & Development
joel at                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

More information about the users mailing list