Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package numactl for openSUSE:Factory checked in at 2024-02-07 18:47:18 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/numactl (Old) and /work/SRC/openSUSE:Factory/.numactl.new.1815 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "numactl" Wed Feb 7 18:47:18 2024 rev:72 rq:1144497 version:2.0.17.8.g67984e5 Changes: -------- --- /work/SRC/openSUSE:Factory/numactl/numactl.changes 2024-01-30 18:25:04.737214503 +0100 +++ /work/SRC/openSUSE:Factory/.numactl.new.1815/numactl.changes 2024-02-07 18:48:15.914385907 +0100 @@ -1,0 +2,9 @@ +Mon Feb 05 08:36:43 UTC 2024 - [email protected] + +- Update to version 2.0.17.8.g67984e5: + * numastat: Print package version number instead of own. + * numastat: Remove commented out perl code + * Check for MPOL_PREFERRED_MANY lazily + * libnuma: add numa_set_mempolicy_home_node API + +------------------------------------------------------------------- Old: ---- numactl-2.0.17.4.g63befa8.obscpio New: ---- numactl-2.0.17.8.g67984e5.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ numactl.spec ++++++ --- /var/tmp/diff_new_pack.g8CYzX/_old 2024-02-07 18:48:16.662412882 +0100 +++ /var/tmp/diff_new_pack.g8CYzX/_new 2024-02-07 18:48:16.662412882 +0100 @@ -17,7 +17,7 @@ Name: numactl -Version: 2.0.17.4.g63befa8 +Version: 2.0.17.8.g67984e5 Release: 0 Summary: NUMA Policy Control License: GPL-2.0-only ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.g8CYzX/_old 2024-02-07 18:48:16.702414325 +0100 +++ /var/tmp/diff_new_pack.g8CYzX/_new 2024-02-07 18:48:16.702414325 +0100 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/numactl/numactl</param> - <param name="changesrevision">63befa86deb5e818dc95cde247776a3c93504ce6</param></service></servicedata> + <param name="changesrevision">67984e5b93a34a437f3085c53edfb4cc2cdc4fa6</param></service></servicedata> (No newline at EOF) ++++++ numactl-2.0.17.4.g63befa8.obscpio -> numactl-2.0.17.8.g67984e5.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/numactl-2.0.17.4.g63befa8/Makefile.am new/numactl-2.0.17.8.g67984e5/Makefile.am --- old/numactl-2.0.17.4.g63befa8/Makefile.am 2024-01-29 13:49:50.000000000 +0100 +++ new/numactl-2.0.17.8.g67984e5/Makefile.am 2024-02-02 18:14:52.000000000 +0100 @@ -21,7 +21,7 @@ numactl_CFLAGS = $(AM_CFLAGS) -DVERSION=\"$(shell cat ${srcdir}/VERSION)\" numastat_SOURCES = numastat.c -numastat_CFLAGS = $(AM_CFLAGS) -std=gnu99 +numastat_CFLAGS = $(AM_CFLAGS) -std=gnu99 -DVERSION=\"$(shell cat ${srcdir}/VERSION)\" numademo_SOURCES = numademo.c stream_lib.c stream_lib.h mt.c mt.h clearcache.c util.c clearcache.h numademo_CPPFLAGS = $(AM_CPPFLAGS) -DHAVE_STREAM_LIB -DHAVE_MT -DHAVE_CLEAR_CACHE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/numactl-2.0.17.4.g63befa8/libnuma.c new/numactl-2.0.17.8.g67984e5/libnuma.c --- old/numactl-2.0.17.4.g63befa8/libnuma.c 2024-01-29 13:49:50.000000000 +0100 +++ new/numactl-2.0.17.8.g67984e5/libnuma.c 2024-02-02 18:14:52.000000000 +0100 @@ -80,7 +80,7 @@ static int nodemask_sz = 0; static int cpumask_sz = 0; -static int has_preferred_many = 0; +static int has_preferred_many = -1; int numa_exit_on_error = 0; int numa_exit_on_warn = 0; @@ -623,24 +623,28 @@ } static void -set_kernel_abi() +set_preferred_many(void) { int oldp; struct bitmask *bmp, *tmp; + + if (has_preferred_many >= 0) + return; + + has_preferred_many = 0; + bmp = numa_allocate_nodemask(); tmp = numa_get_mems_allowed(); - - // partial leak shouldn't happen if (!tmp || !bmp) - return; + goto out; if (get_mempolicy(&oldp, bmp->maskp, bmp->size + 1, 0, 0) < 0) goto out; if (set_mempolicy(MPOL_PREFERRED_MANY, tmp->maskp, tmp->size) == 0) { - has_preferred_many++; - /* reset the old memory policy */ - setpol(oldp, bmp); + has_preferred_many = 1; + /* reset the old memory policy ignoring error */ + (void)set_mempolicy(oldp, bmp->maskp, bmp->size+1); } out: @@ -660,7 +664,6 @@ set_numa_max_cpu(); /* size of kernel cpumask_t */ set_configured_cpus(); /* cpus listed in /sys/devices/system/cpu */ set_task_constraints(); /* cpus and nodes for current task */ - set_kernel_abi(); /* man policy supported */ } int @@ -1108,6 +1111,7 @@ void numa_set_bind_policy(int strict) { + set_preferred_many(); if (strict) bind_policy = MPOL_BIND; else if (has_preferred_many) @@ -1925,6 +1929,7 @@ int numa_has_preferred_many(void) { + set_preferred_many(); return has_preferred_many; } @@ -1932,6 +1937,7 @@ { int first_node = 0; + set_preferred_many(); if (!has_preferred_many) { numa_warn(W_nodeparse, "Unable to handle MANY preferred nodes. Falling back to first node\n"); @@ -2237,3 +2243,37 @@ { return __numa_parse_cpustring(s, numa_possible_cpus_ptr); } + +int numa_has_home_node(void) +{ + void *mem; + static int has_home_node = -1; + int page_size = numa_pagesize(); + struct bitmask *tmp = numa_get_mems_allowed(); + + if (has_home_node >= 0) + goto out; + + has_home_node = 0; + /* Detect whether home_node is supported */ + mem = mmap(0, page_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (mem != MAP_FAILED) { + dombind(mem, page_size, MPOL_BIND, tmp); + if (set_mempolicy_home_node(mem, page_size, numa_find_first(tmp), 0) == 0) + has_home_node = 1; + munmap(mem, page_size); + } + +out: + return has_home_node; +} + +int numa_set_mempolicy_home_node(void *start, unsigned long len, int home_node, int flags) +{ + if (set_mempolicy_home_node(start, len, home_node, flags)) { + numa_error("set_mempolicy_home_node"); + return -1; + } + + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/numactl-2.0.17.4.g63befa8/numa.3 new/numactl-2.0.17.8.g67984e5/numa.3 --- old/numactl-2.0.17.4.g63befa8/numa.3 2024-01-29 13:49:50.000000000 +0100 +++ new/numactl-2.0.17.8.g67984e5/numa.3 2024-02-02 18:14:52.000000000 +0100 @@ -72,6 +72,10 @@ .br .BI "void numa_set_preferred_many(struct bitmask *" nodemask ); .br +.BI "int numa_has_home_node(void); +.br +.BI "int numa_set_mempolicy_home_node(void *start, unsigned long len, int home_node, int flags); +.br .BI "int numa_get_interleave_node(void); .br .B struct bitmask *numa_get_interleave_mask(void); @@ -465,6 +469,15 @@ The caller is responsible for freeing the mask with .BR numa_bitmask_free (). +.BR numa_has_home_node() +Returns 1 if the system supports setting home_node for mbind and preferred_many. + +.BR numa_set_mempolicy_home_node() +set the home node for a VMA policy present in the task's address range. +A home node is the NUMA node closest to which page allocation will come from. +Users should use it after setting up a mbind or perfered_many memory policy +for the specified range. + .BR numa_get_interleave_mask () returns the current interleave mask if the task's memory allocation policy is page interleaved. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/numactl-2.0.17.4.g63befa8/numa.h new/numactl-2.0.17.8.g67984e5/numa.h --- old/numactl-2.0.17.4.g63befa8/numa.h 2024-01-29 13:49:50.000000000 +0100 +++ new/numactl-2.0.17.8.g67984e5/numa.h 2024-02-02 18:14:52.000000000 +0100 @@ -341,6 +341,15 @@ * dependency */ struct bitmask *numa_parse_cpustring_all(const char *); +/* Returns whether or not the system supports setting home_node for mbind + * and preferred_many. + */ +int numa_has_home_node(void); + +/* set the home node for a VMA policy present in the task's address range */ +int numa_set_mempolicy_home_node(void *start, unsigned long len, + int home_node, int flags); + /* * The following functions are for source code compatibility * with releases prior to version 2. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/numactl-2.0.17.4.g63befa8/numaif.h new/numactl-2.0.17.8.g67984e5/numaif.h --- old/numactl-2.0.17.4.g63befa8/numaif.h 2024-01-29 13:49:50.000000000 +0100 +++ new/numactl-2.0.17.8.g67984e5/numaif.h 2024-02-02 18:14:52.000000000 +0100 @@ -21,6 +21,9 @@ extern long move_pages(int pid, unsigned long count, void **pages, const int *nodes, int *status, int flags); +extern int set_mempolicy_home_node(void *start, unsigned long len, + int home_node, int flag); + /* Policies */ #define MPOL_DEFAULT 0 #define MPOL_PREFERRED 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/numactl-2.0.17.4.g63befa8/numastat.c new/numactl-2.0.17.8.g67984e5/numastat.c --- old/numactl-2.0.17.4.g63befa8/numastat.c 2024-01-29 13:49:50.000000000 +0100 +++ new/numactl-2.0.17.8.g67984e5/numastat.c 2024-02-02 18:14:52.000000000 +0100 @@ -24,13 +24,9 @@ statistics. In 2012, numastat was rewritten as a C program by Red Hat to display per-node memory data for applications and the system in general, while also remaining strictly compatible by default with the original numastat. -A copy of the original numastat perl script is included for reference at the -end of this file. */ -// Compile with: gcc -O -std=gnu99 -Wall -o numastat numastat.c - #define __USE_MISC #include <ctype.h> #include <dirent.h> @@ -676,8 +672,7 @@ static void display_version_and_exit(void) { - char *version_string = "20130723"; - printf("%s version: %s: %s\n", prog_name, version_string, __DATE__); + printf("%s\n", VERSION); exit(EXIT_SUCCESS); } @@ -1468,8 +1463,7 @@ optind += 1; } // If there are no program options or arguments, be extremely compatible - // with the old numastat perl script (which is included at the end of this - // file for reference) + // with the old numastat perl script compatibility_mode = (argc == 1); init_node_ix_map_and_header(); // enumarate the NUMA nodes if (compatibility_mode) { @@ -1499,101 +1493,3 @@ free_node_ix_map_and_header(); exit(EXIT_SUCCESS); } - -#if 0 -/* - -#!/usr/bin/perl -# Print numa statistics for all nodes -# Copyright (C) 2003,2004 Andi Kleen, SuSE Labs. -# -# numastat is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public -# License as published by the Free Software Foundation; version -# 2. -# -# numastat is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should find a copy of v2 of the GNU General Public License somewhere -# on your Linux system; if not, write to the Free Software Foundation, -# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# Example: NUMASTAT_WIDTH=80 watch -n1 numastat -# - -# output width -$WIDTH=80; -if (defined($ENV{'NUMASTAT_WIDTH'})) { - $WIDTH=$ENV{'NUMASTAT_WIDTH'}; -} else { - use POSIX; - if (POSIX::isatty(fileno(STDOUT))) { - if (open(R, "resize |")) { - while (<R>) { - $WIDTH=$1 if /COLUMNS=(\d+)/; - } - close R; - } - } else { - # don't split it up for easier parsing - $WIDTH=10000000; - } -} -$WIDTH = 32 if $WIDTH < 32; - -if (! -d "/sys/devices/system/node" ) { - print STDERR "sysfs not mounted or system not NUMA aware\n"; - exit 1; -} - -%stat = (); -$title = ""; -$mode = 0; -opendir(NODES, "/sys/devices/system/node") || exit 1; -foreach $nd (readdir(NODES)) { - next unless $nd =~ /node(\d+)/; - # On newer kernels, readdir may enumerate the 'node(\d+) subdirs - # in opposite order from older kernels--e.g., node{0,1,2,...} - # as opposed to node{N,N-1,N-2,...}. Accommodate this by - # switching to new mode so that the stats get emitted in - # the same order. - #print "readdir(NODES) returns $nd\n"; - if (!$title && $nd =~ /node0/) { - $mode = 1; - } - open(STAT, "/sys/devices/system/node/$nd/numastat") || - die "cannot open $nd: $!\n"; - if (! $mode) { - $title = sprintf("%16s",$nd) . $title; - } else { - $title = $title . sprintf("%16s",$nd); - } - @fields = (); - while (<STAT>) { - ($name, $val) = split; - if (! $mode) { - $stat{$name} = sprintf("%16u", $val) . $stat{$name}; - } else { - $stat{$name} = $stat{$name} . sprintf("%16u", $val); - } - push(@fields, $name); - } - close STAT; -} -closedir NODES; - -$numfields = int(($WIDTH - 16) / 16); -$l = 16 * $numfields; -for ($i = 0; $i < length($title); $i += $l) { - print "\n" if $i > 0; - printf "%16s%s\n","",substr($title,$i,$l); - foreach (@fields) { - printf "%-16s%s\n",$_,substr($stat{$_},$i,$l); - } -} - -*/ -#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/numactl-2.0.17.4.g63befa8/syscall.c new/numactl-2.0.17.8.g67984e5/syscall.c --- old/numactl-2.0.17.4.g63befa8/syscall.c 2024-01-29 13:49:50.000000000 +0100 +++ new/numactl-2.0.17.8.g67984e5/syscall.c 2024-02-02 18:14:52.000000000 +0100 @@ -139,6 +139,16 @@ #endif +#if !defined(__NR_set_mempolicy_home_node) + +#if defined(__x86_64__) || defined(__aarch64__) +#define __NR_set_mempolicy_home_node 450 +#else +#error "Add syscalls for your architecture or update kernel headers" +#endif + +#endif + #ifndef __GLIBC_PREREQ # define __GLIBC_PREREQ(x,y) 0 #endif @@ -249,6 +259,11 @@ return syscall(__NR_move_pages, pid, count, pages, nodes, status, flags); } +int WEAK set_mempolicy_home_node(void *start, unsigned long len, int home_node, int flags) +{ + return syscall(__NR_set_mempolicy_home_node, start, len, home_node, flags); +} + /* SLES8 glibc doesn't define those */ SYMVER("numa_sched_setaffinity_v1", "numa_sched_setaffinity@libnuma_1.1") int numa_sched_setaffinity_v1(pid_t pid, unsigned len, const unsigned long *mask) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/numactl-2.0.17.4.g63befa8/versions.ldscript new/numactl-2.0.17.8.g67984e5/versions.ldscript --- old/numactl-2.0.17.4.g63befa8/versions.ldscript 2024-01-29 13:49:50.000000000 +0100 +++ new/numactl-2.0.17.8.g67984e5/versions.ldscript 2024-02-02 18:14:52.000000000 +0100 @@ -164,3 +164,11 @@ local: *; } libnuma_1.5; + +libnuma_1.7{ + global: + numa_has_home_node; + numa_set_mempolicy_home_node; + local: + *; +} libnuma_1.6; ++++++ numactl.obsinfo ++++++ --- /var/tmp/diff_new_pack.g8CYzX/_old 2024-02-07 18:48:16.866420238 +0100 +++ /var/tmp/diff_new_pack.g8CYzX/_new 2024-02-07 18:48:16.870420383 +0100 @@ -1,5 +1,5 @@ name: numactl -version: 2.0.17.4.g63befa8 -mtime: 1706532590 -commit: 63befa86deb5e818dc95cde247776a3c93504ce6 +version: 2.0.17.8.g67984e5 +mtime: 1706894092 +commit: 67984e5b93a34a437f3085c53edfb4cc2cdc4fa6
