793159 Commits

Author SHA1 Message Date
kdrag0n
27da831013 ARM64/dts: sdmmagpie: Suppress verbose output during boot
This should make the kernel initialization faster as it suppresses any
potential serial console output.

Change-Id: Iafcb84908f0911f14b0c560c2122d9be65bf216f
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-23 19:42:32 +05:30
Adithya R
d73c94b8ff Revert "ARM64/dts: sdmmagpie: Run nocb kthreads on little cores"
This reverts commit b9337338014def1f152e91f6ea301824979f4c31.
2021-03-23 19:32:45 +05:30
Adithya R
bde196d8b9 Revert "msm/adreno: Don't mark KGSL scratch buffer as privileged"
* we have R firmware, so this is no longer needed

This reverts commit 873a22fa115c33a9df7e735f995c086a82b9b808.
2021-03-23 19:31:39 +05:30
Sandeep Singh
27f1859b20 icnss: Avoid wlan driver unload if driver is not probed
Avoid wlan host driver unload if wlan host driver is not
probed.

Change-Id: I60b5486654b42e0b4431c8fc96d956aa749c44b3
Signed-off-by: Sandeep Singh <sandsing@codeaurora.org>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:13 +05:30
Ashok Vuyyuru
e6a23a664c msm: ipa3: Fix increase the NAPI budget to maximum
Because of less NAPI budget it's need to reschedule multiple
times in high tput scenario.To avoid multiple reschedule
configuring maximum NAPI budget value.

Change-Id: Id8745b54c3909d01df69376a823396ea4c94eebb
Signed-off-by: Ashok Vuyyuru <avuyyuru@codeaurora.org>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:13 +05:30
Pranav Patel
6a4b57fbc0 msm: kgsl: Clear fault to avoid race between timeout and hard fault
Observed race between timeout fault (long IB detection) and
MISC hang (hard fault). MISC hang can be set while in recovery from
timeout fault. If fault flag is set in start path CP init fails.
Clear gpu fault to avoid such race.

Change-Id: Id99dcefd0ef3438bc95c6c3c84e2eadce214cf77
Signed-off-by: Pranav Patel <pranavp@codeaurora.org>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:13 +05:30
Jianmin Zhu
34fb5454fd arm64: Avoid watchdog during dump wlan firmware after panic
When kernel panic, irqs will be disabled, dma_free_attrs is
called frequently when dump wlan firmware, too much printk by
WARN_ON(irqs_disabled()) make watchdog bite

Change-Id: I9bf18d73c1468c8829bce77898849b3eef07271f
Signed-off-by: Jianmin Zhu <jianminz@codeaurora.org>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:13 +05:30
Maciej S. Szmigiero
03876ea327 cfq: Clear queue pointers after unpinning them in cfq_pd_offline
BFQ is already doing a similar thing in its .pd_offline_fn() method
implementation.

