From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Jun 8 19:00:23 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14DBF106566C for ; Wed, 8 Jun 2011 19:00:23 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 828A48FC18 for ; Wed, 8 Jun 2011 19:00:19 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p58J0JNc097476 for ; Wed, 8 Jun 2011 19:00:19 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p58J0JCQ097475; Wed, 8 Jun 2011 19:00:19 GMT (envelope-from gnats) Resent-Date: Wed, 8 Jun 2011 19:00:19 GMT Resent-Message-Id: <201106081900.p58J0JCQ097475@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Michael Gmelin Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B7DB106564A for ; Wed, 8 Jun 2011 18:53:31 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id E4D288FC1A for ; Wed, 8 Jun 2011 18:53:30 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p58IrUKt003138 for ; Wed, 8 Jun 2011 18:53:30 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p58IrUNG003129; Wed, 8 Jun 2011 18:53:30 GMT (envelope-from nobody) Message-Id: <201106081853.p58IrUNG003129@red.freebsd.org> Date: Wed, 8 Jun 2011 18:53:30 GMT From: Michael Gmelin To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/157714: [PATCH] devel/ice: Add load and cpu reporting and enable kqueue X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2011 19:00:23 -0000 >Number: 157714 >Category: ports >Synopsis: [PATCH] devel/ice: Add load and cpu reporting and enable kqueue >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jun 08 19:00:19 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Michael Gmelin >Release: FreeBSD 8.1 RELEASE amd64 >Organization: Grem Equity GmbH >Environment: FreeBSD server.grem.de 8.1-RELEASE-p2 FreeBSD 8.1-RELEASE-p2 #2 r216068: Tue Nov 30 03:00:30 CET 2010 root@bsdsource.grem.de:/usr/obj/usr/src/sys/GENERIC amd64 >Description: (this is a duplicate of PR 157569, which used a wrong synopsis) IceGrid nodes can report the load of the machine they're running on over a Processing facet. This information can be e.g. used for load balancing. On FreeBSD the load reported is always "-1 -1 -1", because the ifdefs for FreeBSD are missing in PlatformInfo.cpp. I informed zeroc.com about this, but if at all this will be part of the next release, so implementing the feature as a patch to the port skeleton makes sense. See also: http://www.zeroc.com/forums/patches/5393-patch-enable-load-cpu-information-icegrid-freebsd.html The Ice networking selector code supports EPOLL on linux and KQUEUE on Mac OS X for better selector performance. Unfortunately it falls back to simple polling on FreeBSD. The kqueue interface of Mac OS X is identical to FreeBSD (at least in the relevant part) and a simple #ifdef enables the feature on FreeBSD as well. I informed zeroc.com about this, but if at all this will be part of the next release, so implementing the feature as a patch to the port skeleton makes sense. See also: http://www.zeroc.com/forums/patches/5392-patch-enable-kqueue-freebsd.html >How-To-Repeat: Set up an ice grid and check the node load reported by icegridadmin. Use ice in a high load environment. >Fix: Apply the patch (it adds the missing #if defined statements to PlatformInfo.cpp and Network.h) Patch attached with submission follows: ===> Generating patch ===> Viewing diff with more diff -ruN --exclude=CVS /tmp/ice/devel/Ice/Makefile /usr/ports/devel/ice/Makefile --- /tmp/ice/devel/Ice/Makefile 2010-08-15 14:02:57.000000000 +0200 +++ /usr/ports/devel/ice/Makefile 2011-06-03 22:21:06.000000000 +0200 @@ -7,6 +7,7 @@ PORTNAME= Ice PORTVERSION= 3.4.1 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= http://www.zeroc.com/download/Ice/3.4/ diff -ruN --exclude=CVS /tmp/ice/devel/Ice/files/patch-Network.h /usr/ports/devel/ice/files/patch-Network.h --- /tmp/ice/devel/Ice/files/patch-Network.h 1970-01-01 01:00:00.000000000 +0100 +++ /usr/ports/devel/ice/files/patch-Network.h 2011-06-03 22:20:38.000000000 +0200 @@ -0,0 +1,11 @@ +--- cpp/src/Ice/Network.h.orig 2011-06-03 21:25:21.000000000 +0200 ++++ cpp/src/Ice/Network.h 2011-06-03 21:25:21.000000000 +0200 +@@ -36,7 +36,7 @@ + + #if defined(__linux) && !defined(ICE_NO_EPOLL) + # define ICE_USE_EPOLL 1 +-#elif defined(__APPLE__) && !defined(ICE_NO_KQUEUE) ++#elif (defined(__APPLE__) || defined(__FreeBSD__)) && !defined(ICE_NO_KQUEUE) + # define ICE_USE_KQUEUE 1 + #elif defined(_WIN32) + # if !defined(ICE_NO_IOCP) diff -ruN --exclude=CVS /tmp/ice/devel/Ice/files/patch-PlatformInfo.cpp /usr/ports/devel/ice/files/patch-PlatformInfo.cpp --- /tmp/ice/devel/Ice/files/patch-PlatformInfo.cpp 1970-01-01 01:00:00.000000000 +0100 +++ /usr/ports/devel/ice/files/patch-PlatformInfo.cpp 2011-06-03 22:20:35.000000000 +0200 @@ -0,0 +1,29 @@ +--- cpp/src/IceGrid/PlatformInfo.cpp.orig 2011-06-03 21:07:43.000000000 +0200 ++++ cpp/src/IceGrid/PlatformInfo.cpp 2011-06-03 21:07:43.000000000 +0200 +@@ -24,7 +24,7 @@ + # include // For PDH_MORE_DATA + #else + # include +-# if defined(__APPLE__) ++# if defined(__APPLE__) || defined(__FreeBSD__) + # include + # elif defined(__sun) + # include +@@ -222,7 +222,7 @@ + SYSTEM_INFO sysInfo; + GetSystemInfo(&sysInfo); + _nProcessors = sysInfo.dwNumberOfProcessors; +-#elif defined(__APPLE__) ++#elif defined(__APPLE__) || defined(__FreeBSD__) + static int ncpu[2] = { CTL_HW, HW_NCPU }; + size_t sz = sizeof(_nProcessors); + if(sysctl(ncpu, 2, &_nProcessors, &sz, 0, 0) == -1) +@@ -446,7 +446,7 @@ + info.avg1 = static_cast(_last1Total) / _usages1.size() / 100.0f; + info.avg5 = static_cast(_last5Total) / _usages5.size() / 100.0f; + info.avg15 = static_cast(_last15Total) / _usages15.size() / 100.0f; +-#elif defined(__sun) || defined(__linux) || defined(__APPLE__) ++#elif defined(__sun) || defined(__linux) || defined(__APPLE__) || defined(__FreeBSD__) + // + // We use the load average divided by the number of + // processors to figure out if the machine is busy or ===> Done >Release-Note: >Audit-Trail: >Unformatted: