Hello community, here is the log from the commit of package stress-ng for openSUSE:Factory checked in at 2018-03-28 10:30:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/stress-ng (Old) and /work/SRC/openSUSE:Factory/.stress-ng.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "stress-ng" Wed Mar 28 10:30:53 2018 rev:38 rq:591029 version:0.09.22 Changes: -------- --- /work/SRC/openSUSE:Factory/stress-ng/stress-ng.changes 2018-03-24 16:16:29.449095227 +0100 +++ /work/SRC/openSUSE:Factory/.stress-ng.new/stress-ng.changes 2018-03-28 10:30:56.501994444 +0200 @@ -1,0 +2,13 @@ +Sun Mar 25 09:22:23 UTC 2018 - [email protected] + +- Update to version 0.09.22 + * Makefile: bump version + * stress-mmap: add extra checking on fd, don't do I/O on -ve fd + * out-of-memory: ensure buffer is null-terminated + * out-of-memory: move non-linux variant of process_oomed + * out-of-memory: detect if a stressor was killed by the OOM killer and + don't mark it as a strict stressor failure (LP: #1755245) + * stress-mmap: add missing I/O to/from mmap'd buffer on mmap'd address + * stress-ng.h: fix missing perf option (LP: #1758383) + +------------------------------------------------------------------- Old: ---- stress-ng-0.09.21.tar.xz New: ---- stress-ng-0.09.22.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ stress-ng.spec ++++++ --- /var/tmp/diff_new_pack.irOkKN/_old 2018-03-28 10:30:57.465959776 +0200 +++ /var/tmp/diff_new_pack.irOkKN/_new 2018-03-28 10:30:57.469959633 +0200 @@ -18,7 +18,7 @@ Name: stress-ng -Version: 0.09.21 +Version: 0.09.22 Release: 0 Summary: Tool to load and stress a computer License: GPL-2.0-only ++++++ stress-ng-0.09.21.tar.xz -> stress-ng-0.09.22.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.21/Makefile new/stress-ng-0.09.22/Makefile --- old/stress-ng-0.09.21/Makefile 2018-03-21 14:24:17.000000000 +0100 +++ new/stress-ng-0.09.22/Makefile 2018-03-23 17:44:44.000000000 +0100 @@ -16,7 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -VERSION=0.09.21 +VERSION=0.09.22 # # Codename "portable pressure producer" # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.21/out-of-memory.c new/stress-ng-0.09.22/out-of-memory.c --- old/stress-ng-0.09.21/out-of-memory.c 2018-03-21 14:24:17.000000000 +0100 +++ new/stress-ng-0.09.22/out-of-memory.c 2018-03-23 17:44:44.000000000 +0100 @@ -35,6 +35,50 @@ /* + * process_oomed() + * check if a process has been logged as OOM killed + */ +bool process_oomed(const pid_t pid) +{ + int fd; + bool oomed = false; + + fd = open("/dev/kmsg", O_RDONLY | O_NONBLOCK); + if (fd < 0) + return oomed; + + for (;;) { + char buf[4096], *ptr; + ssize_t ret; + + ret = read(fd, buf, sizeof(buf) - 1); + if (ret < 0) + break; + buf[ret] = '\0'; + + /* + * Look for 'Out of memory: Kill process 22566' + */ + ptr = strstr(buf, "process"); + if (ptr && (strstr(buf, "Out of memory") || + strstr(buf, "oom_reaper"))) { + pid_t oom_pid; + + if (sscanf(ptr + 7, "%10d", &oom_pid) == 1) { + if (oom_pid == pid) { + oomed = true; + break; + } + } + } + } + (void)close(fd); + + return oomed; +} + + +/* * set_oom_adjustment() * attempt to stop oom killer * if we have root privileges then try and make process @@ -104,4 +148,10 @@ (void)name; (void)killable; } +bool process_oomed(const pid_t pid) +{ + (void)pid; + + return false; +} #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.21/stress-mmap.c new/stress-ng-0.09.22/stress-mmap.c --- old/stress-ng-0.09.21/stress-mmap.c 2018-03-21 14:24:17.000000000 +0100 +++ new/stress-ng-0.09.22/stress-mmap.c 2018-03-23 17:44:44.000000000 +0100 @@ -160,6 +160,26 @@ } /* + * Step #0, write + read the mmap'd data from the file back into + * the mappings. + */ + if ((fd >= 0) && (g_opt_flags & OPT_FLAGS_MMAP_FILE)) { + off_t offset = 0; + + for (n = 0; n < pages4k; n++, offset += page_size) { + ssize_t ret; + + if (lseek(fd, offset, SEEK_SET) < 0) + continue; + + ret = write(fd, mappings[n], page_size); + (void)ret; + ret = read(fd, mappings[n], page_size); + (void)ret; + } + } + + /* * Step #1, unmap all pages in random order */ (void)mincore_touch_pages(buf, mmap_bytes); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.21/stress-ng.c new/stress-ng-0.09.22/stress-ng.c --- old/stress-ng-0.09.21/stress-ng.c 2018-03-21 14:24:17.000000000 +0100 +++ new/stress-ng-0.09.22/stress-ng.c 2018-03-23 17:44:44.000000000 +0100 @@ -2080,7 +2080,21 @@ pr_dbg("process [%d] (stress-ng-%s) terminated on signal\n", ret, pi->stressor->name); #endif - *success = false; + /* + * If the stressor got killed by OOM or SIGKILL + * then somebody outside of our control nuked it + * so don't necessarily flag that up as a direct + * failure. + */ + if (process_oomed(ret)) { + pr_dbg("process [%d] (stress-ng-%s) was killed by the OOM killer\n", + ret, pi->stressor->name); + } else if (WTERMSIG(status) == SIGKILL) { + pr_dbg("process [%d] (stress-ng-%s) was possibly killed by the OOM killer\n", + ret, pi->stressor->name); + } else { + *success = false; + } } switch (WEXITSTATUS(status)) { case EXIT_SUCCESS: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/stress-ng-0.09.21/stress-ng.h new/stress-ng-0.09.22/stress-ng.h --- old/stress-ng-0.09.21/stress-ng.h 2018-03-21 14:24:17.000000000 +0100 +++ new/stress-ng-0.09.22/stress-ng.h 2018-03-23 17:44:44.000000000 +0100 @@ -1113,7 +1113,7 @@ /* perf related constants */ #if defined(HAVE_LIB_PTHREAD) && \ - defined(HAVE_PERF_EVENT_H) && \ + defined(HAVE_LINUX_PERF_EVENT_H) && \ defined(__linux__) && \ defined(__NR_perf_event_open) #define STRESS_PERF_STATS (1) @@ -2494,6 +2494,7 @@ /* Misc settings helpers */ extern void set_oom_adjustment(const char *name, const bool killable); +extern WARN_UNUSED bool process_oomed(const pid_t pid); extern WARN_UNUSED int stress_set_sched(const pid_t pid, const int32_t sched, const int sched_priority, const bool quiet); extern const char *stress_get_sched_name(const int sched);
