812225 Commits

Author SHA1 Message Date
Laxminath Kasam
3603a8088b ASoC: msm-pcm-q6-v2: Update memset for period size
tinycap test can attempt with different size to
read from driver and need to avoid access more
than period size.

Change-Id: Ifa4ddfb086bd83aa981da62e88da3a9395f5aabc
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:57:17 -03:00
Laxminath Kasam
bd5e12849c ASoC: msm-pcm-q6-v2: Reset the buffer if size is partial or zero
Sometimes during device switch in recording,
observe size 0 is return from DSP due to EOS
handling. For ALSA pcm_read to unblock, buffer
appl_ptr is elapsed without actually updating
the buffer. And userspace copies the stale
data(old buffer) causing issue sometimes.
Reset the buffer for that period_size in
such cases instead of transfer stale data.

Change-Id: I0d3ac133a8d95fad0710586e3e947410a41c9c5a
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:57:11 -03:00
Soumya Managoli
a1345bf0fd ASoC: msm-pcm-host-voice-v2: Address buffer overflow in hpcm copy
Add check for the max hpcm_buf_node size before copy to avoid
buffer out of bounds issue.

Change-Id: Id647888430ce302359a857ef54d321bee99889bf
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:57:03 -03:00
Shalini Manjunatha
161a471b31 dsp: q6afe: Check for param size before copying
Check for the proper param size before copying,
to avoid buffer overflow.

Change-Id: Ic7fa9b3dd047d8eeba3cea02b99d6bc5b9df8daf
Signed-off-by: Shalini Manjunatha <quic_c_shalma@quicinc.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:56:52 -03:00
Karthikeyan Mani
bd3214aa83 dsp: q6afe: Check for payload size before payload access
Check if payload data is big enough before accessing
the data in it.

Change-Id: I939f205a8cebf6ef4859f81fae5429bca013d540
Signed-off-by: Karthikeyan Mani <kmani@codeaurora.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:56:39 -03:00
siimsek
d05adcaac1 ASoC: wcd_cpe_services: Fix enum-conversion warnings
techpack/audio/asoc/codecs/wcd_cpe_services.c:658:17: error: implicit
conversion from enumeration type 'enum cpe_svc_result' to different
enumeration type 'enum cmi_api_result' [-Werror,-Wenum-conversion]
        notif.result = result;
                     ~ ^~~~~~
techpack/audio/asoc/codecs/wcd_cpe_services.c:1350:8: error: implicit
conversion from enumeration type 'enum cpe_svc_result' to different
enumeration type 'enum cpe_process_result' [-Werror,-Wenum-conversion]
                rc = cpe_send_msg_to_inbox(t_info, 0, m);
                   ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 errors generated.

Change-Id: Ib9fce60017066e9c96e79195d7dba9ffb9177148
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:56:30 -03:00
Soumya Managoli
4f44375c05 dsp: q6adm: Resolve mem corruption in adm cb
Conversion of negative "num_modules" var value
will result in max possible unsigned int value
and hence can cause mem corruption when accessed.

Resolve this by assigning the same data type
to "num_modules" var as used in the calling fn.

Change-Id: I4c9d7215b9c7345637e1eb3a1992a41fef71c5cb
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:56:01 -03:00
Soumya Managoli
fbd9928150 ASoC: msm-pcm-q6-v2: Add dsp buf check
Current logic copies user buf size of data
from the avail dsp buf at a given offset.
If this offset returned from DSP in READ_DONE event
goes out of bounds or is corrupted, then it can lead to
out of bounds DSP buffer access, resulting in memory fault.
Fix is to add check for this buf offset, if it is within
the buf size range.

Change-Id: I7753cc6db394704dbb959477150141d42b836bef
Signed-off-by: Soumya Managoli <quic_c_smanag@quicinc.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:55:56 -03:00
Arian
b395d9793d ASoC: wcd_cpe_core: Fix snprintf size
techpack/audio/asoc/codecs/wcd_cpe_core.c:1981:2: error: 'snprintf' size argument is too large; destination buffer has size 11, but size argument is 13 [-Werror,-Wfortify-source]
        snprintf(proc_name, (sizeof("cpe") + sizeof("_state") +
        ^
1 error generated.

Change-Id: I976c005263f44d7a97f1496304acf28df30232a1
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:55:50 -03:00
Soumya Managoli
34dedb32a5 ASoC: msm-pcm-routing-v2: Fix overflow error in routing driver
The reg in soc_dapm_mux is 32-bit. The BE DAI ID passed
as shift(to be operated on the reg) may be more than 31,
which may cause overflow.
Set reg field to SND_SOC_NOPM to avoid any DAPM operation
while passing BE IDs in shift_l field and hence avoid overflow.

Change-Id: Ibbbca04c61b7c56eb4c5a7485a4e93dc28a09709
Signed-off-by: Soumya Managoli <smanag@codeaurora.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:55:40 -03:00
Sultan Alsawaf
f920e63f4c ASoC: msm-pcm-routing-v2: Fix non-blocking if-statement warning
Change-Id: Ia33743c8770dbb3cffe52aa1b57faa3267f37d8f
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:55:34 -03:00
Sheenam Monga
005f04c3e7 qcacmn: Fix potential OOB read in util_scan_parse_rnr_ie
Currently, while parsing scan RNR Ie data is moved to
next neighbor_ap_info_field after parsing the current
neighbor_ap_info_field. But in last iteration pointer may
try to access invalid data if (uint8_t *)ie + rnr_ie_len + 2)
bytes are less than sizeof neighbor_ap_info_field and same
is the case with tbtt_length access.

Fix is to add a length check of data + next data size to be parsed
< (uint8_t *)ie + rnr_ie_len + 2) instead of adding a validation
of data length only.

CRs-Fixed: 3710080
Change-Id: I05e5a9a02f0f4f9bc468db894588e676f0a248c0
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:55:29 -03:00
Tashfin Shakeer Rhythm
cb2aa5d672 qcacmn: Add void keyword to old-style zero prototype functions
Newer clang builds complain about old-style function declarations
not having any prototype assigned. The missing `void` is triggering
the Wstrict-prototype warns. Explicitly add the `void` keyword to
satisfy the compiler.

This fixes the following warnings:

drivers/staging/qca-wifi-host-cmn/hif/src/ce/ce_service_legacy.c:
1288:34: error: a function declaration without a prototype is
deprecated in all versions of C [-Werror,-Wstrict-prototypes]
struct ce_ops *ce_services_legacy()
                                 ^
                                  void
drivers/staging/qca-wifi-host-cmn/hif/src/ce/ce_service_srng.c:1017:32:
error: a function declaration without a prototype is deprecated in all
versions of C [-Werror,-Wstrict-prototypes]
struct ce_ops *ce_services_srng()
                               ^
                                void
drivers/staging/qca-wifi-host-cmn/target_if/core/src/target_if_main.c:
88:40: error: a function declaration without a prototype is
deprecated in all versions of C [-Werror,-Wstrict-prototypes]
struct target_if_ctx *target_if_get_ctx()
                                       ^
                                        void
drivers/staging/qca-wifi-host-cmn/umac/scan/dispatcher/src/wlan_extscan_api.c:
103:27: error: a function declaration without a prototype is
deprecated in all versions of C [-Werror,-Wstrict-prototypes]
wlan_extscan_global_deinit()
                          ^
                           void

Change-Id: Ifd95b57d19a25f0932e5de8ec4de2f2c1e7e1259
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:55:22 -03:00
Park Ju Hyung
661dfe40c0 qcacld-3.0: Defer HDD initialization
* ALso rely on userspace writing to /dev/wlan, Wi-Fi
   HAL writes "ON" or "OFF" to /dev/wlan.

 * Use this method to initialize hdd as it's a safer
   way to ensure both wlan_mac.bin and WCNSS_qcom_cfg.ini
   are ready to be read.

 * This also eliminates the needs for horrible hacks
   to read the userspace file.

Change-Id: I648f1a107c095e50a64f44c39e78d6b6f917e190
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:55:20 -03:00
Sebastiano Barezzi
e065149015 qcacld-3.0: Fix build with !WLAN_POWER_DEBUG
Change-Id: I8ddccc255eeee4ff4695f7e87e2b32b95e449e4c
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:55:18 -03:00
Park Ju Hyung
095f20c0b5 qcacld-3.0: Tone down debugging
Change-Id: I8a11d82dea71466394079bb927f506203576707c
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:55:16 -03:00
Alexander Koskovich
388cbda3a4 qcacld-3.0: Only call hdd_debugfs_process_mib_stats if debugfs is enabled
Change-Id: I081bf59ec6ef593eedd5044aaa2e13a6a1a0f87d
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:55:14 -03:00
Park Ju Hyung
b96dd8b489 qcacld-3.0: Initialize variables to avoid errors during compilation
Change-Id: I666d6904db4d94904415155707d2894dd676fbde
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:55:13 -03:00
Park Ju Hyung
c0dd48acea qcacld-3.0: Do not manually re-enable -Wmaybe-uninitialized
Change-Id: I4c76d941bdd27ef5d0967a1385e0107fbb99a91c
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:55:11 -03:00
Nick Desaulniers
2fd3ec3533 Revert "selinux: Relocate ss_initialized and selinux_enforcing to separate 4k"
This reverts commit d4807bd60dc166a6445c3b13684f1d1afb722bc5.

That out of tree patch causes the resulting kernel image to be too
large, causing ld.lld to error; likely due to the additional section and
alignment requirements.  Android and floral don't host virtual targets
and thus do not run at EL2 on arm64.

Bug: 63740206
Change-Id: I357bf4d5c7e29230746eacd51fef413acec06067
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:55:09 -03:00
Volodymyr Zhdanov
e4dd031596 Revert "RTIC: Move selinux_state to a separate 4k"
This reverts commit 16431697784f395f984fa7b09767d45b47335790.

Change-Id: I588e0f3b4703813422f97ab3042a16eaa3f243e0
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-31 01:55:09 -03:00
Raphiel Rollerscaperers
257f8e2b89 thermal: core: Workaround for xiaomi thermal mitigation
For some reason, leaving this unconfigured makes the charger voltage
become low and it's affecting UX, set this to Evaluation by default
to improve UX, also while on it, convert deprecated simple_strtol
to kstrtoint

Bug: Slow charging
Test: Charging speed normal, sconfig at 10 as defined

Change-Id: Id974ceaf31da0439502372a09ff6b5f4ef2982d8
Signed-off-by: Raphiel Rollerscaperers <rapherion@raphielgang.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-28 02:16:28 -03:00
lybxlpsv
fb520a1b30 ASoC: wcd934x: Increase volume to 27
Change-Id: Iebd3f08d5928ce3bd52570447872f935080e6c65
Signed-off-by: Jebaitedneko <Jebaitedneko@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-28 02:16:27 -03:00
Jebaitedneko
54555b5247 ASoC: tas256x: Silence logspams
Change-Id: Ic974961b4501276dcdb3e400215b1f2d8de62776
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-28 02:16:24 -03:00
Alexander Winkowski
da232f8a33 Revert "soc: pinctrl-lpi: Initialise at late_initcall"
This reverts commit ee046b18191656af4230d15006bd5957e5b6289e.

The issue has been fixed properly in Idafc26a739df1831d04ea2fde4625e8f9ca1a0ae.

Change-Id: I8275c11660af6cd03907970dea020897b66ceaa3
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-28 02:16:15 -03:00
Angelo G. Del Regno
b570d4a04e ASoC: audio_notifier: Defer external notifier registration if not inited
If the driver is not yet initialized, return EPROBE_DEFER to the
external driver trying to register a notification, so that we
don't miss any.

Change-Id: Idafc26a739df1831d04ea2fde4625e8f9ca1a0ae
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-28 02:16:13 -03:00
Vignesh Kulothungan
a5dd700205 ASoC: swr-mstr-ctrl: Add check condition before enabling IRQ
Enable interrupt request only when the interrupt is
in disabled state.

Change-Id: I67795bf0ee344661e02b0fec3181cd7980d56652
Signed-off-by: Vignesh Kulothungan <vigneshk@codeaurora.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-28 02:16:08 -03:00
Andrzej Perczak
c866236258 ASoC: bolero-cdc: Fix unitialized rwsem usage
Change-Id: I2bf6f64d34eb082521c92c0b6c22b904d5f73302
Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-28 02:16:03 -03:00
jianil
e29e2cf628 qcacld-3.0: Fix compile error of mdie
Fix compile error of mdie[SIR_MDIE_SIZE], use
mdie[] instead.

CRs-Fixed: 3364146
Change-Id: I934d3f02a19b511583141deeca7af5b4d4c0ef30
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-28 02:15:56 -03:00
Richard Raya
a095e4b3f8 Revert "qcacld-3.0: Fix mdie array declaration warning"
Following upstream solution: 76f873247f

This reverts commit b8c7a22804a4f2a26bbc0036937a1fbd4a9ef51b.

Change-Id: Iab38596d42673cd3896c430a5a76bb48602ce1ae
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-28 02:15:49 -03:00
LibXZR
17ef7df74a subsystem_restart: Always performs soft resets when subsystems crash
* OEM is using a dirty list and userspace nodes to override restart_level
for some subsystems. Why not just ignore all RESET_SOC and use a soft reset
instead? Nobody wanna to see their device goes randomly reboot sometimes.

* Note that commit 0e27242 is also needed to fix broken irq free when soft
reset the modem.

Change-Id: I36f6355db170a289de73bb6202be1618bd46e688
Signed-off-by: LibXZR <xzr467706992@163.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-24 00:02:38 -03:00
LibXZR
0e27242ef3 Revert "genirq/irqdomain: Don't try to free an interrupt that has no mapping"
* This is retard. An interrupt does not have a permanent virq. The virq of an irq may be changed
after the free of other irqs.

* This is causing problems for msm_msi_irq_domain to free all the irqs that it allocated.

* Fix unrecoverable modem crash.

This reverts commit d1874e36cb3d00ba53f9e7bc3ca58d3058659cee.

Change-Id: I831083118d6a7c12d43f2fa2ef01bdd27159dac8
Signed-off-by: LibXZR <xzr467706992@163.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-24 00:01:56 -03:00
Richard Raya
5351ae2d91 drm/msm/sde: Remove unwanted boosting
Change-Id: I20a0aeca4cac671906cec3e184f9b4ff2f2a48a3
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:59:47 -03:00
Richard Raya
30f8174d8a msm-4.14: Bump boosts input timeouts
Change-Id: I55077d5fecbf231539ad94ac058226cbc39d1479
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:59:46 -03:00
Richard Raya
dc1bda571f defconfig: Switch to CPU input boost
Change-Id: I59031e31b40ea6f2a220e95db8508020b933068a
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:59:45 -03:00
Yaroslav Furman
75b333cac7 drm: Boost CPU upon running an atomic ioctl
Change-Id: I10b0bbb2e4f65573658a9510c6cf34ea59244645
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:59:44 -03:00
Richard Raya
ace2ca6b7a drm/msm/sde: Boost DDR bus on frame commit
Change-Id: Ia0ac7356492c1c85b01d299f0c55888d1f25d008
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:59:43 -03:00
Sultan Alsawaf
5626e9eb9c cgroup: Boost whenever a zygote-forked process becomes a top app
Boost to the max for 1000 ms whenever the top app changes, which
improves app launch speeds and addresses jitter when switching between
apps. A check to make sure that the top-app's parent is zygote ensures
that a user-facing app is indeed what's added to the top app task group,
since app processes are forked from zygote.

