Prevents high CPU usage

This commit is contained in:
Filip Januš 2021-09-06 21:53:34 +02:00
parent 048ed7a3ff
commit 316f3195dc
2 changed files with 27 additions and 2 deletions

View File

@ -0,0 +1,18 @@
Author: Filip Januš <fjanus@redhat.com>
Date: 6 Sep 2021
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1992402
diff -ur db-5.3.28/src/os/os_map.c db-patched/src/os/os_map.c
--- db-5.3.28/src/os/os_map.c 2013-09-09 17:35:09.000000000 +0200
+++ db-patched/src/os/os_map.c 2021-09-06 14:32:28.792139908 +0200
@@ -213,6 +213,10 @@
if (rp->max < rp->size)
rp->max = rp->size;
if (ret == 0 && F_ISSET(infop, REGION_CREATE)) {
+#ifdef HAVE_MLOCK
+ if (F_ISSET(env, ENV_LOCKDOWN))
+ rp->size = rp->max;
+#endif
if (F_ISSET(dbenv, DB_ENV_REGION_INIT))
ret = __db_file_write(env, infop->fhp,
rp->size / MEGABYTE, rp->size % MEGABYTE, 0x00);

View File

@ -5,7 +5,7 @@
Summary: The Berkeley DB database library for C
Name: libdb
Version: 5.3.28
Release: 47%{?dist}
Release: 48%{?dist}
Source0: http://download.oracle.com/berkeley-db/db-%{version}.tar.gz
Source1: http://download.oracle.com/berkeley-db/db.1.85.tar.gz
# For mt19937db.c
@ -56,7 +56,8 @@ Patch38: libdb-limit-cpu.patch
Patch39: libdb-5.3.21-trickle_cpu.patch
# cve-2019-2708 fixed by mmuzila
Patch40: db-5.3.28_cve-2019-2708.patch
# Prevents high CPU usage
Patch41: db-5.3.28-mmap-high-cpu-usage.patch
URL: http://www.oracle.com/database/berkeley-db/
License: BSD and LGPLv2 and Sleepycat
@ -227,6 +228,7 @@ popd
%patch38 -p1
%patch39 -p1
%patch40 -p1 -b .cve-2019-2708
%patch41 -p1
cd dist
./s_config
@ -387,6 +389,11 @@ mv man/* ${RPM_BUILD_ROOT}%{_mandir}/man1
%{_includedir}/%{name}/dbsql.h
%changelog
* Mon Sep 6 2021 Filip Januš <fjanus@redhat.com> 5.3.28-48
- Bad order of sys calls cause high CPU usage
- Related: #1992402
- Patch no. 41 was added
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.28-47
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild