From owner-freebsd-fs@freebsd.org Fri Jan 8 10:17:32 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4886A675FD for ; Fri, 8 Jan 2016 10:17:32 +0000 (UTC) (envelope-from jdarcy@redhat.com) Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx1.redhat.com", Issuer "DigiCert SHA2 Extended Validation Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A78A51FE0 for ; Fri, 8 Jan 2016 10:17:32 +0000 (UTC) (envelope-from jdarcy@redhat.com) Received: from zmail12.collab.prod.int.phx2.redhat.com (zmail12.collab.prod.int.phx2.redhat.com [10.5.83.14]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u08AHU5O024635; Fri, 8 Jan 2016 05:17:30 -0500 Date: Fri, 8 Jan 2016 05:17:30 -0500 (EST) From: Jeff Darcy To: Raghavendra G Cc: Xavier Hernandez , freebsd-fs , Gluster Devel , Hubbard Jordan Message-ID: <1924941590.6473225.1452248249994.JavaMail.zimbra@redhat.com> In-Reply-To: References: <571237035.145690509.1451437960464.JavaMail.zimbra@uoguelph.ca> <20151230103152.GS13942@ndevos-x240.usersys.redhat.com> <2D8C2729-D556-479B-B4E2-66E1BB222F41@ixsystems.com> <1083933309.146084334.1451517977647.JavaMail.zimbra@uoguelph.ca> <568F6D07.6070500@datalab.es> Subject: Re: [Gluster-devel] FreeBSD port of GlusterFS racks up a lot of CPU usage MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.3.113.99] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - GC47 ([unknown])/8.0.6_GA_5922) Thread-Topic: FreeBSD port of GlusterFS racks up a lot of CPU usage Thread-Index: nzgvBLPPgcBXuRsf6GlZU17foVfxCA== X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jan 2016 10:17:32 -0000 > > 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.