Change-Id: I49563d8baef7cefa195c919acf97343fa424c3be
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:59:42 -03:00
Dietmar Eggemann
f49f0241d2 sched/features: Disable LB_BIAS by default
LB_BIAS allows the adjustment on how conservative load should be
balanced.

The rq->cpu_load[idx] array is used for this functionality. It contains
weighted CPU load decayed average values over different intervals
(idx = 1..4). Idx = 0 is the weighted CPU load itself.

The values are updated during scheduler_tick, before idle balance and at
nohz exit.

There are 5 different types of idx's per sched domain (sd). Each of them
is used to index into the rq->cpu_load[idx] array in a specific scenario
(busy, idle and newidle for load balancing, forkexec for wake-up
slow-path load balancing and wake for affine wakeup based on weight).
Only the sd idx's for busy and idle load balancing are set to 2,3 or 1,2
respectively. All the other sd idx's are set to 0.

Conservative load balancing is achieved for sd idx's >= 1 by using the
min/max (source_load()/target_load()) value between the current weighted
CPU load and the rq->cpu_load[sd idx -1] for the busiest(idlest)/local
CPU load in load balancing or vice versa in the wake-up slow-path load
balancing.
There is no conservative balancing for sd idx = 0 since only current
weighted CPU load is used in this case.

It is very likely that LB_BIAS' influence on load balancing can be
neglected (see test results below). This is further supported by:

(1) Weighted CPU load today is by itself a decayed average value (PELT)
    (cfs_rq->avg->runnable_load_avg) and not the instantaneous load
    (rq->load.weight) it was when LB_BIAS was introduced.

