summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Olexa <darkside@gentoo.org>2008-10-24 01:38:43 +0000
committerJeremy Olexa <darkside@gentoo.org>2008-10-24 01:38:43 +0000
commit8a11dfb1cefc7a036d1c3efc469265599f3e0037 (patch)
tree786a01843d3b5aed3df7e1fe6d835f9238406fa0 /sys-apps
parentRemove e1000e warning (diff)
downloadgentoo-2-8a11dfb1cefc7a036d1c3efc469265599f3e0037.tar.gz
gentoo-2-8a11dfb1cefc7a036d1c3efc469265599f3e0037.tar.bz2
gentoo-2-8a11dfb1cefc7a036d1c3efc469265599f3e0037.zip
init script work, additional patches, downgraded ebuild to eapi-0 (see ChangeLog for more info)
(Portage version: 2.2_rc12/cvs/Linux 2.6.27-git6 x86_64)
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/preload/ChangeLog14
-rw-r--r--sys-apps/preload/files/conf.d-preload3
-rw-r--r--sys-apps/preload/files/init.d-preload11
-rw-r--r--sys-apps/preload/files/preload-0.6.3-forking-children.patch64
-rw-r--r--sys-apps/preload/files/preload-0.6.3-nice-segfault.patch39
-rw-r--r--sys-apps/preload/files/preload-0.6.3-overlapping-io-bursts.patch29
-rw-r--r--sys-apps/preload/preload-0.6.3-r1.ebuild31
-rw-r--r--sys-apps/preload/preload-0.6.3-r4.ebuild (renamed from sys-apps/preload/preload-0.6.3-r3.ebuild)29
8 files changed, 174 insertions, 46 deletions
diff --git a/sys-apps/preload/ChangeLog b/sys-apps/preload/ChangeLog
index 6ce86401c7a5..59f2834919ae 100644
--- a/sys-apps/preload/ChangeLog
+++ b/sys-apps/preload/ChangeLog
@@ -1,6 +1,18 @@
# ChangeLog for sys-apps/preload
# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/ChangeLog,v 1.5 2008/10/23 15:16:14 darkside Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/ChangeLog,v 1.6 2008/10/24 01:38:43 darkside Exp $
+
+*preload-0.6.3-r4 (24 Oct 2008)
+
+ 24 Oct 2008; Jeremy Olexa <darkside@gentoo.org>
+ +files/preload-0.6.3-forking-children.patch,
+ +files/preload-0.6.3-nice-segfault.patch,
+ +files/preload-0.6.3-overlapping-io-bursts.patch, files/conf.d-preload,
+ files/init.d-preload, -preload-0.6.3-r1.ebuild, -preload-0.6.3-r3.ebuild,
+ +preload-0.6.3-r4.ebuild:
+ init script now supports ionice'ing. New patches to improve/optimize
+ behavior. Thanks to Kai Krakow for patches and hints. Downgraded ebuild to
+ eapi-0 to allow people to get these important chagnes
*preload-0.6.3-r3 (23 Oct 2008)
diff --git a/sys-apps/preload/files/conf.d-preload b/sys-apps/preload/files/conf.d-preload
index 5989d53fa046..fdca718a67df 100644
--- a/sys-apps/preload/files/conf.d-preload
+++ b/sys-apps/preload/files/conf.d-preload
@@ -1,5 +1,5 @@
# Copyright 1999-2008 Gentoo Foundation
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/files/conf.d-preload,v 1.4 2008/10/23 15:16:14 darkside Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/files/conf.d-preload,v 1.5 2008/10/24 01:38:43 darkside Exp $
# preload configuration file
# verbosity. 0-9, Default is 4.
@@ -16,6 +16,5 @@
# Empty (commented out) means no state is saved.
PRELOAD_STATEFILE="/var/lib/preload/preload.state"
-## Not supported in Gentoo yet. Patches to init script welcome. ##
# Option to call ionice with. Leave empty to skip ionice.
#IONICE_OPTS="-c3"
diff --git a/sys-apps/preload/files/init.d-preload b/sys-apps/preload/files/init.d-preload
index f4b5e395f289..43e570768ef5 100644
--- a/sys-apps/preload/files/init.d-preload
+++ b/sys-apps/preload/files/init.d-preload
@@ -1,17 +1,24 @@
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/files/init.d-preload,v 1.3 2008/10/23 15:16:14 darkside Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/files/init.d-preload,v 1.4 2008/10/24 01:38:43 darkside Exp $
depend() {
- after xdm
+ after localmount xdm
}
+# Note: pid changes so we can't use a PIDFILE type thing.
start() {
ebegin "Starting preload"
start-stop-daemon --start --quiet --exec /usr/sbin/preload -- \
-l ${PRELOAD_LOGFILE:-/var/log/preload.log} -V ${PRELOAD_VERBOSITY:-4} \
-n ${PRELOAD_NICE:-15} -s ${PRELOAD_STATEFILE:-""}
+
+ IONICE=$(type -p ionice)
+ if [[ -x "${IONICE}" && -n "${IONICE_OPTS}" ]]; then
+ einfo "ionice'ing preload"
+ ${IONICE} "${IONICE_OPTS}" -p $(pidof preload)
+ fi
eend $?
}
diff --git a/sys-apps/preload/files/preload-0.6.3-forking-children.patch b/sys-apps/preload/files/preload-0.6.3-forking-children.patch
new file mode 100644
index 000000000000..3f705237acbc
--- /dev/null
+++ b/sys-apps/preload/files/preload-0.6.3-forking-children.patch
@@ -0,0 +1,64 @@
+From 63cbd8862714a97c8ef752041dc8c351ba4fae1d Mon Sep 17 00:00:00 2001
+From: Kai Krakow <kai@kaishome.de>
+Date: Mon, 28 Jul 2008 19:50:22 +0200
+Subject: [PATCH] Early restart of forking readahead children
+
+This patch adds ability to wait_for_children() to restart
+forking new readahead children as soon as a slot becomes
+available which should make the effect of parallelism even
+more effective. Previous situation was:
+
+Wait for all children to exit as soon as the high water mark
+was reached. This resulted in 30 processes in peak, wait for
+them to reach 0 processes. Start another 30 processes in
+peak, wait again etc.
+
+New situation is: Start a new process as soon as a previous
+process exited which keeps the peak at 30 processes until
+the readahead list is finished.
+
+This introduces a new parameter to wait_for_children() which
+tells it to leave now more than XY processes running when
+returning.
+---
+ src/readahead.c | 8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/readahead.c b/src/readahead.c
+index c169e81..7617449 100644
+--- a/src/readahead.c
++++ b/src/readahead.c
+@@ -103,10 +103,10 @@ map_block_compare (const preload_map_t **pa, const preload_map_t **pb)
+ static int procs = 0;
+
+ static void
+-wait_for_children (void)
++wait_for_children (int maxprocs)
+ {
+ /* wait for child processes to terminate */
+- while (procs > 0)
++ while (procs > maxprocs)
+ {
+ int status;
+ if (wait (&status) > 0)
+@@ -121,7 +121,7 @@ process_file(const char *path, size_t offset, size_t length)
+ int maxprocs = conf->system.maxprocs;
+
+ if (procs >= maxprocs)
+- wait_for_children ();
++ wait_for_children (maxprocs);
+
+ if (maxprocs > 0)
+ {
+@@ -257,7 +257,7 @@ preload_readahead (preload_map_t **files, int file_count)
+ path = NULL;
+ }
+
+- wait_for_children ();
++ wait_for_children (0);
+
+ return processed;
+ }
+--
+1.5.4.5
+
diff --git a/sys-apps/preload/files/preload-0.6.3-nice-segfault.patch b/sys-apps/preload/files/preload-0.6.3-nice-segfault.patch
new file mode 100644
index 000000000000..058c5367770f
--- /dev/null
+++ b/sys-apps/preload/files/preload-0.6.3-nice-segfault.patch
@@ -0,0 +1,39 @@
+From 6c0e605415f82509522597f8695be8797104ac4b Mon Sep 17 00:00:00 2001
+From: Behdad Esfahbod <behdad@users.sourceforge.net>
+Date: Tue, 19 Aug 2008 16:38:54 +0000
+Subject: [PATCH] 2008-08-19 Behdad Esfahbod <behdad@gnome.org>
+
+ * src/cmdline.c: --nice was segfaulting. Fix it.
+---
+ ChangeLog | 4 ++++
+ src/cmdline.c | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 2d785af..87ac2a0 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,7 @@
++2008-08-19 Behdad Esfahbod <behdad@gnome.org>
++
++ * src/cmdline.c: --nice was segfaulting. Fix it.
++
+ 2008-07-28 Behdad Esfahbod <behdad@gnome.org>
+
+ * NEWS:
+diff --git a/src/cmdline.c b/src/cmdline.c
+index b175a21..e4e6797 100644
+--- a/src/cmdline.c
++++ b/src/cmdline.c
+@@ -38,7 +38,7 @@ static const struct option const opts[] = {
+ {"statefile", 1, 0, 's'},
+ {"logfile", 1, 0, 'l'},
+ {"foreground", 0, 0, 'f'},
+- {"nice", 0, 0, 'n'},
++ {"nice", 1, 0, 'n'},
+ {"verbose", 1, 0, 'V'},
+ {"debug", 0, 0, 'd'},
+ {NULL, 0, 0, 0},
+--
+1.5.6.4
+
diff --git a/sys-apps/preload/files/preload-0.6.3-overlapping-io-bursts.patch b/sys-apps/preload/files/preload-0.6.3-overlapping-io-bursts.patch
new file mode 100644
index 000000000000..20ba67a1bb4b
--- /dev/null
+++ b/sys-apps/preload/files/preload-0.6.3-overlapping-io-bursts.patch
@@ -0,0 +1,29 @@
+From 97814f566aeb84f60031008c3dda5457ba176fe7 Mon Sep 17 00:00:00 2001
+From: Kai Krakow <kai@kaishome.de>
+Date: Mon, 28 Jul 2008 20:57:06 +0200
+Subject: [PATCH] Create short overlapping io bursts
+
+Modify the wait_for_children() mechanism to create short
+burst instead of constant flow of new io requests. This
+is more fair and should enable the kernel to rearrange
+io requests better.
+---
+ src/readahead.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/readahead.c b/src/readahead.c
+index 7617449..466961d 100644
+--- a/src/readahead.c
++++ b/src/readahead.c
+@@ -121,7 +121,7 @@ process_file(const char *path, size_t offset, size_t length)
+ int maxprocs = conf->system.maxprocs;
+
+ if (procs >= maxprocs)
+- wait_for_children (maxprocs);
++ wait_for_children (maxprocs >> 1);
+
+ if (maxprocs > 0)
+ {
+--
+1.5.4.5
+
diff --git a/sys-apps/preload/preload-0.6.3-r1.ebuild b/sys-apps/preload/preload-0.6.3-r1.ebuild
deleted file mode 100644
index 7a4b3f04874f..000000000000
--- a/sys-apps/preload/preload-0.6.3-r1.ebuild
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 1999-2008 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/preload-0.6.3-r1.ebuild,v 1.1 2008/10/20 18:58:10 darkside Exp $
-
-DESCRIPTION="Adaptive readahead daemon."
-HOMEPAGE="http://sourceforge.net/projects/preload"
-SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE=""
-
-RDEPEND="dev-libs/glib"
-DEPEND="${RDEPEND}
- dev-util/pkgconfig"
-
-src_compile() {
- econf --localstatedir=/var
- emake -j1 || die "emake failed"
-}
-
-src_install() {
- emake DESTDIR="${D}" install || die "install failed"
- rm -rf "${D}/etc/rc.d" || die "rm rc.d failed"
- rm -rf "${D}/etc/sysconfig" || die "rm sysconfig failed"
- newinitd "${FILESDIR}/init.d-preload" preload || die "initd failed"
- newconfd "${FILESDIR}/conf.d-preload" preload || die "confd failed"
- dodoc AUTHORS ChangeLog NEWS README THANKS TODO
-}
-
diff --git a/sys-apps/preload/preload-0.6.3-r3.ebuild b/sys-apps/preload/preload-0.6.3-r4.ebuild
index 5e8c34030642..2070033d9fbc 100644
--- a/sys-apps/preload/preload-0.6.3-r3.ebuild
+++ b/sys-apps/preload/preload-0.6.3-r4.ebuild
@@ -1,8 +1,7 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/preload-0.6.3-r3.ebuild,v 1.1 2008/10/23 15:16:14 darkside Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/preload/preload-0.6.3-r4.ebuild,v 1.1 2008/10/24 01:38:43 darkside Exp $
-EAPI="2"
inherit eutils
DESCRIPTION="Adaptive readahead daemon."
@@ -12,32 +11,42 @@ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
-IUSE=""
+IUSE="vanilla"
RDEPEND="dev-libs/glib"
DEPEND="${RDEPEND}
dev-util/pkgconfig"
-src_prepare() {
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
# Patch to add /opt & /lib32 to allowed files to preload. Submitted
# upstream, bug #242580
epatch "${FILESDIR}/${P}-conf.patch"
-}
-
-src_configure() {
- econf --localstatedir=/var
+ epatch "${FILESDIR}/${P}-nice-segfault.patch"
+ use vanilla || epatch "${FILESDIR}/${P}-forking-children.patch"
+ use vanilla || epatch "${FILESDIR}/${P}-overlapping-io-bursts.patch"
}
src_compile() {
+ econf --localstatedir=/var
emake -j1 || die "emake failed"
}
src_install() {
emake DESTDIR="${D}" install || die "install failed"
- rm -rf "${D}/etc/rc.d" || die "rm rc.d failed"
- rm -rf "${D}/etc/sysconfig" || die "rm sysconfig failed"
+ rm -rf "${D}/etc/rc.d/" || die "rm rc.d failed"
+ rm -rf "${D}/etc/sysconfig/" || die "rm sysconfig failed"
+ rm -f "${D}/var/lib/preload/preload.state" || die "cleanup1 failed"
+ rm -f "${D}/var/log/preload.log" || die "cleanup2 failed"
+ keepdir /var/lib/preload
+ keepdir /var/log
newinitd "${FILESDIR}/init.d-preload" preload || die "initd failed"
newconfd "${FILESDIR}/conf.d-preload" preload || die "confd failed"
dodoc AUTHORS ChangeLog NEWS README THANKS TODO
}
+pkg_postinst() {
+ elog "To start preload at boot, remember to add it to a runlevel:"
+ elog "# rc-update add preload default"
+}