Commit Graph

613 Commits (packing-test)

Author SHA1 Message Date
Peter Cai 72e86f5ef6 [DNM] Add log for packing 2022-09-19 17:09:14 -04:00
Peter Cai cbdb399e6d [DNM] irqlist: initial implementation for migration condition for
packing
2022-09-16 20:59:13 -04:00
Peter Cai 7218ded6d7 [DNM] placement: ignore banned NUMA nodes 2022-09-16 17:10:27 -04:00
Peter Cai c6d270495c [DNM] cputree: correct conversion to nanoseconds 2022-09-16 17:04:28 -04:00
Peter Cai 69d0a87e2f [DNM] cputree: add max_load to debug output 2022-09-16 14:50:50 -04:00
Peter Cai db3506f4dd [DNM] Implement packing for all balancing levels 2022-09-15 18:52:51 -04:00
Peter Cai 5fbe9a94eb [DNM] Force packing as a test 2022-09-13 13:04:18 -04:00
Peter Cai 911bd62cc2 [DMN] placement: packing policy 2022-09-13 12:39:49 -04:00
liuchao173 e16b05ce9e
Merge pull request #226 from liuchao173/master
irqbalance-ui: display irq name in SETUP IRQS
2022-07-26 21:55:40 +08:00
Liu Chao 402ca1b7a0 irqbalance-ui: display irq name in SETUP IRQS
get irq name from /proc/interrupts

Signed-off-by: Liu Chao <liuchao173@huawei.com>
2022-07-25 19:08:56 +08:00
Neil Horman d88585832b
Merge pull request #230 from liuchao173/patch-1
irqbalance: check the length of optarg
2022-07-19 08:20:08 -04:00
Liu Chao d48eaf61c2 irqbalance: use endptr to check whether the input parameter is empty
Signed-off-by: Liu Chao <liuchao173@huawei.com>
2022-07-19 10:28:01 +08:00
Neil Horman 5cabefe575
Merge pull request #229 from liuchao173/patch-2
irqbalance-ui: skip ',' in parse_setup to avoid coredump
2022-07-18 08:17:55 -04:00
Liu Chao c8d1fff0f1 irqbalance-ui: skip ',' in parse_setup to avoid coredump
When processing the ',' in hex_to_bitmap, it returns '0000\ 0' directly.
The return value will be freed in parse_setup, but it is not requested
through malloc.

Fixes: 85d37098a5 ("Fix several memleak problems found by covscan")

And it treat ',' as "0000", which cause irqbalance-ui will display wrong
Banned CPU numbers.

For example:
# IRQBALANCE_BANNED_CPUS="00000002,00000000,00000000" ./irqbalance
or
# IRQBALANCE_BANNED_CPULIST="65" ./irqbalance

# ./irqbalance-ui
Banned CPU numbers: 73

Fixes: 76d1c9d739 ("Add main user interface files")

Signed-off-by: Liu Chao <liuchao173@huawei.com>
2022-07-18 17:17:54 +08:00
Neil Horman 56a9a0ffbc
Merge pull request #212 from Irqbalance/static
Enable static building of irqbalance
2022-07-15 09:24:24 -04:00
Neil Horman 167580790c
Merge pull request #225 from liutgnu/dev
Improve documentation and logging for banned cpus
2022-07-13 08:44:11 -04:00
Tao Liu cfb15f0bb9 Improve documentation and logging for banned cpus
This patch have no functional modification. Just improve the doc and log
for isolcpu, nohz_full and numa node banning cpus, for providing more
info for users.

Signed-off-by: Tao Liu <ltao@redhat.com>
2022-07-13 17:43:27 +08:00
liuchao173 ede4f4aabd
Merge pull request #223 from liuchao173/master
irqbalance-ui: print cpulist in SETUP IRQS
2022-07-13 15:14:39 +08:00
Liu Chao 577796abe7 irqbalance-ui: print cpulist in SETUP IRQS
save space for printing interrupt names

Signed-off-by: Liu Chao <liuchao173@huawei.com>
2022-07-11 16:13:15 +08:00
liuchao173 d558be31ab
Merge pull request #222 from liuchao173/master
irqbalance-ui: support scroll under tui mode of irqbalance-ui
2022-07-05 09:06:33 +08:00
Liu Chao db7dc03388 irqbalance-ui: support scroll under tui mode of irqbalance-ui
support using Up, Down, PageUp, PageDown to scroll in view mode
support using Up and Down in edit mode

