pcp
[Top] [All Lists]

multithreading bottleneck: pdubuf.c

To: pcp developers <pcp@xxxxxxxxxxx>
Subject: multithreading bottleneck: pdubuf.c
From: "Frank Ch. Eigler" <fche@xxxxxxxxxx>
Date: Sun, 1 Mar 2015 20:54:36 -0500
Delivered-to: pcp@xxxxxxxxxxx
User-agent: Mutt/1.4.2.2i
Hi -

Some systemtapping on a busy pmwebd shows a ginormous amount of
traffic flowing through libpcp/src/pdubuf.c, many hundreds of
thousands of requests per second.  Each one takes a single exclusive
lock.  While holding the lock, pinning/unpinning does a linear search
of all already-allocated buffers.  Needs much improvement!

I'm thinking of redoing this module as a <search.h> (binary tree)
lookup (for identifying allocated pdubufs by bc_buf[]-contained
address during pin/unpin), and ditching the free-list entirely (just
do straight malloc/free, which is well-tuned for single+multi-threaded
apps).  Any suggestions/concerns?

- FChE

<Prev in Thread] Current Thread [Next in Thread>