[systemd] Fix memory size detection

Michal Schmidt michich at fedoraproject.org
Sun Jun 12 23:41:41 UTC 2011


commit 62bfbded21727ed3024d61d3aee0152d8c717d8a
Author: Michal Schmidt <mschmidt at redhat.com>
Date:   Mon Jun 13 01:38:43 2011 +0200

    Fix memory size detection
    
    Apply patches from current upstream.
    Fixes memory size detection on 32-bit with >4GB RAM (BZ712341)

 0001-exec-Fix-number-of-unit-types.patch           |    2 +-
 ...temctl-fix-double-unref-of-a-dbus-message.patch |    2 +-
 ...etup-generator-fix-etc-cryptsetup-options.patch |    2 +-
 ...elinuxfs-can-be-mounted-on-sys-fs-selinux.patch |    2 +-
 ...kconfig-support-in-systemctl-for-openSUSE.patch |   25 +++++++++++++++
 ...ad-common-fix-total-memory-size-detection.patch |   33 ++++++++++++++++++++
 systemd.spec                                       |   12 ++++++-
 7 files changed, 72 insertions(+), 6 deletions(-)
---
diff --git a/0001-exec-Fix-number-of-unit-types.patch b/0001-exec-Fix-number-of-unit-types.patch
index a5cfe44..5f60ac2 100644
--- a/0001-exec-Fix-number-of-unit-types.patch
+++ b/0001-exec-Fix-number-of-unit-types.patch
@@ -1,7 +1,7 @@
 From 9a66640832d103f906c2ef609a1d19d43fc542f6 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Ozan=20=C3=87a=C4=9Flayan?= <ozan at pardus.org.tr>
 Date: Fri, 27 May 2011 08:24:22 +0300
-Subject: [PATCH 1/4] exec: Fix number of unit types
+Subject: [PATCH 1/6] exec: Fix number of unit types
 
 There are four unit types mentioned in here, not three
 ---
diff --git a/0002-systemctl-fix-double-unref-of-a-dbus-message.patch b/0002-systemctl-fix-double-unref-of-a-dbus-message.patch
index e07f3a7..07e96e8 100644
--- a/0002-systemctl-fix-double-unref-of-a-dbus-message.patch
+++ b/0002-systemctl-fix-double-unref-of-a-dbus-message.patch
@@ -1,7 +1,7 @@
 From 78e39b43b89c6bf9ce401d6030939a004a23c850 Mon Sep 17 00:00:00 2001
 From: Michal Schmidt <mschmidt at redhat.com>
 Date: Sun, 5 Jun 2011 17:22:37 +0200
-Subject: [PATCH 2/4] systemctl: fix double unref of a dbus message
+Subject: [PATCH 2/6] systemctl: fix double unref of a dbus message
 
 ---
  src/systemctl.c |    1 +
diff --git a/0003-cryptsetup-generator-fix-etc-cryptsetup-options.patch b/0003-cryptsetup-generator-fix-etc-cryptsetup-options.patch
index 585664c..8c5b89d 100644
--- a/0003-cryptsetup-generator-fix-etc-cryptsetup-options.patch
+++ b/0003-cryptsetup-generator-fix-etc-cryptsetup-options.patch
@@ -1,7 +1,7 @@
 From aae5220d961a419a1e160de90ee5c393c7c13607 Mon Sep 17 00:00:00 2001
 From: Michal Schmidt <mschmidt at redhat.com>
 Date: Mon, 6 Jun 2011 22:59:19 +0200
-Subject: [PATCH 3/4] cryptsetup-generator: fix /etc/cryptsetup options
+Subject: [PATCH 3/6] cryptsetup-generator: fix /etc/cryptsetup options
 
 cryptsetup-generator parses the options in /etc/cryptsetup incorrectly.
 It fails to find the 'swap' option in
diff --git a/0004-selinux-selinuxfs-can-be-mounted-on-sys-fs-selinux.patch b/0004-selinux-selinuxfs-can-be-mounted-on-sys-fs-selinux.patch
index 172ac3d..1863ecc 100644
--- a/0004-selinux-selinuxfs-can-be-mounted-on-sys-fs-selinux.patch
+++ b/0004-selinux-selinuxfs-can-be-mounted-on-sys-fs-selinux.patch
@@ -1,7 +1,7 @@
 From ef9d7dca5463e64510e174d55a869b4d5a3c4e84 Mon Sep 17 00:00:00 2001
 From: Michal Schmidt <mschmidt at redhat.com>
 Date: Tue, 7 Jun 2011 00:48:16 +0200
-Subject: [PATCH 4/4] selinux: selinuxfs can be mounted on /sys/fs/selinux
+Subject: [PATCH 4/6] selinux: selinuxfs can be mounted on /sys/fs/selinux
 
 The kernel now provides the /sys/fs/selinux mountpoint and libselinux
 prefers it if it's available.
diff --git a/0005-enable-chkconfig-support-in-systemctl-for-openSUSE.patch b/0005-enable-chkconfig-support-in-systemctl-for-openSUSE.patch
new file mode 100644
index 0000000..353686f
--- /dev/null
+++ b/0005-enable-chkconfig-support-in-systemctl-for-openSUSE.patch
@@ -0,0 +1,25 @@
+From dc725264f34f3a81eb47b7472f4484f849e0461d Mon Sep 17 00:00:00 2001
+From: Frederic Crozat <fcrozat at suse.com>
+Date: Wed, 8 Jun 2011 17:34:22 +0200
+Subject: [PATCH 5/6] enable chkconfig support in systemctl for openSUSE
+
+---
+ src/systemctl.c |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/src/systemctl.c b/src/systemctl.c
+index a82cce4..faca797 100644
+--- a/src/systemctl.c
++++ b/src/systemctl.c
+@@ -4089,7 +4089,7 @@ static int install_info_apply(const char *verb, LookupPaths *paths, InstallInfo
+         }
+ 
+         if (!f) {
+-#if (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA)) || defined(TARGET_MEEGO) && defined (HAVE_SYSV_COMPAT)
++#if (defined(TARGET_FEDORA) || defined(TARGET_MANDRIVA) || defined(TARGET_SUSE)) || defined(TARGET_MEEGO) && defined (HAVE_SYSV_COMPAT)
+ 
+                 if (endswith(i->name, ".service")) {
+                         char *sysv;
+-- 
+1.7.4.4
+
diff --git a/0006-readahead-common-fix-total-memory-size-detection.patch b/0006-readahead-common-fix-total-memory-size-detection.patch
new file mode 100644
index 0000000..4f3a3ea
--- /dev/null
+++ b/0006-readahead-common-fix-total-memory-size-detection.patch
@@ -0,0 +1,33 @@
+From 597b99b09a007dfa8ddfce31c480765b0c7baa6a Mon Sep 17 00:00:00 2001
+From: Michal Schmidt <mschmidt at redhat.com>
+Date: Fri, 10 Jun 2011 14:37:21 +0200
+Subject: [PATCH 6/6] readahead-common: fix total memory size detection
+
+sysinfo returns the total memory size in multiples of mem_unit bytes.
+As long as the size in bytes fits into unsigned long, the kernel uses
+mem_unit = 1, but this is not true on i386 with more than 4 GB RAM.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=712341
+---
+ src/readahead-common.c |    5 ++---
+ 1 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/src/readahead-common.c b/src/readahead-common.c
+index 8a75b2e..f0d57b4 100644
+--- a/src/readahead-common.c
++++ b/src/readahead-common.c
+@@ -154,9 +154,8 @@ bool enough_ram(void) {
+ 
+         assert_se(sysinfo(&si) >= 0);
+ 
+-        return si.totalram > 127 * 1024*1024; /* Enable readahead only
+-                                               * with at least 128MB
+-                                               * memory */
++        /* Enable readahead only with at least 128MB memory */
++        return si.totalram > 127 * 1024*1024 / si.mem_unit;
+ }
+ 
+ int open_inotify(void) {
+-- 
+1.7.4.4
+
diff --git a/systemd.spec b/systemd.spec
index 415c286..99d9de6 100644
--- a/systemd.spec
+++ b/systemd.spec
@@ -2,7 +2,7 @@ Name:           systemd
 Url:            http://www.freedesktop.org/wiki/Software/systemd
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Version:        28
-Release:        3%{?dist}
+Release:        4%{?dist}
 License:        GPLv2+
 Group:          System Environment/Base
 Summary:        A System and Service Manager
@@ -41,6 +41,8 @@ Patch1:         0001-exec-Fix-number-of-unit-types.patch
 Patch2:         0002-systemctl-fix-double-unref-of-a-dbus-message.patch
 Patch3:         0003-cryptsetup-generator-fix-etc-cryptsetup-options.patch
 Patch4:         0004-selinux-selinuxfs-can-be-mounted-on-sys-fs-selinux.patch
+Patch5:         0005-enable-chkconfig-support-in-systemctl-for-openSUSE.patch
+Patch6:         0006-readahead-common-fix-total-memory-size-detection.patch
 
 # For sysvinit tools
 Obsoletes:      SysVinit < 2.86-24, sysvinit < 2.86-24
@@ -98,6 +100,8 @@ SysV compatibility tools for systemd
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
+%patch6 -p1
 
 %build
 %configure --with-rootdir= --with-distro=fedora
@@ -298,7 +302,11 @@ fi
 %{_bindir}/systemd-sysv-convert
 
 %changelog
-* Wed Jun 08 2011 Michal Schmidt <mschmidt at redhat.com> 28-3
+* Mon Jun 13 2011 Michal Schmidt <mschmidt at redhat.com> - 28-4
+- Apply patches from current upstream.
+- Fixes memory size detection on 32-bit with >4GB RAM (BZ712341)
+
+* Wed Jun 08 2011 Michal Schmidt <mschmidt at redhat.com> - 28-3
 - Apply patches from current upstream
 - https://bugzilla.redhat.com/show_bug.cgi?id=709909
 - https://bugzilla.redhat.com/show_bug.cgi?id=710839


More information about the scm-commits mailing list