Signed-off-by: Liu Chao <liuchao173@huawei.com>
2022-07-04 19:10:14 +08:00
liuchao173 c1cbd89fa4
Merge pull request #221 from liuchao173/master
fix memory leak in ui/ui.c
2022-06-30 22:34:54 +08:00
Liu Chao a61b382805 fix memory leak in ui/ui.c
Signed-off-by: Liu Chao <liuchao173@huawei.com>
2022-06-30 22:25:24 +08:00
liuchao173 06aa516aa2
Merge pull request #220 from liuchao173/master
irqbalance-ui: can't change window when in editing state
2022-06-30 21:36:22 +08:00
Liu Chao b65faa2b65 irqbalance-ui: can't change window when in editing state
when invoking setup_irqs in settings or invoking settings in setup_irqs, it
doesn't break but enters another while loop.
For example:
 # gdb program `pidof irqbalance-ui`
 (gdb) bt
 #0  0x0000ffffb0dcc7b0 in poll () from /usr/lib64/libc.so.6
 #1  0x0000ffffb0e9097c in _nc_timed_wait () from /usr/lib64/libtinfo.so.6
 #2  0x0000ffffb0ecc154 in _nc_wgetch () from /usr/lib64/libncursesw.so.6
 #3  0x0000ffffb0eccb18 in wgetch () from /usr/lib64/libncursesw.so.6
 #4  0x00000000004045d4 in setup_irqs () at ui/ui.c:637
 #5  0x0000000000404084 in settings () at ui/ui.c:614
 #6  0x0000000000404084 in settings () at ui/ui.c:614
 #7  0x0000000000404084 in settings () at ui/ui.c:614
 #8  0x0000000000404084 in settings () at ui/ui.c:614
 #9  0x0000000000404084 in settings () at ui/ui.c:614
 #10 0x0000000000404084 in settings () at ui/ui.c:614
 #11 0x0000000000404084 in settings () at ui/ui.c:614
 #12 0x0000000000401fac in key_loop (data=<optimized out>) at ui/irqbalance-ui.c:387
 #13 0x0000ffffb105371c in ?? () from /usr/lib64/libglib-2.0.so.0
 #14 0x0000ffffb1052a84 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
 #15 0x0000ffffb1052e38 in ?? () from /usr/lib64/libglib-2.0.so.0
 #16 0x0000ffffb1053188 in g_main_loop_run () from /usr/lib64/libglib-2.0.so.0
 #17 0x000000000040196c in main (argc=<optimized out>, argv=<optimized out>) at ui/irqbalance-ui.c:445

Signed-off-by: Liu Chao <liuchao173@huawei.com>
2022-06-30 10:42:37 +08:00
Neil Horman 461e666736
Merge pull request #219 from liuchao173/master
irqbalance-ui: move 'ASSIGNED TO CPUS' to the last column
2022-06-28 09:26:24 -04:00
Liu Chao 7f1caca47a irqbalance-ui: move 'ASSIGNED TO CPUS' to the last column
Signed-off-by: Liu Chao <liuchao173@huawei.com>
2022-06-28 16:42:10 +08:00
Neil Horman 6628273b31
Merge pull request #216 from andreas-schwab/master
parse_proc_interrupts: fix parsing interrupt counts
2022-06-27 08:44:27 -04:00
Andreas Schwab 0a82dddbaf parse_proc_interrupts: fix parsing interrupt counts
The name of an interrupt chip can start with a number, stop before it.
2022-06-27 13:55:28 +02:00
Neil Horman 6c9c7f2093
Merge pull request #215 from liuchao173/master
add keep_going check to prevent irqbalance from failing to exit after SIGTERM
2022-06-25 11:38:04 -04:00
Liu Chao 028082a6a1 add keep_going check to prevent irqbalance from failing to exit after SIGTERM
Signed-off-by: Liu Chao <liuchao173@huawei.com>
2022-06-25 14:21:28 +08:00
Neil Horman 1db42b1912
Merge pull request #206 from ChangSeokBae/irqbalance
Support thermal events
2022-06-16 09:46:34 -04:00
Chang S. Bae 560291389e Handle thermal events to mask CPUs
The Hardware Feedback Interface event is delivered as the Netlink's
THERMAL_GENL_ATTR_CPU_CAPABILITY attribute. Add code to receive and parse
these attributes: logical CPU number, performance, and efficiency
enumeration values (0-1023).