(2) Sd imbalance_pct is used for CPU_NEWLY_IDLE and CPU_NOT_IDLE (relate
    to sd's newidle and busy idx) in find_busiest_group() when comparing
    busiest and local avg load to make load balancing even more
    conservative.

(3) The sd forkexec and newidle idx are always set to 0 so there is no
    adjustment on how conservatively load balancing is done here.

(4) Affine wakeup based on weight (wake_affine_weight()) will not be
    impacted since the sd wake idx is always set to 0.

Let's disable LB_BIAS by default for a few kernel releases to make sure
that no workload and no scheduler topology is affected. The benefit of
being able to remove the LB_BIAS dependency from source_load() and
target_load() is that the entire rq->cpu_load[idx] code could be removed
in this case.

It is really hard to say if there is no regression w/o testing this with
a lot of different workloads on a lot of different platforms, especially
NUMA machines.
The following 104 LKP (Linux Kernel Performance) tests were run by the
0-Day guys mostly on multi-socket hosts with a larger number of logical
cpus (88, 192).
The base for the test was commit b3dae109fa89 ("sched/swait: Rename to
exclusive") (tip/sched/core v4.18-rc1).
Only 2 out of the 104 tests had a significant change in one of the
metrics (fsmark/1x-1t-1HDD-btrfs-nfsv4-4M-60G-NoSync-performance +7%
files_per_sec, unixbench/300s-100%-syscall-performance -11% score).
Tests which showed a change in one of the metrics are marked with a '*'
and this change is listed as well.

(a) lkp-bdw-ep3:
      88 threads Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz 64G

    dd-write/10m-1HDD-cfq-btrfs-100dd-performance
    fsmark/1x-1t-1HDD-xfs-nfsv4-4M-60G-NoSync-performance
  * fsmark/1x-1t-1HDD-btrfs-nfsv4-4M-60G-NoSync-performance
      7.50  7%  8.00  ±  6%  fsmark.files_per_sec
    fsmark/1x-1t-1HDD-btrfs-nfsv4-4M-60G-fsyncBeforeClose-performance
    fsmark/1x-1t-1HDD-btrfs-4M-60G-NoSync-performance
    fsmark/1x-1t-1HDD-btrfs-4M-60G-fsyncBeforeClose-performance
    kbuild/300s-50%-vmlinux_prereq-performance
    kbuild/300s-200%-vmlinux_prereq-performance
    kbuild/300s-50%-vmlinux_prereq-performance-1HDD-ext4
    kbuild/300s-200%-vmlinux_prereq-performance-1HDD-ext4

(b) lkp-skl-4sp1:
      192 threads Intel(R) Xeon(R) Platinum 8160 768G

    dbench/100%-performance
    ebizzy/200%-100x-10s-performance
    hackbench/1600%-process-pipe-performance
    iperf/300s-cs-localhost-tcp-performance
    iperf/300s-cs-localhost-udp-performance
    perf-bench-numa-mem/2t-300M-performance
    perf-bench-sched-pipe/10000000ops-process-performance
    perf-bench-sched-pipe/10000000ops-threads-performance
    schbench/2-16-300-30000-30000-performance
    tbench/100%-cs-localhost-performance

(c) lkp-bdw-ep6:
      88 threads Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz 128G

    stress-ng/100%-60s-pipe-performance
    unixbench/300s-1-whetstone-double-performance
    unixbench/300s-1-shell1-performance
    unixbench/300s-1-shell8-performance
    unixbench/300s-1-pipe-performance
  * unixbench/300s-1-context1-performance
      312  315  unixbench.score
    unixbench/300s-1-spawn-performance
    unixbench/300s-1-syscall-performance
    unixbench/300s-1-dhry2reg-performance
    unixbench/300s-1-fstime-performance
    unixbench/300s-1-fsbuffer-performance
    unixbench/300s-1-fsdisk-performance
    unixbench/300s-100%-whetstone-double-performance
    unixbench/300s-100%-shell1-performance
    unixbench/300s-100%-shell8-performance
    unixbench/300s-100%-pipe-performance
    unixbench/300s-100%-context1-performance
    unixbench/300s-100%-spawn-performance
  * unixbench/300s-100%-syscall-performance
      3571  ±  3%  -11%  3183  ±  4%  unixbench.score
    unixbench/300s-100%-dhry2reg-performance
    unixbench/300s-100%-fstime-performance
    unixbench/300s-100%-fsbuffer-performance
    unixbench/300s-100%-fsdisk-performance
    unixbench/300s-1-execl-performance
    unixbench/300s-100%-execl-performance
  * will-it-scale/brk1-performance
      365004  360387  will-it-scale.per_thread_ops
  * will-it-scale/dup1-performance
      432401  437596  will-it-scale.per_thread_ops
    will-it-scale/eventfd1-performance
    will-it-scale/futex1-performance
    will-it-scale/futex2-performance
    will-it-scale/futex3-performance
    will-it-scale/futex4-performance
    will-it-scale/getppid1-performance
    will-it-scale/lock1-performance
    will-it-scale/lseek1-performance
    will-it-scale/lseek2-performance
  * will-it-scale/malloc1-performance
      47025  45817  will-it-scale.per_thread_ops
      77499  76529  will-it-scale.per_process_ops
    will-it-scale/malloc2-performance
  * will-it-scale/mmap1-performance
      123399  120815  will-it-scale.per_thread_ops
      152219  149833  will-it-scale.per_process_ops
  * will-it-scale/mmap2-performance
      107327  104714  will-it-scale.per_thread_ops
      136405  133765  will-it-scale.per_process_ops
    will-it-scale/open1-performance
  * will-it-scale/open2-performance
      171570  168805  will-it-scale.per_thread_ops
      532644  526202  will-it-scale.per_process_ops
    will-it-scale/page_fault1-performance
    will-it-scale/page_fault2-performance
    will-it-scale/page_fault3-performance
    will-it-scale/pipe1-performance
    will-it-scale/poll1-performance
  * will-it-scale/poll2-performance
      176134  172848  will-it-scale.per_thread_ops
      281361  275053  will-it-scale.per_process_ops
    will-it-scale/posix_semaphore1-performance
    will-it-scale/pread1-performance
    will-it-scale/pread2-performance
    will-it-scale/pread3-performance
    will-it-scale/pthread_mutex1-performance
    will-it-scale/pthread_mutex2-performance
    will-it-scale/pwrite1-performance
    will-it-scale/pwrite2-performance
    will-it-scale/pwrite3-performance
  * will-it-scale/read1-performance
      1190563  1174833  will-it-scale.per_thread_ops
  * will-it-scale/read2-performance
      1105369  1080427  will-it-scale.per_thread_ops
    will-it-scale/readseek1-performance
  * will-it-scale/readseek2-performance
      261818  259040  will-it-scale.per_thread_ops
    will-it-scale/readseek3-performance
  * will-it-scale/sched_yield-performance
      2408059  2382034  will-it-scale.per_thread_ops
    will-it-scale/signal1-performance
    will-it-scale/unix1-performance
    will-it-scale/unlink1-performance
    will-it-scale/unlink2-performance
  * will-it-scale/write1-performance
      976701  961588  will-it-scale.per_thread_ops
  * will-it-scale/writeseek1-performance
      831898  822448  will-it-scale.per_thread_ops
  * will-it-scale/writeseek2-performance
      228248  225065  will-it-scale.per_thread_ops
  * will-it-scale/writeseek3-performance
      226670  224058  will-it-scale.per_thread_ops
    will-it-scale/context_switch1-performance
    aim7/performance-fork_test-2000
  * aim7/performance-brk_test-3000
      74869  76676  aim7.jobs-per-min
    aim7/performance-disk_cp-3000
    aim7/performance-disk_rd-3000
    aim7/performance-sieve-3000
    aim7/performance-page_test-3000
    aim7/performance-creat-clo-3000
    aim7/performance-mem_rtns_1-8000
    aim7/performance-disk_wrt-8000
    aim7/performance-pipe_cpy-8000
    aim7/performance-ram_copy-8000

(d) lkp-avoton3:
      8 threads Intel(R) Atom(TM) CPU C2750 @ 2.40GHz 16G

    netperf/ipv4-900s-200%-cs-localhost-TCP_STREAM-performance

Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Cc: Li Zhijian <zhijianx.li@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20180809135753.21077-1-dietmar.eggemann@arm.com
Change-Id: Ia84e33416b394990da2fd0f2d21bd499ce76a65d
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:58:50 -03:00
Richard Raya
28aed9fd03 msm_performance: Stub out set_cpu_max_freq()
Change-Id: If0aeb524c976132d98d5ca57ed6407361577f53a
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:58:50 -03:00
Sultan Alsawaf
665beea321 defconfig: Enable SBalance
Exclude the last CPU of each cluster from balancing in order to keep the
maximum amount of single-threaded performance available to the system per
each cluster. That way, when IRQ pressure is high, each cluster will have
at least one CPU which isn't affected by IRQ pressure.

Change-Id: I0c77659c6e8302939798890af5c6a92bc68793b7
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:57:42 -03:00
Sultan Alsawaf
afb5a3665b qcacld-3.0: Disable auto IRQ affinity feature
This is at odds with sbalance, which balances this IRQ automatically.
Disable the IRQ affinity feature and leave this up to sbalance.

Change-Id: Ie463f0578e33f0fb777e90288056d7e55b5218aa
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:54:56 -03:00
Kazuki H
b4f4f18aa7 irq: Don't allow IRQ affinities to be set from userspace
Change-Id: I8278aec4280103cdb092f197ded20831d9f57fd4
Signed-off-by: Kazuki H <kazukih0205@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:54:37 -03:00
Sultan Alsawaf
70f60e8bfe sbalance: Fix severe misattribution of movable IRQs to the last active CPU
Due to a horrible omission in the big IRQ list traversal, all movable IRQs
are misattributed to the last active CPU in the system since that's what
`bd` is last set to in the loop prior. This horribly breaks SBalance's
notion of balance, producing nonsensical balancing decisions and failing to
balance IRQs even when they are heavily imbalanced.

Fix the massive breakage by adding the missing line of code to set `bd` to
the CPU an IRQ actually belongs to, so that it's added to the correct CPU's
movable IRQs list.

Change-Id: Ide222d361152b1cd03c1894c995cab42980d16e7
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:53:55 -03:00
Sultan Alsawaf
9d49f44e04 sbalance: Don't race with CPU hotplug
When a CPU is hotplugged, cpu_active_mask is modified without any RCU
synchronization. As a result, the only synchronization for cpu_active_mask
provided by the hotplug code is the CPU hotplug lock.

Furthermore, since IRQ balance is majorly disrupted during CPU hotplug due
to mass IRQ migration off a dying CPU, SBalance just shouldn't operate
while a CPU hotplug is in progress.

Take the CPU hotplug lock in balance_irqs() to prevent races and mishaps
during CPU hotplugs.

Change-Id: If377de7b78e3ae68a20bc95bdb84650330cfc330
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:53:54 -03:00
Sultan Alsawaf
8d891a9e71 sbalance: Convert various IRQ counter types to unsigned ints
These counted values are actually unsigned ints, not unsigned longs.
Convert them to unsigned ints since there's no reason for them to be longs.

Change-Id: Ia5c4a3162a072b4fa3225afdcd969db95b60c802
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:53:53 -03:00
Sultan Alsawaf
9fe60c2f32 sbalance: Fix systemic issues caused by flawed IRQ statistics
SBalance's statistic of new interrupts for each CPU is inherently flawed in
that it cannot track IRQ migration that occurs in between balance periods.
As a result, SBalance can observe a flawed number of new interrupts for a
CPU, which hurts its balancing decisions.

Furthermore, SBalance incorrectly assumes that IRQs are affined where
SBalance last placed them, which breaks SBalance entirely when the
assumption doesn't hold true.

As it turns out, it can be quite common to change an IRQ's affinity and
observe a successful return value despite the IRQ not actually moving. At
the very least this is observed on ARM's GICv3, and results in SBalance
never moving such an IRQ ever again because SBalance always thinks it has
zero new interrupts.

Since we can't trust irqchip drivers or hardware, gather IRQ statistics
directly in order to get the true number of new interrupts for each CPU and
the actual affinity of each IRQ based on the last CPU it fired upon.

Change-Id: Ic846adac244a0873c4502987e0904b552ab31f22
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:53:52 -03:00
Sultan Alsawaf
9cddb6a1a0 sbalance: Use non-atomic cpumask_clear_cpu() variant
The atomic cpumask_clear_cpu() isn't needed. Use __cpumask_clear_cpu()
instead as a micro-optimization, and for clarity.

Change-Id: I17d168814c4b96557c8a9f986c2c5be8e18be26b
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:53:51 -03:00
Sultan Alsawaf
a4e8c0a0a3 sbalance: Use a deferrable timer to avoid waking idle CPUs
SBalance is designed to poll to balance IRQs, but it shouldn't kick CPUs
out of idle to do so because idle CPUs clearly aren't processing
interrupts.

Open code a freezable wait that uses a deferrable timer in order to prevent
SBalance from waking up idle CPUs when there is little interrupt traffic.

Change-Id: I5f796a4590801c9a5935ca7ea8c966ca281620c7
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:53:51 -03:00
Sultan Alsawaf
cc5e8988ca sbalance: Allow IRQs to be moved off of excluded CPUs
Excluded CPUs are excluded from IRQ balancing with the intention that those
CPUs shouldn't really be processing interrupts, and thus shouldn't have
IRQs moved to them. However, SBalance completely ignores excluded CPUs,
which can cause them to end up with a disproportionate amount of interrupt
traffic that SBalance won't spread out. An easy example of this is when
CPU0 is an excluded CPU, since CPU0 ends up with all interrupts affined to
it by default on arm64.

Allow SBalance to move IRQs off of excluded CPUs so that they cannot slip
under the radar and pile up on an excluded CPU, like when CPU0 is excluded.

Change-Id: I392a058ea8cf7672bfea39ff9525bf6b7c52a062
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-12-23 00:53:49 -03:00