[linux-signed] 05/09: debian/bin/sign.py: Reduce heap size to speed up fork()
debian-kernel at lists.debian.org
debian-kernel at lists.debian.org
Sat Apr 16 01:04:20 UTC 2016
This is an automated email from the git hooks/post-receive script.
benh pushed a commit to branch master
in repository linux-signed.
commit 8bccafc88ff392866035069c28e887fd644a0b3f
Author: Ben Hutchings <ben at decadent.org.uk>
Date: Sat Apr 16 00:33:06 2016 +0100
debian/bin/sign.py: Reduce heap size to speed up fork()
---
debian/bin/sign.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/debian/bin/sign.py b/debian/bin/sign.py
index f46e245..6f147ab 100755
--- a/debian/bin/sign.py
+++ b/debian/bin/sign.py
@@ -5,6 +5,7 @@ sys.path.append(sys.argv[1] + "/lib/python")
import os, os.path, shutil, subprocess, tempfile
import deb822, codecs, gzip, hashlib, io, re, struct, urllib.parse, urllib.request
+import gc
from debian_linux.config import ConfigCoreDump
from debian_linux.debian import VersionLinux
@@ -66,7 +67,10 @@ def get_packages_data(mirror, suite, arch):
# Make a dictionary of per-package data
_packages_data[arch] = data = {}
for package_data in deb822.Packages.iter_paragraphs(packages_stream):
- data[package_data['Package']] = package_data
+ name = package_data['Package']
+ # Filter so the heap doesn't become huge
+ if name.startswith('linux-image-'):
+ data[name] = package_data
return _packages_data[arch]
@@ -184,6 +188,9 @@ def sign(config_name, imageversion_str, modules_privkey_name, modules_cert_name,
package_dir = get_package(mirror_url, suite,
package_name, imageversion_str, arch)
+ # Shrink the heap before we start forking children
+ gc.collect()
+
signature_dir = os.path.join('debian/signatures', package_name)
os.makedirs(signature_dir)
sign_modules(kbuild_dir,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux-signed.git
More information about the Kernel-svn-changes
mailing list