When an event indicates CPU performance and efficiency are zeros, then the
CPU needs to be banned from IRQs. Rebuild object tree to make this banned
list effective.

Creating the banned CPU list here is a bit tricky here because the amount
of data that each Netlink notification can carry out is not enough in some
systems with many cores. This means the handler has to wait for multiple
notifications to determine banned CPUs per thermal event.

Establish a logic to maintain the list based on the kernel behaviors. Also,
always push the current list as of the banned CPUs, because there is no
clear line whether each notification is at the end of a thermal event or
not.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
2022-06-15 14:52:25 -07:00
Chang S. Bae c65cda1836 Implement Netlink helper functions to subscribe thermal events
Establish Netlink socket connection in a nonblocking mode and callback
notification.

Tolerate a few times on failures from receiving events. In practice, such
delivery failure is rare. But it may indicate more fundamental issues if
it repeats. So disconnect it unless the failure is transient.

Event-specific handler will be implemented in the next patch.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
2022-06-15 14:52:20 -07:00
Chang S. Bae b66647ab75 Prepare to handle thermal event
Intel's new hardware supports Hardware Feedback Interface to provide CPU
performance and energy efficiency information. Every update on this is
delivered via thermal event interrupt. The thermal framework in the Linux
kernel relays these notifications to userspace via a Netlink interface.

When a CPU's performance and efficiency are zero, irqbalance needs to mask
the CPU from interrupts. Introduce a new CPU mask to indicate banned CPUs
for this.

Before supporting this event handling, define functions. Their
implementation will be on the following patches.

This event is available only on x86-64 systems. And it can be subscribed
with help of Netlink libraries. So check them before building it.

Also add a new build option so users may opt out this support. Setting this
option on other systems will result in a build failure.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
2022-06-15 14:52:13 -07:00
Neil Horman b5ab324491
Merge pull request #211 from neheb/meson
add meson
2022-06-15 17:07:14 -04:00
Rosen Penev 378d4707c2 add meson
Simpler build system. Placing in contrib for now.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-06-15 14:01:48 -07:00
Neil Horman bd67801a53 Enable static building of irqbalance
openwrt would find it useful to have a statically linked version of
irqbalance for better link-time optimization.
2022-06-13 09:27:25 -04:00
Neil Horman 84a517eae8
Merge pull request #210 from liuchao173/master
check whether savedptr is NULL before invoking strlen
2022-06-08 08:36:01 -04:00
Chao Liu 522883505d check whether savedptr is NULL before invoking strlen
savedptr can be null in musl libc, so the strlen(NULL) will segfault

Signed-off-by: Chao Liu <liuchao173@huawei.com>
2022-06-08 10:08:08 +08:00
Neil Horman 4afec6e4f8
Merge pull request #208 from liuchao173/master
get irq->module relationship from /sys/bus/pci/*/driver
2022-06-07 09:06:46 -04:00
Chao Liu ff48ac9c84 get irq->module relationship from /sys/bus/pci/*/driver
Signed-off-by: Chao Liu <liuchao173@huawei.com>
2022-06-07 20:48:55 +08:00
Neil Horman 80d5fbb947 updating to version 1.0.9 2022-05-27 12:13:14 -04:00
Chang S. Bae df3436b966 Add the cpus_copy() helper
This helper is useful when updating a global mask with a local value. The
upcoming thermal-event handler Handling thermal events has the case.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
2022-05-17 11:44:57 -07:00
Neil Horman ac7869cba3
Merge pull request #205 from liuchao173/patch-2
correct wait time in oneshot mode
2022-04-21 08:02:48 -04:00
liuchao173 61a9423583
correct wait time in oneshot mode 2022-04-21 16:44:19 +08:00
Neil Horman 917b10268c Document migrateval 2022-04-07 08:26:15 -04:00
Neil Horman 0d47c11156
Merge pull request #201 from jcpunk/cpu-confine
Confine irqbalance to systems where it is useful.
2022-04-05 12:04:47 -04:00
Pat Riehecky 188f9efc56 Confine irqbalance to systems where it is useful.
Systems with only one CPU cannot benefit from this service, so
don't start it when it isn't worth the resource consumption.
2022-04-04 08:38:32 -05:00
Neil Horman b3adb5fd14
Merge pull request #198 from Irqbalance/unix_trunc
Ensure that we get all of a unix message
2022-01-26 09:50:40 -05:00