While it seems that after commit 4c6994806f70
("blk-throttle: fix race between blkcg_bio_issue_check() and cgroup_rmdir()")
was reverted leaving these pointers intact no longer causes crashes
clearing them is still a sensible thing to do to make the code more robust.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:03 +05:30
Omar Sandoval
e042161bb9 block: cfq/bfq: Use ktime_get_ns() instead of sched_clock()
cfq and bfq have some internal fields that use sched_clock() which can
trivially use ktime_get_ns() instead. Their timestamp fields in struct
request can also use ktime_get_ns(), which resolves the 8 year old
comment added by commit 28f4197e5d47 ("block: disable preemption before
using sched_clock()").

Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:03 +05:30
Neal Cardwell
82a5c65673 ipv4: tcp: Allow TLP in ECN CWR
This patch enables tail loss probe in cwnd reduction (CWR) state
to detect potential losses. Prior to this patch, since the sender
uses PRR to determine the cwnd in CWR state, the combination of
CWR+PRR plus tcp_tso_should_defer() could cause unnecessary stalls
upon losses: PRR makes cwnd so gentle that tcp_tso_should_defer()
defers sending wait for more ACKs. The ACKs may not come due to
packet losses.

Disallowing TLP when there is unused cwnd had the primary effect
of disallowing TLP when there is TSO deferral, Nagle deferral,
or we hit the rwin limit. Because basically every application
write() or incoming ACK will cause us to run tcp_write_xmit()
to see if we can send more, and then if we sent something we call
tcp_schedule_loss_probe() to see if we should schedule a TLP. At
that point, there are a few common reasons why some cwnd budget
could still be unused:

(a) rwin limit
(b) nagle check
(c) TSO deferral
(d) TSQ

For (d), after the next packet tx completion the TSQ mechanism
will allow us to send more packets, so we don't really need a
TLP (in practice it shouldn't matter whether we schedule one
or not). But for (a), (b), (c) the sender won't send any more
packets until it gets another ACK. But if the whole flight was
lost, or all the ACKs were lost, then we won't get any more ACKs,
and ideally we should schedule and send a TLP to get more feedback.
In particular for a long time we have wanted some kind of timer for
TSO deferral, and at least this would give us some kind of timer

Reported-by: Steve Ibanez <sibanez@stanford.edu>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Reviewed-by: Nandita Dukkipati <nanditad@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:03 +05:30
Park Ju Hyung
1090db2d15 f2fs: Don't wait with each discards under gc_urgent
f2fs already addresses gc_urgent under discard, but still uses the
default wait_ms.

To gain as many free segments as fast as possible,
use 1 for wait_ms under gc_urgent for discards.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:02 +05:30
Park Ju Hyung
5d25eb51f3 f2fs: Use a more reasonable discard policy for high utilization
Waking up discard thread on 50ms interval is way too aggressive,
even when the user has only 20% of space left.

60000ms vs 50ms is too much of a stark difference.

Use 10 seconds instead.
The use of Rapid GC also makes this switch more reasonable.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:02 +05:30
Park Ju Hyung
056c9c7c82 f2fs: Explicitly flush device upon foreground GC
GC itself will produce some dirty segments.
This will allow more GCs to be made upon rapid GC or urgent GC.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:57:02 +05:30
Yaroslav Furman
4e52bc9581 include: blkdev: Optimize for flash storage
* Switch to SSD mode, disable IO stats and entropy gathering

Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-23 12:43:07 +05:30
Danny Lin
139aec4027 msm: msm_bus: Kill transaction logging functionality
The transaction logging (and especially strcmp call) is unnecessary for
us and adds measurably significant overhead. Kill it entirely.

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:41:14 +05:30
Sultan Alsawaf
ed2cd13694 cpu: Silence log spam when a CPU is brought up
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: celtare21 <celtare21@gmail.com>
2021-03-23 12:40:45 +05:30
Alex Naidis
060b38fcb9 alarmtimer: Add ndelay for tight loop
The loop in alarm_cancel() is similar to the ones in the
timer drivers as it disables IRQs as well.

So we need to add an ndelay() call after the cpu_relax() call
to avoid potential scheduling delays due to IRQ stalling.

Signed-off-by: Alex Naidis <alex.naidis@linux.com>
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
2021-03-23 12:10:42 +05:30
Alex Naidis
a17d7f61d4 msm: ipa_v3: Mitigate usleep_range calls
Calling usleep_range with identical min and max values,
results in a delta of 0us.

This causes the issue that the scheduler gets no chance to re-use an already
scheduled interrupt for this wait which results in a negative performance
impact by adding uninterruptible sleep.

Fix the issue by allowing the delay to take 20% longer than requested.
This should be good enough for these cases.

Signed-off-by: Alex Naidis <alex.naidis@paranoidandroid.co>
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
2021-03-23 12:10:34 +05:30
Linux Build Service Account
180b0b1170 Merge f2d8a201653c2404f312c76f85a35234cd8f350e on remote branch
Change-Id: I40656da2f5ff7cce633867c5a122a6da0ec04c26
2021-03-22 16:47:51 -07:00
Linux Build Service Account
a9fa0222a2 Merge 142cf65f60f1d7a5b851dd9a7a8f53f2744863e6 on remote branch
Change-Id: I27689b145a1402aa2f3fd09d8cbc39d07810a60c
2021-03-22 16:47:33 -07:00
Linux Build Service Account
89dae8fa1e Merge 934ff6b45db46925f79563dc920861e2ced8e8d2 on remote branch
Change-Id: I867117666a1be9b9ed58aa81b8d219b5da706da0
2021-03-22 16:46:21 -07:00
Linux Build Service Account
bc0db02dc4 Merge d67e179d9998d6acb045d6006077bb7c3456a459 on remote branch
Change-Id: I27d0dd0cdede67be1d2643ad5597475e4ca33c48
2021-03-22 16:46:17 -07:00
Linux Build Service Account
2d476b35b7 Merge 3bae0eca5b4c2f2ff6d82e7a9d1e89d20ea231b7 on remote branch
Change-Id: Ibf161c7c5a7d8cd24c76758e4c2b326d5ba4a78e
2021-03-22 16:46:12 -07:00
Linux Build Service Account
b1723fef95 Merge c0c85da2f7e5ce16ebfa772ccaa4077cdb6a6655 on remote branch
Change-Id: I2107ea92dcfd835720938194a22f7e63d1b2334b
2021-03-22 16:43:23 -07:00
Adithya R
06077f5de0 ARM64/dts: qcom: Do not build useless qcom dtb's 2021-03-22 12:32:05 +05:30
Adithya R
817f8afd14 ARM64/configs: surya: Enable USB force fast charge 2021-03-22 12:30:29 +05:30
engstk
de2e3b475d drivers: misc/power: Implement USB2 fast charge mode
echo 0 /sys/kernel/fast_charge/force_fast_charge (disable)
echo 1 /sys/kernel/fast_charge/force_fast_charge (enable)

Enables force charging up to 900mA in usb2 mode

Signed-off-by: engstk <eng.stk@sapo.pt>
2021-03-22 12:29:43 +05:30
Danny Lin
0724e3493f power: supply: Classify Battery Monitor Systems as batteries
CAF's new fuel gauge drivers report POWER_SUPPLY_TYPE_BMS (Battery
Monitor System) instead of POWER_SUPPLY_TYPE_BATTERY (battery), and
rightfully so because it describes their purpose more accurately.

