[lvm-devel] LVM2 ./WHATS_NEW daemons/clvmd/clvmd-singlenode.c

Mike Snitzer snitzer at redhat.com
Mon Mar 29 15:13:44 UTC 2010


On Mon, Mar 29 2010 at 10:38am -0400,
Petr Rockai <prockai at redhat.com> wrote:

> Hi!
> 
> snitzer at sourceware.org writes:
> > Modified files:
> > 	.              : WHATS_NEW 
> > 	daemons/clvmd  : clvmd-singlenode.c 
> >
> > Log message:
> > 	Use a real socket for singlenode clvmd to fix clvmd's high cpu load.
> Interesting. Is this because /dev/null is always "ready" for reading?

Yes, daemons/clvmd/clvmd.c:main_loop's select() on /dev/null appears to
be the problem.  If I set the associated listen_fd to be nonblocking the
CPU load goes from 100%+ to ~80%.  But with the committed "fix" cpu load
(when clvmd is idle) is now ~1% (on my f12 kvm guest).

> Is there a less complicated workaround for that problem?

I haven't looked for an alternative.  Not really seeing the current fix
as overly complicated.  Its pretty standard socket code, which Milan
started, that I then refined to be modeled after
daemons/clvmd/clvmd.c:open_local_sock().  For that matter, we could have
a single function that is used for both (reducing the perceived
complexity of the clvmd-singlenode.c:init_comms).

Mike




More information about the lvm-devel mailing list