Compare commits

...

No commits in common. "c8" and "c9-beta" have entirely different histories.
c8 ... c9-beta

23 changed files with 206 additions and 630 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/irqbalance-1.9.2.tar.gz SOURCES/irqbalance-1.9.4.tar.gz

1
.irqbalance.metadata Normal file
View File

@ -0,0 +1 @@
7a387c33663d9c696ea7922577c49902599c359b SOURCES/irqbalance-1.9.4.tar.gz

View File

@ -0,0 +1,38 @@
From c0cd6149722ca525cf31a363dbe724689bef4d87 Mon Sep 17 00:00:00 2001
From: Tao Liu <ltao@redhat.com>
Date: Wed, 13 Mar 2024 14:30:48 +0800
Subject: [PATCH 1/3] irqbalance-ui: check if using a negative index of buffer
A negative index will be used when recv() fails, which is unexpected for
the data buffer. The issue was found by Static Application Security
Testing (SAST), which is a potential weakness.
This patch will check the negative index before data buffer referencing.
Signed-off-by: Tao Liu <ltao@redhat.com>
---
ui/irqbalance-ui.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ui/irqbalance-ui.c b/ui/irqbalance-ui.c
index b7f9b62..c26eff6 100644
--- a/ui/irqbalance-ui.c
+++ b/ui/irqbalance-ui.c
@@ -127,9 +127,13 @@ try_again:
char *data = malloc(default_bufsz);
int len = recv(socket_fd, data, default_bufsz, MSG_TRUNC);
close(socket_fd);
- data[len] = '\0';
free(msg->msg_control);
free(msg);
+ if (len < 0) {
+ free(data);
+ return NULL;
+ }
+ data[len] = '\0';
if (len >= default_bufsz) {
/* msg was truncated, increase bufsz and try again */
default_bufsz += 8192;
--
2.40.1

View File

@ -1,26 +0,0 @@
From 7c18ffc9d0187d4d1983a53bb166aacad2a87dcc Mon Sep 17 00:00:00 2001
From: qyu <chinyu0704@icloud.com>
Date: Mon, 7 Nov 2022 17:01:38 +0800
Subject: [PATCH 01/13] optimize getting cpu number
cpu number has already been parsed and saved in cpunr, remove redudant strtoul().
---
cputree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cputree.c b/cputree.c
index eb1981e..d66be55 100644
--- a/cputree.c
+++ b/cputree.c
@@ -315,7 +315,7 @@ static void do_one_cpu(char *path)
cpu->obj_type = OBJ_TYPE_CPU;
- cpu->number = strtoul(&path[27], NULL, 10);
+ cpu->number = cpunr;
cpu_set(cpu->number, cpu_online_map);
--
2.33.1

View File

@ -1,34 +0,0 @@
From 188f9efc567bcaef25bde2813cdee7f952f992f9 Mon Sep 17 00:00:00 2001
From: Pat Riehecky <riehecky@fnal.gov>
Date: Mon, 4 Apr 2022 08:38:32 -0500
Subject: [rhel-only PATCH] revert Confine irqbalance to systems where it is useful.
ConditionCPUs only available from systemd(>=242), however the systemd
version for rhel8 is 239. So we need to revert the patch, otherwise we
will encounter the failing:
$ sudo systemd-analyze verify irqbalance.service
/usr/lib/systemd/system/irqbalance.service:6: Unknown lvalue
'ConditionCPUs' in section 'Unit'
This patch revert 188f9efc567bcaef25bde2813cdee7f952f992f9.
---
misc/irqbalance.service | 1 +
1 file changed, 1 insertion(+)
diff --git a/misc/irqbalance.service b/misc/irqbalance.service
index fcc29c2..0f79c3e 100644
--- a/misc/irqbalance.service
+++ b/misc/irqbalance.service
@@ -3,7 +3,6 @@ Description=irqbalance daemon
Documentation=man:irqbalance(1)
Documentation=https://github.com/Irqbalance/irqbalance
ConditionVirtualization=!container
-ConditionCPUs=>1
[Service]
EnvironmentFile=-/usr/lib/irqbalance/defaults.env
--
2.33.1

View File

@ -0,0 +1,41 @@
From 8301666f3029ff4d9089a273a45ec47671d964c1 Mon Sep 17 00:00:00 2001
From: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date: Fri, 29 Mar 2024 18:43:55 -0700
Subject: [PATCH 2/3] Check fflush() return value
Since fprintf() may buffer output, as noted in 470a64b19062, fclose()'s
error value was also being checked for the write errors. However in
8d7c78304fb9 an fflush() was added in between meaning that these
buffered write errors were again unchecked. Some actual errors were
not being logged, in my case -ENOSPCs.
Make the fclose and fflush branches look similar.
Fixes: 8d7c78304fb9 ("Flush file before closing")
---
activate.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/activate.c b/activate.c
index e30d0f0..0c1e7a1 100644
--- a/activate.c
+++ b/activate.c
@@ -82,10 +82,13 @@ static void activate_mapping(struct irq_info *info, void *data __attribute__((un
cpumask_scnprintf(buf, PATH_MAX, applied_mask);
ret = fprintf(file, "%s", buf);
errsave = errno;
- fflush(file);
+ if (ret >= 0 && fflush(file)) {
+ ret = -1;
+ errsave = errno;
+ }
if (fclose(file)) {
+ ret = -1;
errsave = errno;
- goto error;
}
if (ret < 0)
goto error;
--
2.40.1

View File

@ -1,31 +0,0 @@
From efec4c69157d17024c4d9194a63eb834efcd79b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dirk=20M=C3=BCller?= <dirk@dmllr.de>
Date: Fri, 11 Nov 2022 10:38:19 +0100
Subject: [PATCH 02/13] allow AF_NETLINK in the systemd service restrictions
AF_NETLINK is needed for communicating with the thermald daemon,
without that the start up logs a warning
thermal: socket bind failed, thermald may not be running.
because systemd prevents access to NETLINK.
---
misc/irqbalance.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/misc/irqbalance.service b/misc/irqbalance.service
index 0f79c3e..8544f66 100644
--- a/misc/irqbalance.service
+++ b/misc/irqbalance.service
@@ -11,7 +11,7 @@ EnvironmentFile=-/path/to/irqbalance.env
ExecStart=/usr/sbin/irqbalance --foreground $IRQBALANCE_ARGS
ReadOnlyPaths=/
ReadWritePaths=/proc/irq
-RestrictAddressFamilies=AF_UNIX
+RestrictAddressFamilies=AF_UNIX AF_NETLINK
RuntimeDirectory=irqbalance/
[Install]
--
2.33.1

View File

@ -0,0 +1,25 @@
From f2c8309a4198d8f51069a783905049c5b7eb7600 Mon Sep 17 00:00:00 2001
From: Neil Horman <nhorman@openssl.org>
Date: Mon, 1 Apr 2024 08:05:14 -0400
Subject: [PATCH 3/3] Drop ProtectKernelTunables
It makes /proc/irq read only
---
misc/irqbalance.service | 1 -
1 file changed, 1 deletion(-)
diff --git a/misc/irqbalance.service b/misc/irqbalance.service
index 87e19c1..b731cc6 100644
--- a/misc/irqbalance.service
+++ b/misc/irqbalance.service
@@ -23,7 +23,6 @@ PrivateNetwork=yes
PrivateUsers=true
ProtectHostname=yes
ProtectClock=yes
-ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectKernelLogs=yes
ProtectControlGroups=yes
--
2.40.1

View File

@ -1,33 +0,0 @@
From 178cf3b4311fab38b9731fc929feecf45b7cb2f0 Mon Sep 17 00:00:00 2001
From: "Chang S. Bae" <chang.seok.bae@intel.com>
Date: Fri, 18 Nov 2022 10:14:15 -0800
Subject: [PATCH 03/13] thermal: Fix the warning message
The commit febe697ac321 ("change the log level in thermal.c from error to
warning") happens to insert an unneeded message: "thermald may not be
running."
This is not true because the events come from the kernel and Netlink has
the multicast subscription model. So it has nothing to do with thermald.
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
---
thermal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thermal.c b/thermal.c
index 10e1083..7cd0807 100644
--- a/thermal.c
+++ b/thermal.c
@@ -99,7 +99,7 @@ static gboolean prepare_netlink(void)
rc = genl_connect(sock);
if (rc) {
- log(TO_ALL, LOG_INFO, "thermal: socket bind failed, thermald may not be running.\n");
+ log(TO_ALL, LOG_INFO, "thermal: socket bind failed.\n");
return TRUE;
}
--
2.33.1

View File

@ -1,74 +0,0 @@
From bbcd9a42c3cec0935b960b7f2046f1fdfab4f7ef Mon Sep 17 00:00:00 2001
From: Vignesh Raghavendra <vigneshr@ti.com>
Date: Wed, 7 Dec 2022 19:46:19 +0530
Subject: [PATCH 04/13] procinterrupts: Fix IRQ name parsing on certain arm64
SoC
On arm64 SoCs like TI's K3 SoC and few other SoCs, IRQ names don't get
parsed correct due to which they end up being classified into wrong
class. Fix this by considering last token to contain IRQ name always.
Eg.: /proc/interrupt
cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
11: 7155 8882 7235 7791 GICv3 30 Level arch_timer
14: 0 0 0 0 GICv3 23 Level arm-pmu
15: 0 0 0 0 GICv3 208 Level 4b00000.spi
16: 0 0 0 0 GICv3 209 Level 4b10000.spi
116: 0 0 0 0 MSI-INTA 1716234 Level 485c0100.dma-controller chan6
134: 166 0 0 0 MSI-INTA 1970707 Level 8000000.ethernet-tx0
224: 149 0 0 0 MSI-INTA 1971731 Level 8000000.ethernet
W/o patch irqbalance -d
IRQ (11) guessed as class 0
IRQ (14) guessed as class 0
IRQ (15) guessed as class 0
IRQ (16) guessed as class 0
IRQ 485c0100.dma-controller chan6(116) guessed as class 0
IRQ (134) guessed as class 0
IRQ (224) guessed as class 0
W/ this patch
IRQ arch_timer(11) guessed as class 0
IRQ arm-pmu(14) guessed as class 0
IRQ 4b00000.spi(15) guessed as class 0
IRQ 4b10000.spi(16) guessed as class 0
IRQ 485c0100.dma-controller chan6(116) guessed as class 0
IRQ 8000000.ethernet-tx0(134) guessed as class 5
IRQ 8000000.ethernet(224) guessed as class 5
IRQ 8000000.ethernet(257) guessed as class 5
IRQ -davinci_gpio wl18xx(362) guessed as class
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
procinterrupts.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/procinterrupts.c b/procinterrupts.c
index e91b203..ec7a52b 100644
--- a/procinterrupts.c
+++ b/procinterrupts.c
@@ -178,12 +178,14 @@ void init_irq_class_and_type(char *savedline, struct irq_info *info, int irq)
}
#ifdef AARCH64
- if (savedptr && strlen(savedptr) > 0) {
+ if (savedptr && strlen(savedptr) > 0)
snprintf(irq_fullname, PATH_MAX, "%s %s", last_token, savedptr);
- tmp = strchr(irq_fullname, '\n');
- if (tmp)
- *tmp = 0;
- }
+ else
+ snprintf(irq_fullname, PATH_MAX, "%s", last_token);
+
+ tmp = strchr(irq_fullname, '\n');
+ if (tmp)
+ *tmp = 0;
#else
snprintf(irq_fullname, PATH_MAX, "%s", last_token);
#endif
--
2.33.1

View File

@ -1,27 +0,0 @@
From ac4ba0667ba691985796f92e1a4b1932b03895a0 Mon Sep 17 00:00:00 2001
From: qyu <qinyu32@huawei.com>
Date: Fri, 20 Jan 2023 15:29:45 +0800
Subject: [PATCH 05/13] irqbalance: fix memory leak in irq hotplug path
tmp_info.name duplicate a name string in init_irq_class_and_type(),
free() it before return.
---
classify.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/classify.c b/classify.c
index 4ea4b44..dac813c 100644
--- a/classify.c
+++ b/classify.c
@@ -778,6 +778,8 @@ int proc_irq_hotplug(char *savedline, int irq, struct irq_info **pinfo)
/* secondly, init irq info by parse savedline */
init_irq_class_and_type(savedline, &tmp_info, irq);
add_new_irq(NULL, &tmp_info);
+ free(tmp_info.name);
+
*pinfo = get_irq_info(irq);
}
if (*pinfo == NULL) {
--
2.33.1

View File

@ -1,90 +0,0 @@
From f85c6c12d6fd9014d54cd0e3d791223723a29cdd Mon Sep 17 00:00:00 2001
From: Alexander Monakov <amonakov@ispras.ru>
Date: Sat, 21 Jan 2023 12:25:25 +0300
Subject: [PATCH 06/13] ui: do not force black background
Avoid repainting the entire terminal window with black background.
Instead, invoke 'use_default_colors' and use color index -1 to keep
user-configured background and foreground colors.
For pairs 1, 2, 3, 8, 9, 10, simply change background index to -1.
Keep pair 4, but enable the 'bold' attribute for text to improve
legibility. For pair 5 (white on red) use default foreground, and
instead of pair 6 (red on white) use reverse of pair 5 with bold.
This substantially improves legibility of the UI on a terminal
configured with a light background for me.
---
ui/ui.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/ui/ui.c b/ui/ui.c
index 897371b..bee6868 100644
--- a/ui/ui.c
+++ b/ui/ui.c
@@ -45,7 +45,7 @@ void show_footer()
while(strlen(footer) != (size_t)COLS - 1) {
snprintf(footer + strlen(footer), COLS - strlen(footer), " ");
}
- attrset(COLOR_PAIR(4));
+ attrset(COLOR_PAIR(4) | A_BOLD);
mvprintw(LINES - 1, 0, "%s", footer);
}
@@ -73,7 +73,7 @@ char * check_control_in_sleep_input(int max_len, int column_offest, int line_off
mvaddch(line_offset, column_offest + iteration, ' ');
}
move(line_offset, column_offest + iteration);
- attrset(COLOR_PAIR(6));
+ attrset(COLOR_PAIR(5) | A_REVERSE | A_BOLD);
break;
case 27:
free(input_to);
@@ -93,7 +93,7 @@ int get_valid_sleep_input(int column_offest)
while(1) {
attrset(COLOR_PAIR(5));
mvprintw(2, column_offest, " ");
- attrset(COLOR_PAIR(6));
+ attrset(COLOR_PAIR(5) | A_REVERSE | A_BOLD);
refresh();
move(2, column_offest);
curs_set(1);
@@ -115,7 +115,7 @@ int get_valid_sleep_input(int column_offest)
break;
} else {
new_sleep = setup.sleep;
- attrset(COLOR_PAIR(4));
+ attrset(COLOR_PAIR(4) | A_BOLD);
mvprintw(LINES - 2, 1,
"Invalid input: %s ",
input);
@@ -705,16 +705,17 @@ void init()
echo();
if(has_colors()) {
start_color();
- init_pair(1, COLOR_RED, COLOR_BLACK);
- init_pair(2, COLOR_YELLOW, COLOR_BLACK);
- init_pair(3, COLOR_GREEN, COLOR_BLACK);
+ use_default_colors();
+ init_pair(1, COLOR_RED, -1);
+ init_pair(2, COLOR_YELLOW, -1);
+ init_pair(3, COLOR_GREEN, -1);
init_pair(4, COLOR_WHITE, COLOR_BLUE);
- init_pair(5, COLOR_WHITE, COLOR_RED);
- init_pair(6, COLOR_RED, COLOR_WHITE);
- init_pair(7, COLOR_BLACK, COLOR_CYAN);
- init_pair(8, COLOR_BLUE, COLOR_BLACK);
- init_pair(9, COLOR_CYAN, COLOR_BLACK);
- init_pair(10, COLOR_MAGENTA, COLOR_BLACK);
+ init_pair(5, -1, COLOR_RED);
+ /* Pair 6 is unused */
+ /* Pair 7 is unused */
+ init_pair(8, COLOR_BLUE, -1);
+ init_pair(9, COLOR_CYAN, -1);
+ init_pair(10, COLOR_MAGENTA, -1);
}
offset = 0;
--
2.33.1

View File

@ -1,30 +0,0 @@
From c91bdf66e1156db0e8171a72a15b6d63148357e4 Mon Sep 17 00:00:00 2001
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date: Tue, 24 Jan 2023 11:47:44 -0800
Subject: [PATCH 07/13] thermal: Fix log message for perf and efficiency
In the log message perf and efficiency fields are swapped. So, showing
perf field as efficiency and vice versa. Fix this to show correct
log message.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
thermal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thermal.c b/thermal.c
index 7cd0807..a45568a 100644
--- a/thermal.c
+++ b/thermal.c
@@ -407,7 +407,7 @@ static int handle_thermal_event(struct nl_msg *msg, void *arg __attribute__((unu
need_to_ban = !!(!event_data[INDEX_PERF] && !event_data[INDEX_EFFI]);
update_banned_cpus(cur_cpuidx, need_to_ban);
- log(TO_ALL, LOG_DEBUG, "thermal: event - CPU %d, efficiency %d, perf %d.\n",
+ log(TO_ALL, LOG_DEBUG, "thermal: event - CPU %d, perf %d, efficiency %d.\n",
cur_cpuidx, event_data[INDEX_PERF], event_data[INDEX_EFFI]);
}
--
2.33.1

View File

@ -1,25 +0,0 @@
From f166b00e732033bf0b6ea86cedc2dcea7f6c35ba Mon Sep 17 00:00:00 2001
From: middlingphys <phys314159265358979chem@gmail.com>
Date: Thu, 2 Feb 2023 16:17:38 +0900
Subject: [PATCH 08/13] fix CPU number condition in service file
---
misc/irqbalance.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/misc/irqbalance.service b/misc/irqbalance.service
index 8544f66..a2d919c 100644
--- a/misc/irqbalance.service
+++ b/misc/irqbalance.service
@@ -3,7 +3,7 @@ Description=irqbalance daemon
Documentation=man:irqbalance(1)
Documentation=https://github.com/Irqbalance/irqbalance
ConditionVirtualization=!container
-ConditionCPUs=>1
+ConditionCPUs>1
[Service]
EnvironmentFile=-/usr/lib/irqbalance/defaults.env
--
2.33.1

View File

@ -1,35 +0,0 @@
From 0e9acb608588aaeb998bdf5f47019ce7a61cc81e Mon Sep 17 00:00:00 2001
From: Neil Horman <neil.horman@privafy.com>
Date: Thu, 9 Mar 2023 07:54:47 -0500
Subject: [PATCH 09/13] Issue 259: select NL_SKIP / NL_STOP based on error
the handle_error function for thermal should skip EINTR errors, but stop
for everything else
---
thermal.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/thermal.c b/thermal.c
index a45568a..035e0ad 100644
--- a/thermal.c
+++ b/thermal.c
@@ -190,12 +190,14 @@ static int handle_groupid(struct nl_msg *msg, void *arg)
static int handle_error(struct sockaddr_nl *sk_addr __attribute__((unused)),
struct nlmsgerr *err, void *arg)
{
- if (arg) {
+ int rc = (err->error == NLE_INTR) ? NL_SKIP : NL_STOP;
+
+ if (arg && err->error != NLE_INTR) {
log(TO_ALL, LOG_INFO, "thermal: received a netlink error (%s).\n",
nl_geterror(err->error));
*((int *)arg) = err->error;
}
- return NL_SKIP;
+ return rc;
}
static int handle_end(struct nl_msg *msg __attribute__((unused)), void *arg)
--
2.33.1

View File

@ -1,25 +0,0 @@
From ea1e9a7a9105c834302ce7c72e9b4b1c90ec7866 Mon Sep 17 00:00:00 2001
From: middlingphys <38708390+middlingphys@users.noreply.github.com>
Date: Wed, 15 Mar 2023 22:33:22 +0900
Subject: [PATCH 10/13] Revert "Fix CPU number condition in service file"
---
misc/irqbalance.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/misc/irqbalance.service b/misc/irqbalance.service
index a2d919c..8544f66 100644
--- a/misc/irqbalance.service
+++ b/misc/irqbalance.service
@@ -3,7 +3,7 @@ Description=irqbalance daemon
Documentation=man:irqbalance(1)
Documentation=https://github.com/Irqbalance/irqbalance
ConditionVirtualization=!container
-ConditionCPUs>1
+ConditionCPUs=>1
[Service]
EnvironmentFile=-/usr/lib/irqbalance/defaults.env
--
2.33.1

View File

@ -1,28 +0,0 @@
From 3920e0687deff04c52ac73ebdbd950c13ef1f77e Mon Sep 17 00:00:00 2001
From: Neil Horman <neil.horman@privafy.com>
Date: Wed, 22 Mar 2023 17:30:01 -0400
Subject: [PATCH 11/13] Fix signedness of error handling
---
thermal.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/thermal.c b/thermal.c
index 035e0ad..902d7e9 100644
--- a/thermal.c
+++ b/thermal.c
@@ -190,9 +190,9 @@ static int handle_groupid(struct nl_msg *msg, void *arg)
static int handle_error(struct sockaddr_nl *sk_addr __attribute__((unused)),
struct nlmsgerr *err, void *arg)
{
- int rc = (err->error == NLE_INTR) ? NL_SKIP : NL_STOP;
+ int rc = (err->error == -NLE_INTR) ? NL_SKIP : NL_STOP;
- if (arg && err->error != NLE_INTR) {
+ if (arg && err->error != -NLE_INTR) {
log(TO_ALL, LOG_INFO, "thermal: received a netlink error (%s).\n",
nl_geterror(err->error));
*((int *)arg) = err->error;
--
2.33.1

View File

@ -1,26 +0,0 @@
From 0e051271bbf1cd87802628f3167faafe7218606f Mon Sep 17 00:00:00 2001
From: Neil Horman <neil.horman@privafy.com>
Date: Sat, 1 Apr 2023 13:07:05 -0400
Subject: [PATCH 12/13] Fix it so we actually stop when we hit an interrupt
condition
---
thermal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/thermal.c b/thermal.c
index 902d7e9..ffff9bd 100644
--- a/thermal.c
+++ b/thermal.c
@@ -190,7 +190,7 @@ static int handle_groupid(struct nl_msg *msg, void *arg)
static int handle_error(struct sockaddr_nl *sk_addr __attribute__((unused)),
struct nlmsgerr *err, void *arg)
{
- int rc = (err->error == -NLE_INTR) ? NL_SKIP : NL_STOP;
+ int rc = (err->error == -NLE_INTR) ? NL_STOP : NL_SKIP;
if (arg && err->error != -NLE_INTR) {
log(TO_ALL, LOG_INFO, "thermal: received a netlink error (%s).\n",
--
2.33.1

View File

@ -1,37 +0,0 @@
From d02ec54e635da8da8439d35b0523ce2b5d5dbae1 Mon Sep 17 00:00:00 2001
From: psykose <alice@ayaya.dev>
Date: Wed, 19 Apr 2023 19:31:19 +0000
Subject: [PATCH 13/13] procinterrupts: fix initialisation of regex_t struct
{NULL} utilises the null pointer, but this is not valid, because null is a pointer:
procinterrupts.c:110:29: error: initialization of 'long unsigned int' from 'void *' makes integer from pointer without a cast [-Werror=int-conversion]
110 | { "eth.*" ,{NULL} ,NULL, IRQ_TYPE_LEGACY, IRQ_GBETH },
0-initialisation should be done with '0' instead of a pointer.
---
procinterrupts.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/procinterrupts.c b/procinterrupts.c
index ec7a52b..dfa95c6 100644
--- a/procinterrupts.c
+++ b/procinterrupts.c
@@ -107,10 +107,10 @@ static void guess_arm_irq_hints(char *name, struct irq_info *info)
static int compiled = 0;
/* Note: Last entry is a catchall */
static struct irq_match matches[] = {
- { "eth.*" ,{NULL} ,NULL, IRQ_TYPE_LEGACY, IRQ_GBETH },
- { "[A-Z0-9]{4}[0-9a-f]{4}", {NULL} ,check_platform_device, IRQ_TYPE_LEGACY, IRQ_OTHER},
- { "PNP[0-9a-f]{4}", {NULL} ,check_platform_device, IRQ_TYPE_LEGACY, IRQ_OTHER},
- { ".*", {NULL}, NULL, IRQ_TYPE_LEGACY, IRQ_OTHER},
+ { "eth.*" , {0},NULL, IRQ_TYPE_LEGACY, IRQ_GBETH },
+ { "[A-Z0-9]{4}[0-9a-f]{4}", {0}, check_platform_device, IRQ_TYPE_LEGACY, IRQ_OTHER},
+ { "PNP[0-9a-f]{4}", {0}, check_platform_device, IRQ_TYPE_LEGACY, IRQ_OTHER},
+ { ".*", {0}, NULL, IRQ_TYPE_LEGACY, IRQ_OTHER},
{NULL},
};
--
2.33.1

View File

@ -1,13 +0,0 @@
diff --git a/misc/irqbalance.service b/misc/irqbalance.service
index 0f79c3e..18c7e9b 100644
--- a/misc/irqbalance.service
+++ b/misc/irqbalance.service
@@ -7,7 +7,7 @@ ConditionCPUs=>1
[Service]
EnvironmentFile=-/usr/lib/irqbalance/defaults.env
-EnvironmentFile=-/path/to/irqbalance.env
+EnvironmentFile=-/etc/sysconfig/irqbalance
ExecStart=/usr/sbin/irqbalance --foreground $IRQBALANCE_ARGS
ReadOnlyPaths=/
ReadWritePaths=/proc/irq

View File

@ -0,0 +1,25 @@
From 9d3070150d151bfd5535c3da43313511659d882e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= <tim@siosm.fr>
Date: Mon, 1 Aug 2022 15:52:24 +0200
Subject: [PATCH] misc/irqbalance.service: Use sysconfig for EnvironmentFile
---
misc/irqbalance.service | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/misc/irqbalance.service b/misc/irqbalance.service
index 0f79c3e..9bc63b6 100644
--- a/misc/irqbalance.service
+++ b/misc/irqbalance.service
@@ -6,8 +6,7 @@ ConditionVirtualization=!container
ConditionCPUs=>1
[Service]
-EnvironmentFile=-/usr/lib/irqbalance/defaults.env
-EnvironmentFile=-/path/to/irqbalance.env
+EnvironmentFile=-/etc/sysconfig/irqbalance
ExecStart=/usr/sbin/irqbalance $IRQBALANCE_ARGS
CapabilityBoundingSet=
NoNewPrivileges=yes
--
2.37.1

View File

@ -1,28 +0,0 @@
# irqbalance is a daemon process that distributes interrupts across
# CPUS on SMP systems. The default is to rebalance once every 10
# seconds. This is the environment file that is specified to systemd via the
# EnvironmentFile key in the service unit file (or via whatever method the init
# system you're using has.
#
# ONESHOT=yes
# after starting, wait for a minute, then look at the interrupt
# load and balance it once; after balancing exit and do not change
# it again.
#IRQBALANCE_ONESHOT=
#
# IRQBALANCE_BANNED_CPUS
# 64 bit bitmask which allows you to indicate which cpu's should
# be skipped when reblancing irqs. Cpu numbers which have their
# corresponding bits set to one in this mask will not have any
# irq's assigned to them on rebalance
#
#IRQBALANCE_BANNED_CPUS=
#
# IRQBALANCE_ARGS
# append any args here to the irqbalance daemon as documented in the man page
#
#IRQBALANCE_ARGS=

View File

@ -1,77 +1,47 @@
Name: irqbalance Name: irqbalance
Version: 1.9.2 Version: 1.9.4
Release: 1%{?dist} Release: 1%{?dist}
Epoch: 2 Epoch: 2
Summary: IRQ balancing daemon Summary: IRQ balancing daemon
Group: System Environment/Base License: GPL-2.0-only
License: GPLv2
Url: https://github.com/Irqbalance/irqbalance Url: https://github.com/Irqbalance/irqbalance
Source0: https://github.com/Irqbalance/irqbalance/archive/irqbalance-%{version}.tar.gz Source0: https://github.com/Irqbalance/irqbalance/archive/irqbalance-%{version}.tar.gz
Source1: irqbalance.sysconfig
BuildRequires: autoconf automake libtool libcap-ng BuildRequires: autoconf automake libtool libcap-ng
BuildRequires: glib2-devel pkgconf libcap-ng-devel BuildRequires: glib2-devel pkgconf libcap-ng-devel
BuildRequires: systemd ncurses-devel BuildRequires: systemd ncurses-devel systemd-devel
BuildRequires: make
Requires: ncurses-libs Requires: ncurses-libs
%ifnarch %{arm} %ifnarch %{arm}
BuildRequires: numactl-devel BuildRequires: numactl-devel
Requires: numactl-libs Requires: numactl-libs
%endif %endif
%define _hardened_build 1
ExcludeArch: s390 s390x ExcludeArch: s390 s390x
Patch1: irqbalance-1.8.0-env-file-path.patch Patch1: irqbalance-1.9.0-environment-file-sysconfig.patch
Patch2: 0001-optimize-getting-cpu-number.patch Patch2: 0001-irqbalance-ui-check-if-using-a-negative-index-of-buf.patch
Patch3: 0002-allow-AF_NETLINK-in-the-systemd-service-restrictions.patch Patch3: 0002-Check-fflush-return-value.patch
Patch4: 0003-thermal-Fix-the-warning-message.patch Patch4: 0003-Drop-ProtectKernelTunables.patch
Patch5: 0004-procinterrupts-Fix-IRQ-name-parsing-on-certain-arm64.patch
Patch6: 0005-irqbalance-fix-memory-leak-in-irq-hotplug-path.patch
Patch7: 0006-ui-do-not-force-black-background.patch
Patch8: 0007-thermal-Fix-log-message-for-perf-and-efficiency.patch
Patch9: 0008-fix-CPU-number-condition-in-service-file.patch
Patch10: 0009-Issue-259-select-NL_SKIP-NL_STOP-based-on-error.patch
Patch11: 0010-Revert-Fix-CPU-number-condition-in-service-file.patch
Patch12: 0011-Fix-signedness-of-error-handling.patch
Patch13: 0012-Fix-it-so-we-actually-stop-when-we-hit-an-interrupt-.patch
Patch14: 0013-procinterrupts-fix-initialisation-of-regex_t-struct.patch
Patch15: 0001-revert-Confine-irqbalance-to-systems-where-it-is-useful.patch
%description %description
irqbalance is a daemon that evenly distributes IRQ load across irqbalance is a daemon that evenly distributes IRQ load across
multiple CPUs for enhanced performance. multiple CPUs for enhanced performance.
%prep %prep
%setup -q %autosetup -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%build %build
./autogen.sh ./autogen.sh
%configure %configure --with-systemd
CFLAGS="%{optflags}" make %{?_smp_mflags} %{make_build}
%install %install
install -D -p -m 0755 %{name} %{buildroot}%{_sbindir}/%{name} install -D -p -m 0755 %{name} %{buildroot}%{_sbindir}/%{name}
install -D -p -m 0755 %{name}-ui %{buildroot}%{_sbindir}/%{name}-ui install -D -p -m 0755 %{name}-ui %{buildroot}%{_sbindir}/%{name}-ui
install -D -p -m 0644 ./misc/irqbalance.service %{buildroot}/%{_unitdir}/irqbalance.service install -D -p -m 0644 ./misc/irqbalance.service %{buildroot}/%{_unitdir}/irqbalance.service
install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/%{name} install -D -p -m 0644 ./misc/irqbalance.env %{buildroot}%{_sysconfdir}/sysconfig/%{name}
install -d %{buildroot}%{_mandir}/man1/ install -d %{buildroot}%{_mandir}/man1/
install -p -m 0644 ./irqbalance.1 %{buildroot}%{_mandir}/man1/ install -p -m 0644 ./irqbalance.1 %{buildroot}%{_mandir}/man1/
@ -95,46 +65,84 @@ make check
%postun %postun
%systemd_postun_with_restart irqbalance.service %systemd_postun_with_restart irqbalance.service
%triggerun -- irqbalance < 2:0.56-3
if /sbin/chkconfig --level 3 irqbalance ; then
/bin/systemctl enable irqbalance.service >/dev/null 2>&1 || :
fi
/sbin/chkconfig --del irqbalance >/dev/null 2>&1 || :
%changelog %changelog
* Wed May 01 2024 Tao Liu <ltao@redhat.com> - 2:1.9.4-1
- Rebase to upstream commit (f2c8309a41)
* Fri Jul 28 2023 Tao Liu <ltao@redhat.com> - 2:1.9.2-3
- Use misc/irqbalance.env as irqbalance.sysconfig
- Use new rpm macros: autosetup and make_build
- Use irqbalance-1.9.0-environment-file
- Remove _hardened_build
- Remove triggerun -- irqbalance < 2:0.56-3
- Use SPDX licence
* Tue Jul 18 2023 Tao Liu <ltao@redhat.com> - 2:1.9.2-2
- Rebase to latest upstream commit (50699824c7)
* Thu May 18 2023 Tao Liu <ltao@redhat.com> - 2:1.9.2-1 * Thu May 18 2023 Tao Liu <ltao@redhat.com> - 2:1.9.2-1
- Rebase to latest upstream commit (184c95029e) - Rebase to latest upstream commit (184c95029e)
* Tue Jul 19 2022 Tao Liu <ltao@redhat.com> - 2:1.9.0-4
- revert Confine irqbalance to systems where it is useful (bz2115230)
* Tue Jul 19 2022 Tao Liu <ltao@redhat.com> - 2:1.9.0-3 * Tue Jul 19 2022 Tao Liu <ltao@redhat.com> - 2:1.9.0-3
- Rebase to latest upstream commit (c8d1fff0f1) - Rebase to latest upstream commit (c8d1fff0f1)
* Thu Jul 14 2022 Tao Liu <ltao@redhat.com> - 2:1.9.0-2 * Thu Jul 14 2022 Tao Liu <ltao@redhat.com> - 2:1.9.0-2
- Rebase to latest upstream commit (167580790c) - Rebase to latest upstream commit (167580790c)
* Fri Jul 1 2022 Tao Liu <ltao@redhat.com> - 2:1.9.0-1 * Mon Jun 20 2022 Tao Liu <ltao@redhat.com> - 2:1.9.0-1
- Rebase to latest upstream release v1.9.0. Resolves:rhbz2098629 - Rebase to latest upstream release v1.9.0. Resolves:rhbz2097871
* Fri Jan 29 2021 Kairui Song <kasong@redhat.com> 2:1.4.0-6 * Fri Apr 8 2022 Tao Liu <ltao@redhat.com> - 2:1.8.0-5
- Also fetch node info for non-PCI devices - Document migrateval. Resolves: rhbz2071959
- Confine irqbalance to systems where it is useful. Resolves: rhbz2063930
- Wrong EnvironmentFile in irqbalance.service. Resolves: rhbz2058509
* Wed Nov 04 2020 Kairui Song <kasong@redhat.com> 2:1.4.0-5 * Mon Sep 27 2021 Kairui Song <kasong@redhat.com> - 2:1.8.0-4
- Add some examples for IRQBALANCE_BANNED_CPUS (bz1730546) - Drop CapabilityBoundingSet from irqbalance service. Resolves: rhbz1963152
* Wed Jul 31 2019 Kairui Song <kasong@redhat.com> 2:1.4.0-4 * Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2:1.8.0-3
- Fix ambiguous parsing of *node* entries in /sys. (bz1730546) - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Mon Mar 25 2019 Kairui Song <kasong@redhat.com> 2:1.4.0-3 * Fri Aug 06 2021 Kairui Song <kasong@redhat.com> - 2:1.8.0-2
- Update document and remove dead options to fix manpage scan warning (bz1612706) - Disable the communication socket when UI is disabled. Resolves: rhbz1951292
- Fix gating test error (bz1680619) - drop NoNewPrivs from irqbalance service. Resolves: rhbz1963152
* Tue Nov 6 2018 Kairui Song <kasong@redhat.com> 2:1.4.0-2 * Fri Jul 30 2021 Kairui Song <kasong@redhat.com> - 2:1.8.0-1
- Fix several memleak problems found by covscan (bz1606969) - Rebase to latest upstream release
- Fix an possible overflow error (bz1606969)
- Don't leak socket fd on connection error (bz1606969) * Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2:1.7.0-6
- Check xen-dyn-event more flexible (bz1576164) - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2:1.7.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Aug 05 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 2:1.7.0-4
- Epoch never can go backwards
* Tue Aug 04 2020 Neil Horman <nhorman@redhat.com> - 2:1.7.0-1
- Update to latest upstream (bz 1866002)
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2:1.6.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jun 04 2020 Adam Williamson <awilliam@redhat.com> - 2:1.6.0-2
- Restore environment file patch and fix service start (thanks Ondřej Lysoněk)
* Wed Jun 03 2020 Neil Horman <nhorman@redhat.com> - 2:1.6.0-1
- Update to latest upstream (bz1712908)
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2:1.4.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2:1.4.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2:1.4.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2:1.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon May 14 2018 Neil Horman <nhorman@redhat.com> 2:1.4.0-1 * Mon May 14 2018 Neil Horman <nhorman@redhat.com> 2:1.4.0-1
- Update to latest upstream release - Update to latest upstream release