Mailinglist Archive: opensuse-commit (2092 mails)

< Previous Next >
commit dhcdbd
  • From: root@xxxxxxxxxxxxxxx (h_root)
  • Date: Fri, 03 Aug 2007 22:02:18 +0200
  • Message-id: <20070803200218.5455E678335@xxxxxxxxxxxxxxx>

Hello community,

here is the log from the commit of package dhcdbd
checked in at Fri Aug 3 22:02:18 CEST 2007.

--------
--- dhcdbd/dhcdbd.changes       2006-11-17 19:10:02.000000000 +0100
+++ /mounts/work_src_done/STABLE/dhcdbd/dhcdbd.changes  2007-08-03 19:28:39.000000000 +0200
@@ -1,0 +2,5 @@
+Fri Aug  3 19:28:18 CEST 2007 - aj@xxxxxxx
+
+- Add patch to reduce number of wakeups.
+
+-------------------------------------------------------------------

New:
----
  dhcdbd-powersave.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ dhcdbd.spec ++++++
--- /var/tmp/diff_new_pack.Ld5915/_old  2007-08-03 22:00:49.000000000 +0200
+++ /var/tmp/diff_new_pack.Ld5915/_new  2007-08-03 22:00:49.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package dhcdbd (Version 1.14)
 #
-# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
 # This file and all modifications and additions to the pristine
 # package are under the same license as the package itself.
 #
@@ -14,10 +14,10 @@
 BuildRequires:  dbus-1-devel glib2-devel
 Summary:        DHCP D-BUS Daemon
 Version:        1.14
-Release:        9
-License:        GNU General Public License (GPL)
+Release:        52
+License:        GPL v2 or later
 Group:          Productivity/Networking/Boot/Utilities
-URL:            http://people.redhat.com/~jvdias/dhcdbd
+URL:            http://people.redhat.com/dcantrel/dhcdbd/
 Source0:        %{name}-%{version}.tar.gz
 Patch0:         dhcdbd-lease-dir-rml-1.10-1.patch
 Patch1:         dhcdbd-remove-named-user-rml.patch
@@ -28,6 +28,7 @@
 Patch6:         dhcdbd-set-hostname-fix.patch
 Patch7:         dhcdbd-dbus-api-fix-thoenig-01.patch
 Patch8:         dhcdbd-signalhandling-1.14.dif
+Patch9:         dhcdbd-powersave.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Requires:       dhcp-client >= 3.0.3 dbus-1 >= 0.90
 
@@ -40,6 +41,7 @@
 Authors:
 --------
     Jason Vas Dias
+    David Cantrell
 
 %prep
 %setup -q
@@ -52,6 +54,7 @@
 %patch6 -p1
 %patch7 -p0
 %patch8 -p0
+%patch9 -p0
 
 %build
 make CFLAGS="-Wall $RPM_OPT_FLAGS" CC='gcc' LIBDIR=%_lib
@@ -74,7 +77,9 @@
 %attr(755,root,root) /usr/sbin/dhcdbd
 %dir /var/lib/named
 
-%changelog -n dhcdbd
+%changelog
+* Fri Aug 03 2007 - aj@xxxxxxx
+- Add patch to reduce number of wakeups.
 * Fri Nov 17 2006 - varkoly@xxxxxxx
 - Fixing bug #222267 - dhcdbd do not remove pid file
 * Wed Oct 25 2006 - thoenig@xxxxxxx

++++++ dhcdbd-powersave.patch ++++++
Patch from http://www.linuxpowertop.org/patches/dhcdbd.patch
to reduce number of wakeups of dhcdbd and therefore to save power.
This patch is part of dhcdbd 2.8.

--- dbus_service.c
+++ dbus_service.c
@@ -1132,6 +1132,53 @@
     twalk( cs->timeouts, process_timeout );
 }
 
+
+static float next_timeout;
+
+static void find_timeout (const void *p, const VISIT which, const int level) {
+    DBusConnectionState *cs;
+    const void *const *tpp = p;
+    DBusConnectionTimeout *to;
+    struct timeval tv;
+    float now, then, interval, timeout;
+
+    gettimeofday(&tv, 0L);
+
+    if ((tpp != 0L) && (*tpp != 0L) && ((which == postorder) || (which == leaf))) {
+        to = (DBusConnectionTimeout *) * tpp;
+        cs = to->cs;
+
+        if (!dbus_timeout_get_enabled(to->to))
+            return;
+
+        cs = dbus_timeout_get_data(to->to);
+        then = ((float) to->tv.tv_sec) + (((float) to->tv.tv_usec) / 1000000.0);
+
+        if (then != 0.0) {
+            interval = ((float) dbus_timeout_get_interval(to->to)) / 1000.0;
+            now = ((float) tv.tv_sec) + (((float) tv.tv_usec) / 1000000.0);
+
+           timeout = then + interval - now;
+           if (timeout < 0)
+               timeout = 0;
+           if (next_timeout < 0 || timeout < next_timeout)
+               next_timeout = timeout;
+        }
+    }
+}
+
+static struct timeval *find_next_timeout (DBusConnectionState * cs, struct timeval *tv) {
+    next_timeout = 1;
+    twalk(cs->timeouts, find_timeout);
+    printf ("next timeout %f\n", next_timeout);
+    if (next_timeout == -1)
+       return NULL;
+    tv->tv_sec = next_timeout;
+    tv->tv_usec = (next_timeout - tv->tv_sec) * 1000000;
+    return tv;
+}
+

 static void 
 set_watch_fds( DBusWatch *watch, DBusConnectionState *cs )
 {
@@ -1325,7 +1372,8 @@
        timeout.tv_sec = 0;
        timeout.tv_usec= 200000;
 
-       if ( (n_fds = select(cs->n, &(cs->s_r_fds), &(cs->s_w_fds), &(cs->s_e_fds), &timeout)) < 0 )
+       if ( (n_fds = select(cs->n, &(cs->s_r_fds), &(cs->s_w_fds), 
+                           &(cs->s_e_fds), find_next_timeout (cs, &timeout))) < 0)
        {           
            if (errno != EINTR) 
            {

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages