[Gluster-devel] FreeBSD port of GlusterFS racks up a lot of CPU usage

Rick Macklem rmacklem at uoguelph.ca
Sat Jan 9 02:40:15 UTC 2016


Oops, I realized the last patch did a write(2) while holding a pthread_mutex.
I've never used pthread_mutexes, but I suspect this isn't allowed. The attached
updated patch delays the write() until after the pthread_mutex_unlock().

Sorry about the confusion, rick

----- Original Message -----
> > > I don't know anything about gluster's poll implementation so I may
> > > be totally wrong, but would it be possible to use an eventfd (or a
> > > pipe if eventfd is not supported) to signal the need to add more
> > > file descriptors to the poll call ?
> > >
> > >
> > > The poll call should listen on this new fd. When we need to change
> > > the fd list, we should simply write to the eventfd or pipe from
> > > another thread.  This will cause the poll call to return and we will
> > > be able to change the fd list without having a short timeout nor
> > > having to decide on any trade-off.
> > 
> >
> > Thats a nice idea. Based on my understanding of why timeouts are being
> > used, this approach can work.
> 
> The own-thread code which preceded the current poll implementation did
> something similar, using a pipe fd to be woken up for new *outgoing*
> messages.  That code still exists, and might provide some insight into
> how to do this for the current poll code.
> _______________________________________________
> freebsd-fs at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-fs
> To unsubscribe, send any mail to "freebsd-fs-unsubscribe at freebsd.org"
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gluster-poll.patch
Type: text/x-patch
Size: 3694 bytes
Desc: not available
URL: <http://www.gluster.org/pipermail/gluster-devel/attachments/20160108/81ab70fd/attachment.bin>


More information about the Gluster-devel mailing list