Update the power_supply_is_system_supplied function to recognize BMS
power supplies as batteries to prevent it from attempting to query the
POWER_SUPPLY_PROP_ONLINE property on our fuel gauge drivers.

Signed-off-by: Danny Lin <danny@kdrag0n.dev>
2021-03-22 12:22:09 +05:30
Park Ju Hyung
88c17412a3 msm_geni_serial: Make ioctl always exclusive
Potential concurrent accesses to vote_clock_on/off() functions
may leave runtime PM in an unwanted state.

Change-Id: Ie317e8b191f5ab4083071ea55210006fb06f8079
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: celtare21 <celtare21@gmail.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-22 12:22:09 +05:30
Park Ju Hyung
d860350c2c msm_geni_serial: Reduce ISR wakelock timeout to 100ms
Average userspace response time from ISR is less than 10ms.

Whooping 2 seconds is way too long. Reduce it to 100ms.

Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Change-Id: I78e1f434f6e5585497972ee82b2a29c5cfd87408
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2021-03-22 12:21:55 +05:30
Jie Song
0615f4f440 diag: Add timer to make sure wakelock no stuck
Bug: 142000171
cherry-pick from I81666dcc18c584dbcbd9f588f187ae87a377bcb0
Signed-off-by: Jie Song <jies@google.com>

Change-Id: I7bb84dec4d352ef731b2457dc15590a29ed57a90
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: UtsavisGreat <utsavbalar1231@gmail.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2021-03-22 12:21:55 +05:30
mady51
0b706d7c9d gpu: msm: Disable adreno driver logging
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-22 12:21:54 +05:30
Yaroslav Furman
6a04177ddb power/supply: cp_qc30: Silence logging
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-22 12:21:54 +05:30
Yaroslav Furman
3d7768f013 drivers: power: Add timeouts to wakelocks
These can get stuck sometimes and prevert system from sleeping.

Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: alk3pInjection <webmaster@raspii.tech>
(cherry picked from commit cd8489c06a3de8c70c6236f91290dd72f46023f4)
2021-03-22 12:21:54 +05:30
Yaroslav Furman
63994f045f PM / sleep: Skip OOM killer toggles when kernel is compiled for Android
Android devices use LMK algorythms, so there's no
reason to disable and enable the OOM killer when entering and exiting
suspend.

