!114 [sync] PR-109: backport community patches
From: @openeuler-sync-bot Reviewed-by: @SuperSix173 Signed-off-by: @SuperSix173
This commit is contained in:
commit
9c3b8b9b96
44
backport-Check-fflush-return-value.patch
Normal file
44
backport-Check-fflush-return-value.patch
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
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] 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")
|
||||||
|
|
||||||
|
Reference:https://github.com/Irqbalance/irqbalance/commit/8301666f3029ff4d9089a273a45ec47671d964c1
|
||||||
|
Conflict:NA
|
||||||
|
---
|
||||||
|
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.28.0.windows.1
|
||||||
|
|
||||||
56
backport-Fix-socket-API-being-blocked-for-10s.patch
Normal file
56
backport-Fix-socket-API-being-blocked-for-10s.patch
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
From de0fe4a799c0bd62afcaf11b0ff5fc85f0b24c3e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Etienne Champetier <e.champetier@ateme.com>
|
||||||
|
Date: Wed, 13 Mar 2024 15:28:37 -0400
|
||||||
|
Subject: [PATCH] Fix socket API being blocked for 10s
|
||||||
|
|
||||||
|
Instead of sleeping in scan() and blocking the main loop,
|
||||||
|
return and let the main loop call back scan().
|
||||||
|
|
||||||
|
Signed-off-by: Etienne Champetier <e.champetier@ateme.com>
|
||||||
|
|
||||||
|
Reference:https://github.com/Irqbalance/irqbalance/commit/de0fe4a799c0bd62afcaf11b0ff5fc85f0b24c3e
|
||||||
|
Conflict:The pre-dependency patch is not incorporated(4342acd8d7862e862e0b6611
|
||||||
|
35b10671ffeac119), adapt the patch context.
|
||||||
|
---
|
||||||
|
irqbalance.c | 18 +-----------------
|
||||||
|
1 file changed, 1 insertion(+), 17 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/irqbalance.c b/irqbalance.c
|
||||||
|
index f5f2c51..12302d7 100644
|
||||||
|
--- a/irqbalance.c
|
||||||
|
+++ b/irqbalance.c
|
||||||
|
@@ -70,20 +70,6 @@ char *cpu_ban_string = NULL;
|
||||||
|
char *banned_cpumask_from_ui = NULL;
|
||||||
|
unsigned long migrate_ratio = 0;
|
||||||
|
|
||||||
|
-static void sleep_approx(int seconds)
|
||||||
|
-{
|
||||||
|
- struct timespec ts;
|
||||||
|
- struct timeval tv;
|
||||||
|
- gettimeofday(&tv, NULL);
|
||||||
|
- ts.tv_sec = seconds;
|
||||||
|
- ts.tv_nsec = -tv.tv_usec*1000;
|
||||||
|
- while (ts.tv_nsec < 0) {
|
||||||
|
- ts.tv_sec--;
|
||||||
|
- ts.tv_nsec += 1000000000;
|
||||||
|
- }
|
||||||
|
- nanosleep(&ts, NULL);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
#ifdef HAVE_GETOPT_LONG
|
||||||
|
struct option lopts[] = {
|
||||||
|
{"oneshot", 0, NULL, 'o'},
|
||||||
|
@@ -317,9 +303,7 @@ gboolean scan(gpointer data __attribute__((unused)))
|
||||||
|
for_each_irq(NULL, force_rebalance_irq, NULL);
|
||||||
|
parse_proc_interrupts();
|
||||||
|
parse_proc_stat();
|
||||||
|
- sleep_approx(sleep_interval);
|
||||||
|
- clear_work_stats();
|
||||||
|
- parse_proc_interrupts();
|
||||||
|
+ return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
parse_proc_stat();
|
||||||
|
--
|
||||||
|
2.28.0.windows.1
|
||||||
|
|
||||||
31
backport-Flush-file-before-closing.patch
Normal file
31
backport-Flush-file-before-closing.patch
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
From 8d7c78304fb994a519e2709024b196841e84238a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Robert Malz <robert.malz@canonical.com>
|
||||||
|
Date: Thu, 14 Mar 2024 13:36:15 +0100
|
||||||
|
Subject: [PATCH] Flush file before closing
|
||||||
|
|
||||||
|
After writing to file, before closing, flush is required.
|
||||||
|
Without it fclose can randomly return IO error.
|
||||||
|
|
||||||
|
Signed-off-by: Robert Malz <robert.malz@canonical.com>
|
||||||
|
|
||||||
|
Reference:https://github.com/Irqbalance/irqbalance/commit/8d7c78304fb994a519e2709024b196841e84238a
|
||||||
|
Conflict:NA
|
||||||
|
---
|
||||||
|
activate.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/activate.c b/activate.c
|
||||||
|
index d3f99f7..e30d0f0 100644
|
||||||
|
--- a/activate.c
|
||||||
|
+++ b/activate.c
|
||||||
|
@@ -82,6 +82,7 @@ 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 (fclose(file)) {
|
||||||
|
errsave = errno;
|
||||||
|
goto error;
|
||||||
|
--
|
||||||
|
2.28.0.windows.1
|
||||||
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
Summary: A dynamic adaptive IRQ balancing daemon
|
Summary: A dynamic adaptive IRQ balancing daemon
|
||||||
Name: irqbalance
|
Name: irqbalance
|
||||||
Version: 1.8.0
|
Version: 1.8.0
|
||||||
Release: 12
|
Release: 13
|
||||||
Epoch: 3
|
Epoch: 3
|
||||||
License: GPLv2
|
License: GPLv2
|
||||||
Source0: https://github.com/Irqbalance/irqbalance/archive/v%{version}.tar.gz#/irqbalance-%{version}.tar.gz
|
Source0: https://github.com/Irqbalance/irqbalance/archive/v%{version}.tar.gz#/irqbalance-%{version}.tar.gz
|
||||||
@ -39,6 +39,9 @@ Patch6014: backport-filter-console-only-output-when-using-journal-mode.patch
|
|||||||
Patch6015: backport-Slience-.-rebalancing-messages-for-unmigratable-IRQs.patch
|
Patch6015: backport-Slience-.-rebalancing-messages-for-unmigratable-IRQs.patch
|
||||||
Patch6016: backport-Avoid-repeated-affinity-checks-when-no-change-is-nec.patch
|
Patch6016: backport-Avoid-repeated-affinity-checks-when-no-change-is-nec.patch
|
||||||
Patch6017: backport-activate_mapping-set-errsave-before-first-jump-to-th.patch
|
Patch6017: backport-activate_mapping-set-errsave-before-first-jump-to-th.patch
|
||||||
|
Patch6018: backport-Fix-socket-API-being-blocked-for-10s.patch
|
||||||
|
Patch6019: backport-Flush-file-before-closing.patch
|
||||||
|
Patch6020: backport-Check-fflush-return-value.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Irqbalance is a daemon to help balance the cpu load generated by
|
Irqbalance is a daemon to help balance the cpu load generated by
|
||||||
@ -96,6 +99,14 @@ fi
|
|||||||
/sbin/chkconfig --del %{name} >/dev/null 2>&1 || :
|
/sbin/chkconfig --del %{name} >/dev/null 2>&1 || :
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue May 07 2024 langfei <langfei@huawei.com> - 3:1.8.0-13
|
||||||
|
- Type:bugfix
|
||||||
|
- ID:NA
|
||||||
|
- SUG:restart
|
||||||
|
- DESC: Fix socket API being blocked for 10s;
|
||||||
|
- Flush file brfore closing;
|
||||||
|
- Check fflush() return value.
|
||||||
|
|
||||||
* Tue Feb 20 2024 langfei <langfei@huawei.com> - 3:1.8.0-12
|
* Tue Feb 20 2024 langfei <langfei@huawei.com> - 3:1.8.0-12
|
||||||
- Type:bugfix
|
- Type:bugfix
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user