]> git.pld-linux.org Git - packages/cachefilesd.git/commitdiff
- rel 2; cpu eating fix auto/th/cachefilesd-0.10.5-2
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 21 Mar 2014 17:48:41 +0000 (18:48 +0100)
committerArkadiusz Miśkiewicz <arekm@maven.pl>
Fri, 21 Mar 2014 17:48:41 +0000 (18:48 +0100)
cachefilesd-cpueating.patch [new file with mode: 0644]
cachefilesd.spec

diff --git a/cachefilesd-cpueating.patch b/cachefilesd-cpueating.patch
new file mode 100644 (file)
index 0000000..940f3d5
--- /dev/null
@@ -0,0 +1,51 @@
+; https://www.redhat.com/archives/linux-cachefs/2014-February/msg00001.html
+diff -urN cachefilesd-0.10.5.org/cachefilesd.c cachefilesd-0.10.5/cachefilesd.c
+--- cachefilesd-0.10.5.org/cachefilesd.c       2011-12-06 14:38:00.000000000 +0100
++++ cachefilesd-0.10.5/cachefilesd.c   2014-03-21 18:47:45.739197236 +0100
+@@ -98,6 +98,7 @@
+ static int oldest_build = -1;
+ static int oldest_ready = -1;
+ static int ncullable = 0;
++static int cull_delayed = 0;
+ static const char *configfile = "/etc/cachefilesd.conf";
+@@ -244,6 +245,7 @@
+ static void sigalrm(int sig)
+ {
+       jumpstart_scan = 1;
++      cull_delayed = 0;
+ }
+ /*****************************************************************************/
+@@ -605,11 +607,11 @@
+               /* sleep without racing on reap and cull with the signal
+                * handlers */
+-              if (!scan && !reap && !cull) {
++              if (!scan && !reap && !(cull && !cull_delayed)) {
+                       if (sigprocmask(SIG_BLOCK, &sigs, &osigs) < 0)
+                               oserror("Unable to block signals");
+-                      if (!reap && !cull) {
++                      if (!reap && !stop && !jumpstart_scan) {
+                               if (ppoll(pollfds, 1, NULL, &osigs) < 0 &&
+                                   errno != EINTR)
+                                       oserror("Unable to suspend process");
+@@ -636,7 +638,7 @@
+                       if (cull) {
+                               if (oldest_ready >= 0)
+                                       cull_objects();
+-                              else if (oldest_build < 0)
++                              else if (oldest_build < 0 && !cull_delayed)
+                                       jumpstart_scan = 1;
+                       }
+@@ -1351,6 +1353,7 @@
+       /* if nothing there, scan again in a short while */
+       if (oldest_build < 0) {
++              cull_delayed = 1;
+               signal(SIGALRM, sigalrm);
+               alarm(30);
+               return;
index 999f1aed4b68e66f8bafdc2728cfd287f5448ebc..e6bf53f8678e5617548421af178e058c42b93f2b 100644 (file)
@@ -1,12 +1,13 @@
 Summary:       CacheFiles user-space management daemon
 Name:          cachefilesd
 Version:       0.10.5
-Release:       1
+Release:       2
 License:       GPL v2
 Group:         Daemons
 URL:           http://people.redhat.com/~dhowells/fscache/
 Source0:       http://people.redhat.com/dhowells/fscache/%{name}-%{version}.tar.bz2
 # Source0-md5: 9e85dd0ace346ff47e188ded8c05ab3b
+Patch0:                %{name}-cpueating.patch
 Requires(post,preun):  /sbin/chkconfig
 Requires(post,preun,postun):   systemd-units >= 38
 Requires:      systemd-units >= 38
@@ -19,6 +20,7 @@ persistent caching to the local disk.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %{__make} CFLAGS="%{rpmcppflags} %{rpmcflags}" \
This page took 0.101233 seconds and 4 git commands to generate.