1 |
darkside 08/10/24 01:38:43 |
2 |
|
3 |
Modified: init.d-preload conf.d-preload |
4 |
Added: preload-0.6.3-forking-children.patch |
5 |
preload-0.6.3-overlapping-io-bursts.patch |
6 |
preload-0.6.3-nice-segfault.patch |
7 |
Log: |
8 |
init script work, additional patches, downgraded ebuild to eapi-0 (see ChangeLog for more info) |
9 |
(Portage version: 2.2_rc12/cvs/Linux 2.6.27-git6 x86_64) |
10 |
|
11 |
Revision Changes Path |
12 |
1.4 sys-apps/preload/files/init.d-preload |
13 |
|
14 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/preload/files/init.d-preload?rev=1.4&view=markup |
15 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/preload/files/init.d-preload?rev=1.4&content-type=text/plain |
16 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/preload/files/init.d-preload?r1=1.3&r2=1.4 |
17 |
|
18 |
Index: init.d-preload |
19 |
=================================================================== |
20 |
RCS file: /var/cvsroot/gentoo-x86/sys-apps/preload/files/init.d-preload,v |
21 |
retrieving revision 1.3 |
22 |
retrieving revision 1.4 |
23 |
diff -u -r1.3 -r1.4 |
24 |
--- init.d-preload 23 Oct 2008 15:16:14 -0000 1.3 |
25 |
+++ init.d-preload 24 Oct 2008 01:38:43 -0000 1.4 |
26 |
@@ -1,17 +1,24 @@ |
27 |
#!/sbin/runscript |
28 |
# Copyright 1999-2008 Gentoo Foundation |
29 |
# Distributed under the terms of the GNU General Public License v2 |
30 |
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/files/init.d-preload,v 1.3 2008/10/23 15:16:14 darkside Exp $ |
31 |
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/files/init.d-preload,v 1.4 2008/10/24 01:38:43 darkside Exp $ |
32 |
|
33 |
depend() { |
34 |
- after xdm |
35 |
+ after localmount xdm |
36 |
} |
37 |
|
38 |
+# Note: pid changes so we can't use a PIDFILE type thing. |
39 |
start() { |
40 |
ebegin "Starting preload" |
41 |
start-stop-daemon --start --quiet --exec /usr/sbin/preload -- \ |
42 |
-l ${PRELOAD_LOGFILE:-/var/log/preload.log} -V ${PRELOAD_VERBOSITY:-4} \ |
43 |
-n ${PRELOAD_NICE:-15} -s ${PRELOAD_STATEFILE:-""} |
44 |
+ |
45 |
+ IONICE=$(type -p ionice) |
46 |
+ if [[ -x "${IONICE}" && -n "${IONICE_OPTS}" ]]; then |
47 |
+ einfo "ionice'ing preload" |
48 |
+ ${IONICE} "${IONICE_OPTS}" -p $(pidof preload) |
49 |
+ fi |
50 |
eend $? |
51 |
} |
52 |
|
53 |
|
54 |
|
55 |
|
56 |
1.5 sys-apps/preload/files/conf.d-preload |
57 |
|
58 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/preload/files/conf.d-preload?rev=1.5&view=markup |
59 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/preload/files/conf.d-preload?rev=1.5&content-type=text/plain |
60 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/preload/files/conf.d-preload?r1=1.4&r2=1.5 |
61 |
|
62 |
Index: conf.d-preload |
63 |
=================================================================== |
64 |
RCS file: /var/cvsroot/gentoo-x86/sys-apps/preload/files/conf.d-preload,v |
65 |
retrieving revision 1.4 |
66 |
retrieving revision 1.5 |
67 |
diff -u -r1.4 -r1.5 |
68 |
--- conf.d-preload 23 Oct 2008 15:16:14 -0000 1.4 |
69 |
+++ conf.d-preload 24 Oct 2008 01:38:43 -0000 1.5 |
70 |
@@ -1,5 +1,5 @@ |
71 |
# Copyright 1999-2008 Gentoo Foundation |
72 |
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/files/conf.d-preload,v 1.4 2008/10/23 15:16:14 darkside Exp $ |
73 |
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/files/conf.d-preload,v 1.5 2008/10/24 01:38:43 darkside Exp $ |
74 |
# preload configuration file |
75 |
|
76 |
# verbosity. 0-9, Default is 4. |
77 |
@@ -16,6 +16,5 @@ |
78 |
# Empty (commented out) means no state is saved. |
79 |
PRELOAD_STATEFILE="/var/lib/preload/preload.state" |
80 |
|
81 |
-## Not supported in Gentoo yet. Patches to init script welcome. ## |
82 |
# Option to call ionice with. Leave empty to skip ionice. |
83 |
#IONICE_OPTS="-c3" |
84 |
|
85 |
|
86 |
|
87 |
1.1 sys-apps/preload/files/preload-0.6.3-forking-children.patch |
88 |
|
89 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/preload/files/preload-0.6.3-forking-children.patch?rev=1.1&view=markup |
90 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/preload/files/preload-0.6.3-forking-children.patch?rev=1.1&content-type=text/plain |
91 |
|
92 |
Index: preload-0.6.3-forking-children.patch |
93 |
=================================================================== |
94 |
From 63cbd8862714a97c8ef752041dc8c351ba4fae1d Mon Sep 17 00:00:00 2001 |
95 |
From: Kai Krakow <kai@××××××××.de> |
96 |
Date: Mon, 28 Jul 2008 19:50:22 +0200 |
97 |
Subject: [PATCH] Early restart of forking readahead children |
98 |
|
99 |
This patch adds ability to wait_for_children() to restart |
100 |
forking new readahead children as soon as a slot becomes |
101 |
available which should make the effect of parallelism even |
102 |
more effective. Previous situation was: |
103 |
|
104 |
Wait for all children to exit as soon as the high water mark |
105 |
was reached. This resulted in 30 processes in peak, wait for |
106 |
them to reach 0 processes. Start another 30 processes in |
107 |
peak, wait again etc. |
108 |
|
109 |
New situation is: Start a new process as soon as a previous |
110 |
process exited which keeps the peak at 30 processes until |
111 |
the readahead list is finished. |
112 |
|
113 |
This introduces a new parameter to wait_for_children() which |
114 |
tells it to leave now more than XY processes running when |
115 |
returning. |
116 |
--- |
117 |
src/readahead.c | 8 ++++---- |
118 |
1 files changed, 4 insertions(+), 4 deletions(-) |
119 |
|
120 |
diff --git a/src/readahead.c b/src/readahead.c |
121 |
index c169e81..7617449 100644 |
122 |
--- a/src/readahead.c |
123 |
+++ b/src/readahead.c |
124 |
@@ -103,10 +103,10 @@ map_block_compare (const preload_map_t **pa, const preload_map_t **pb) |
125 |
static int procs = 0; |
126 |
|
127 |
static void |
128 |
-wait_for_children (void) |
129 |
+wait_for_children (int maxprocs) |
130 |
{ |
131 |
/* wait for child processes to terminate */ |
132 |
- while (procs > 0) |
133 |
+ while (procs > maxprocs) |
134 |
{ |
135 |
int status; |
136 |
if (wait (&status) > 0) |
137 |
@@ -121,7 +121,7 @@ process_file(const char *path, size_t offset, size_t length) |
138 |
int maxprocs = conf->system.maxprocs; |
139 |
|
140 |
if (procs >= maxprocs) |
141 |
- wait_for_children (); |
142 |
+ wait_for_children (maxprocs); |
143 |
|
144 |
if (maxprocs > 0) |
145 |
{ |
146 |
@@ -257,7 +257,7 @@ preload_readahead (preload_map_t **files, int file_count) |
147 |
path = NULL; |
148 |
} |
149 |
|
150 |
- wait_for_children (); |
151 |
+ wait_for_children (0); |
152 |
|
153 |
return processed; |
154 |
} |
155 |
-- |
156 |
1.5.4.5 |
157 |
|
158 |
|
159 |
|
160 |
|
161 |
1.1 sys-apps/preload/files/preload-0.6.3-overlapping-io-bursts.patch |
162 |
|
163 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/preload/files/preload-0.6.3-overlapping-io-bursts.patch?rev=1.1&view=markup |
164 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/preload/files/preload-0.6.3-overlapping-io-bursts.patch?rev=1.1&content-type=text/plain |
165 |
|
166 |
Index: preload-0.6.3-overlapping-io-bursts.patch |
167 |
=================================================================== |
168 |
From 97814f566aeb84f60031008c3dda5457ba176fe7 Mon Sep 17 00:00:00 2001 |
169 |
From: Kai Krakow <kai@××××××××.de> |
170 |
Date: Mon, 28 Jul 2008 20:57:06 +0200 |
171 |
Subject: [PATCH] Create short overlapping io bursts |
172 |
|
173 |
Modify the wait_for_children() mechanism to create short |
174 |
burst instead of constant flow of new io requests. This |
175 |
is more fair and should enable the kernel to rearrange |
176 |
io requests better. |
177 |
--- |
178 |
src/readahead.c | 2 +- |
179 |
1 files changed, 1 insertions(+), 1 deletions(-) |
180 |
|
181 |
diff --git a/src/readahead.c b/src/readahead.c |
182 |
index 7617449..466961d 100644 |
183 |
--- a/src/readahead.c |
184 |
+++ b/src/readahead.c |
185 |
@@ -121,7 +121,7 @@ process_file(const char *path, size_t offset, size_t length) |
186 |
int maxprocs = conf->system.maxprocs; |
187 |
|
188 |
if (procs >= maxprocs) |
189 |
- wait_for_children (maxprocs); |
190 |
+ wait_for_children (maxprocs >> 1); |
191 |
|
192 |
if (maxprocs > 0) |
193 |
{ |
194 |
-- |
195 |
1.5.4.5 |
196 |
|
197 |
|
198 |
|
199 |
|
200 |
1.1 sys-apps/preload/files/preload-0.6.3-nice-segfault.patch |
201 |
|
202 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/preload/files/preload-0.6.3-nice-segfault.patch?rev=1.1&view=markup |
203 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/preload/files/preload-0.6.3-nice-segfault.patch?rev=1.1&content-type=text/plain |
204 |
|
205 |
Index: preload-0.6.3-nice-segfault.patch |
206 |
=================================================================== |
207 |
From 6c0e605415f82509522597f8695be8797104ac4b Mon Sep 17 00:00:00 2001 |
208 |
From: Behdad Esfahbod <behdad@×××××××××××××××××.net> |
209 |
Date: Tue, 19 Aug 2008 16:38:54 +0000 |
210 |
Subject: [PATCH] 2008-08-19 Behdad Esfahbod <behdad@×××××.org> |
211 |
|
212 |
* src/cmdline.c: --nice was segfaulting. Fix it. |
213 |
--- |
214 |
ChangeLog | 4 ++++ |
215 |
src/cmdline.c | 2 +- |
216 |
2 files changed, 5 insertions(+), 1 deletions(-) |
217 |
|
218 |
diff --git a/ChangeLog b/ChangeLog |
219 |
index 2d785af..87ac2a0 100644 |
220 |
--- a/ChangeLog |
221 |
+++ b/ChangeLog |
222 |
@@ -1,3 +1,7 @@ |
223 |
+2008-08-19 Behdad Esfahbod <behdad@×××××.org> |
224 |
+ |
225 |
+ * src/cmdline.c: --nice was segfaulting. Fix it. |
226 |
+ |
227 |
2008-07-28 Behdad Esfahbod <behdad@×××××.org> |
228 |
|
229 |
* NEWS: |
230 |
diff --git a/src/cmdline.c b/src/cmdline.c |
231 |
index b175a21..e4e6797 100644 |
232 |
--- a/src/cmdline.c |
233 |
+++ b/src/cmdline.c |
234 |
@@ -38,7 +38,7 @@ static const struct option const opts[] = { |
235 |
{"statefile", 1, 0, 's'}, |
236 |
{"logfile", 1, 0, 'l'}, |
237 |
{"foreground", 0, 0, 'f'}, |
238 |
- {"nice", 0, 0, 'n'}, |
239 |
+ {"nice", 1, 0, 'n'}, |
240 |
{"verbose", 1, 0, 'V'}, |
241 |
{"debug", 0, 0, 'd'}, |
242 |
{NULL, 0, 0, 0}, |
243 |
-- |
244 |
1.5.6.4 |