This is a fixed version of https://github.com/YaroST12/VIOLENT_kernel/commit/86e59a93b2ef

Co-authored-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: alk3pInjection <webmaster@raspii.tech>
2021-03-22 12:21:54 +05:30
Sultan Alsawaf
a4e19b682c soc: qcom: watchdog_v2: Fix memory leaks when memory_dump_v2 isn't built
When the memory_dump_v2.c driver isn't built (CONFIG_QCOM_MEMORY_DUMP_V2=n),
an inline version of msm_dump_data_register is used that does nothing. This
means that all memory allocated with the intention of going
to msm_dump_data_register gets leaked.

Fix this by skipping the relevant memory allocation entirely when
CONFIG_QCOM_MEMORY_DUMP_V2 is disabled.

This fixes the following memory leaks:
unreferenced object 0xffffffc7b4b13e00 (size 512):
  comm "swapper/0", pid 1, jiffies 4294877435 (age 103.263s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 4b 43 50 55 5f 43 54 58  ........KCPU_CTX
    30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  0...............
  backtrace:
    [<ffffff93cd3fc814>] __kmalloc+0x1a4/0x2f8
    [<ffffff93cd6ded0c>] msm_watchdog_probe+0x6d4/0xb08
    [<ffffff93cd9208c0>] platform_drv_probe+0x58/0xb8
    [<ffffff93cd91ebcc>] driver_probe_device+0x234/0x400
    [<ffffff93cd91ef68>] __device_attach_driver+0x88/0x140
    [<ffffff93cd91cdb8>] bus_for_each_drv+0x78/0xc8
    [<ffffff93cd91e7cc>] __device_attach+0xd4/0x150
    [<ffffff93cd91f058>] device_initial_probe+0x10/0x18
    [<ffffff93cd91d0a0>] bus_probe_device+0x90/0x98
    [<ffffff93cd91b93c>] device_add+0x3ec/0x5e8
    [<ffffff93cdd56868>] of_device_add+0x58/0x68
    [<ffffff93cdd57438>] of_platform_device_create_pdata+0xa0/0xf8
    [<ffffff93cdd5770c>] of_platform_bus_create+0x27c/0x440
    [<ffffff93cdd5776c>] of_platform_bus_create+0x2dc/0x440
    [<ffffff93cdd57aa4>] of_platform_populate+0x74/0x118
    [<ffffff93cf24b2cc>] of_platform_default_populate_init+0x68/0x7c

unreferenced object 0xffffffc7b4be0000 (size 16384):
  comm "swapper/0", pid 1, jiffies 4294877435 (age 103.263s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<ffffff93cd3d2958>] kmalloc_order+0x58/0x68
    [<ffffff93cd3d2990>] kmalloc_order_trace+0x28/0x100
    [<ffffff93cd3fc8f8>] __kmalloc+0x288/0x2f8
    [<ffffff93cd6ded34>] msm_watchdog_probe+0x6fc/0xb08
    [<ffffff93cd9208c0>] platform_drv_probe+0x58/0xb8
    [<ffffff93cd91ebcc>] driver_probe_device+0x234/0x400
    [<ffffff93cd91ef68>] __device_attach_driver+0x88/0x140
    [<ffffff93cd91cdb8>] bus_for_each_drv+0x78/0xc8
    [<ffffff93cd91e7cc>] __device_attach+0xd4/0x150
    [<ffffff93cd91f058>] device_initial_probe+0x10/0x18
    [<ffffff93cd91d0a0>] bus_probe_device+0x90/0x98
    [<ffffff93cd91b93c>] device_add+0x3ec/0x5e8
    [<ffffff93cdd56868>] of_device_add+0x58/0x68
    [<ffffff93cdd57438>] of_platform_device_create_pdata+0xa0/0xf8
    [<ffffff93cdd5770c>] of_platform_bus_create+0x27c/0x440
    [<ffffff93cdd5776c>] of_platform_bus_create+0x2dc/0x440

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2021-03-22 12:21:54 +05:30
Sultan Alsawaf
982e47424e drm/msm/sde: Stub out debug log macros and compile them out
These debug logs are everywhere and not only bloat the driver, but add
latency everywhere they're used because they're not compiled out. Since
they serve no purpose for us as we're not debugging SDE, compile them
out.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2021-03-22 12:21:54 +05:30
LibXZR
c7b183c6d4 qmi_rmnet: Make powersave workqueue unbound and freezable
* After commit "Revert "dfc: Use alarm timer to trigger powersave work",
this workqueue is now is use for qmi_rmnet_check_stats. Make it unbound
and freezable to save power.

Signed-off-by: LibXZR <xzr467706992@163.com>
Signed-off-by: alk3pInjection <webmaster@raspii.tech>
2021-03-22 00:07:10 +05:30
LibXZR
63b06c717c Revert "dfc: Use alarm timer to trigger powersave work"
* Something has been significantly wrong with this driver.
Under mobile data, I see it keeps setting up alarms which
triggers every seconds, causing device unable go into suspend,
showing logs like "device alarmtimer failed to suspend".

* IDK why this is happening, maybe something has been wrong in
userspace or other parts of kernel.

* Note: This is also happening on stock kernel.

* Revert it for a dirty fix.

This reverts commit 1fb14a2123b10cebe0133e29590a671ae6b7ec93.

Signed-off-by: LibXZR <xzr467706992@163.com>
Signed-off-by: alk3pInjection <webmaster@raspii.tech>
2021-03-22 00:06:51 +05:30
Arnd Bergmann
03fcd51074 arm64: arch_timer: Avoid unused function warning
task #28924046

[Upstream commit 040f340134751d73bd03ee92fabb992946c55b3d]

arm64_1188873_read_cntvct_el0() is protected by the correct
CONFIG_ARM64_ERRATUM_1188873 #ifdef, but the only reference to it is
also inside of an CONFIG_ARM_ARCH_TIMER_OOL_WORKAROUND section,
and causes a warning if that is disabled:

drivers/clocksource/arm_arch_timer.c:323:20: error: 'arm64_1188873_read_cntvct_el0' defined but not used [-Werror=unused-function]

Since the erratum requires that we always apply the workaround
in the timer driver, select that symbol as we do for SoC
specific errata.

Fixes: 95b861a4a6d9 ("arm64: arch_timer: Add workaround for ARM erratum 1188873")
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Bin Yu <jkchen@linux.alibaba.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Reviewed-by: zou cao <zoucao@linux.alibaba.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-21 16:49:44 +05:30
Danny Lin
50c884b258 ARM64/configs: surya: Enable LLVM Polly
This brings a 14% improvement in hackbench times without LTO and 10%
with LTO, according to my new tests [1] on Proton Clang 11.0.0 build
20200307.

Flags used: hackbench -pTl 4000

[1] https://docs.google.com/spreadsheets/d/1mhjyshujZz8jYI7dMoCe-yFbxymW-fWaC08vMhBbEmQ/edit?usp=sharing

Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-21 14:54:05 +05:30
Danny Lin
22dd266794 kbuild: Add support for LLVM's Polly optimizer
This adds support for compiling the kernel with optimizations offered
by LLVM's polyhedral loop optimizer known as Polly, which can improve
performance by improving cache locality in loops. Note that LLVM is not
compiled with Polly by default -- it must be enabled explicitly.

[ghostrider-reborn]
- Removed polly DCE as it's no longer supported

Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
2021-03-21 14:52:48 +05:30
Sultan Alsawaf
9d2d6e9568 mm: Micro-optimize PID map reads for arm64
Android and various applications in Android need to read PID map data in
order to work. Some processes can contain over 10,000 mappings, which
results in lots of time wasted on simply generating strings. This wasted
time adds up, especially in the case of Unity-based games, which utilize
the Boehm garbage collector. A game's main process typically has well
over 10,000 mappings due to the loaded textures, and the Boehm GC reads
PID maps several times a second. This results in over 100,000 map
entries being printed out per second, so micro-optimization here is
important. Before this commit, show_vma_header_prefix() would typically
take around 1000 ns to run on a Snapdragon 855; now it only takes about
50 ns to run, which is a 20x improvement.

The primary micro-optimizations here assume that there are no more than
40 bits in the virtual address space, hence the CONFIG_ARM64_VA_BITS
check. Arm64 uses a virtual address size of 39 bits, so this perfectly
covers it.

This also removes padding used to beautify PID map output to further
speed up reads and reduce the amount of bytes printed, and optimizes the
dentry path retrieval for file-backed mappings.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2021-03-21 10:49:18 +05:30
Sultan Alsawaf
0874896503 dma-buf/sync_file: Speed up ioctl by omitting debug names
A lot of CPU time is wasted on allocating, populating, and copying
debug names back and forth with userspace when they're not actually
needed. We can't just remove the name buffers from the various sync data
structures though because we must preserve ABI compatibility with
userspace, but instead we can just pretend the name fields of the
user-shared structs aren't there. This massively reduces the sizes of
memory allocated for these data structures and the amount of data passed
between userspace, as well as eliminates a kzalloc() entirely from
sync_file_ioctl_fence_info(), thus improving graphics performance.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
2021-03-21 10:48:23 +05:30
Adithya R
7df24ab4f8 ARM64/configs: surya: Lower CPUBW devfreq boost freq 2021-03-20 17:51:30 +05:30
Sultan Alsawaf
2632f6611c msm: adreno: Relax CPU latency requirements to save power
Relaxing the CPU latency requirement by about 500 us won't significantly
hurt graphics performance. On the flip side, most SoCs have many idle
levels just below 1000 us in latency, with deeper idle levels having
latencies in excess of 2000 us. Changing the latency requirement to
1000 us allows most SoCs to use their deepest sub-1000-us idle state
while the GPU is active.

Additionally, since the lpm driver has been updated to allow power
levels with latencies equal to target latencies, change the wakeup
latency from 101 to 100 for clarity.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2021-03-20 17:51:30 +05:30
Sultan Alsawaf
52e3b11931 cpuidle: lpm-levels: Allow exit latencies equal to target latencies
This allows pm_qos votes with, say, 100 us for example to select power
levels with exit latencies equal to 100 us. The extra microsecond of
exit latency doesn't hurt.

Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2021-03-20 17:51:30 +05:30
Jia-yi Chen
3175d991df cpuidle: lpm-levels: Change idle policy to always enter C1 first
Change the cpuidle policy to always enter C1 first and set a timer
with a duration of half the C1_max_residency. Once the timer expired,
it can then enter C4.

Bug: 143480592
Test: Verify idle behavior and check power & perf on several use cases.
Change-Id: I3c54e34b7af2f262bd029f48fef4e00620536586
Signed-off-by: Jia-yi Chen <jychen@google.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2021-03-20 17:51:24 +05:30
Jonglin Lee
669730ec1c cpuidle: lpm_levels: Don't print parent clocks during suspend
Calling clock_debug_print_enabled with print_parent = true
during suspend may cause a scheduling while atomic violation.
Call with print_parent = false instead to prevent the violation.

Bug: 132511008
Change-Id: I80f646d77d0cc98b4004084022ce1dce0e80cc93
Signed-off-by: Jonglin Lee <jonglin@google.com>
Signed-off-by: Adam W. Willis <return.of.octobot@gmail.com>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2021-03-20 17:50:35 +05:30
Maulik Shah
46f075dab1 cpuidle: Do not select menu and ladder governors
LPM is registered as cpuidle governor. Menu and ladder
governors are not in use. Remove them as they increase
boot up time.

Change-Id: I4a0d13aeb15932f5468704d12c1aa156aae1c507
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
Signed-off-by: mydongistiny <jaysonedson@gmail.com>
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
2021-03-20 17:50:14 +05:30