811963 Commits

Author SHA1 Message Date
Wei Wang
cf21f0078a net: fix race between napi kthread mode and busy poll
Currently, napi_thread_wait() checks for NAPI_STATE_SCHED bit to
determine if the kthread owns this napi and could call napi->poll() on
it. However, if socket busy poll is enabled, it is possible that the
busy poll thread grabs this SCHED bit (after the previous napi->poll()
invokes napi_complete_done() and clears SCHED bit) and tries to poll
on the same napi. napi_disable() could grab the SCHED bit as well.
This patch tries to fix this race by adding a new bit
NAPI_STATE_SCHED_THREADED in napi->state. This bit gets set in
____napi_schedule() if the threaded mode is enabled, and gets cleared
in napi_complete_done(), and we only poll the napi in kthread if this
bit is set. This helps distinguish the ownership of the napi between
kthread and other scenarios and fixes the race issue.

Fixes: 29863d41bb6e ("net: implement threaded-able napi poll loop support")
Reported-by: Martin Zaharinov <micron10@gmail.com>
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Wei Wang <weiwan@google.com>
Cc: Alexander Duyck <alexanderduyck@fb.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit cb038357937ee4f589aab2469ec3896dce90f317)
Change-Id: Idd1d67f6f4620dc332fa61918616dcf29137a44f
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
2024-11-20 01:23:51 -03:00
Wei Wang
8a0614b22b net: add sysfs attribute to control napi threaded mode
This patch adds a new sysfs attribute to the network device class.
Said attribute provides a per-device control to enable/disable the
threaded mode for all the napi instances of the given network device,
without the need for a device up/down.
User sets it to 1 or 0 to enable or disable threaded mode.
Note: when switching between threaded and the current softirq based mode
for a napi instance, it will not immediately take effect if the napi is
currently being polled. The mode switch will happen for the next time
napi_schedule() is called.

Co-developed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Co-developed-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Co-developed-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Wei Wang <weiwan@google.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5fdd2f0e5c64846bf3066689b73fc3b8dddd1c74)
Change-Id: I0a1616d1cc8a89ba9aa6500c1b7daa171c793632
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Dark-Matter7232 <me@const.eu.org>
2024-11-20 01:23:51 -03:00
Wei Wang
5ac17dec2c net: implement threaded-able napi poll loop support
This patch allows running each napi poll loop inside its own
kernel thread.
The kthread is created during netif_napi_add() if dev->threaded
is set. And threaded mode is enabled in napi_enable(). We will
provide a way to set dev->threaded and enable threaded mode
without a device up/down in the following patch.

Once that threaded mode is enabled and the kthread is
started, napi_schedule() will wake-up such thread instead
of scheduling the softirq.

The threaded poll loop behaves quite likely the net_rx_action,
but it does not have to manipulate local irqs and uses
an explicit scheduling point based on netdev_budget.

Co-developed-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Co-developed-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Co-developed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Wei Wang <weiwan@google.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 29863d41bb6e1d969c62fdb15b0961806942960e)
Change-Id: Ifa5817efd5b1a999ae57e8c79accd8b390682e78
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Dark-Matter7232 <me@const.eu.org>
2024-11-20 01:23:50 -03:00
Felix Fietkau
c0f48953ad net: extract napi poll functionality to __napi_poll()
This commit introduces a new function __napi_poll() which does the main
logic of the existing napi_poll() function, and will be called by other
functions in later commits.
This idea and implementation is done by Felix Fietkau <nbd@nbd.name> and
is proposed as part of the patch to move napi work to work_queue
context.
This commit by itself is a code restructure.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Wei Wang <weiwan@google.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 898f8015ffe74118e7b461827451f2cc6e51035b)
Change-Id: I9a9eda5244cad79d52736ee779dd5a139f297ff0
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Dark-Matter7232 <me@const.eu.org>
2024-11-20 01:23:50 -03:00
Adrian Salido
08485a64ca drm/msm/sde: Fix brightness level mapping
The current brightness level mapping does not correctly map the
brightness level range from user space to the range supported by the
panel.

For example if the max user brightness reported is 4095, and panel
backlight range is 0-255. Then user is expected to be able to set
brightness in range from 0-4095, but current logic truncates at
bl-max (255). Moreover it doesn't take into account bl-min.

Fix logic such that the brightness range set by user correctly scales to
the backlight level from panel.

Bug: 139263611
Change-Id: Ic70909af63fb5b66ebc1434477f2fc41a785ce1f
Signed-off-by: Adrian Salido <salidoa@google.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-20 01:16:25 -03:00
Richard Raya
0045c1cc39 Revert "ARM64/dts: qcom: Set panels' mdss-brightness-max-level to 255"
This reverts commit 25848979e68b7b1a4ce0c7b9f6f1ef659821d020.

Change-Id: If4f1a46b037eec06b0d196b69f30c6949b0801c4
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-20 01:08:06 -03:00
Park Ju Hyung
790093d31c ufshcd: Always show bogus clkscale_enable
libqti-perfd.so is accessing this sysfs entry but we deliberately
disabled this feature.

Show a bogus entry instead to avoid poor userspace handling.

Change-Id: I16c120122ea8a22b5b85b6fb8d5fad3c0d197396
Signed-off-by: Park Ju Hyung <qkrwngud825@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-19 23:55:52 -03:00
Sultan Alsawaf
f696289f34 af_unix: Block perfd from writing to the logd socket
The logcat spam from perfd when the kernel doesn't have everything it
wants destroys logcats and creates excessive logd overhead from the sheer
number of logs it prints.

Block perfd from writing to the logd socket so that it cannot write to
logcat at all. This way, all perfd attempts to write to logcat are
killed early on before they can incur overhead, which solves the excessive
logd overhead problem.

Change-Id: I9489c5eb8c041b998affd154d1beca82459b5fcc
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-19 23:55:52 -03:00
Richard Raya
34084e75c4 build.sh: Clone Slim LLVM from bitbucket
Change-Id: Ic2a44e0ed994c163dad5995a8323f43b9f092691
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-19 17:59:20 -03:00
Richard Raya
104d922377 defconfig: Disable LLVM Polly
Change-Id: I27a458832aff00fefc9708a6f29f16b3e48b4714
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-18 18:24:20 -03:00
Richard Raya
dfed0b3e53 Makefile: Disable LLVM RegAlloc
Change-Id: I2adb66b098e1f7888af81becab1648764d504561
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-18 18:24:08 -03:00
Richard Raya
fa60e2d29c build.sh: Switch to Slim LLVM 19
Change-Id: I1d20fe92febb772b0b2d337e4b5a9e237b5f5fac
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-18 18:24:07 -03:00
Richard Raya
855809ede2 defconfig: Regenerate full defconfig
Change-Id: I486e370dcf7397639b35560859b8911414e6df86
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-17 13:34:57 -03:00
John Galt
cdbfa4d008 binder: Checkout to android12-5.10-lts
aace49fbad

Change-Id: I8c17b1083f282a29e220c01bddebf2bff49ae09e
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-17 13:29:48 -03:00
Jason A. Donenfeld
90ddee3126 random: Don't forget compat_ioctl on urandom
Recently, there's been some compat ioctl cleanup, in which large
hardcoded lists were replaced with compat_ptr_ioctl. One of these
changes involved removing the random.c hardcoded list entries and adding
a compat ioctl function pointer to the random.c fops. In the process,
urandom was forgotten about, so this commit fixes that oversight.

Fixes: 5b6250bc43fa ("compat_ioctl: Remove /dev/random commands")
Link: https://lore.kernel.org/r/20191217172455.186395-1-Jason@zx2c4.com
Change-Id: Id9cdb89a957c34a9ccbb8b96386a77fcf67815e1
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-17 13:08:20 -03:00
Arnd Bergmann
5b6250bc43 compat_ioctl: Remove /dev/random commands
These are all handled by the random driver, so instead of listing
each ioctl, we can use the generic compat_ptr_ioctl() helper.

Change-Id: I3271ba0b0b3d6ae904cc87f983d7d3f99935e767
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-17 13:03:59 -03:00
Arnd Bergmann
0876ea375c fs: Add compat_ptr_ioctl()
Many drivers have ioctl() handlers that are completely compatible between
32-bit and 64-bit architectures, except for the argument that is passed
down from user space and may have to be passed through compat_ptr()
in order to become a valid 64-bit pointer.

Using ".compat_ptr = compat_ptr_ioctl" in file operations should let
us simplify a lot of those drivers to avoid #ifdef checks, and convert
additional drivers that don't have proper compat handling yet.

On most architectures, the compat_ptr_ioctl() just passes all arguments
to the corresponding ->ioctl handler. The exception is arch/s390, where
compat_ptr() clears the top bit of a 32-bit pointer value, so user space
pointers to the second 2GB alias the first 2GB, as is the case for native
32-bit s390 user space.

The compat_ptr_ioctl() function must therefore be used only with
ioctl functions that either ignore the argument or pass a pointer to a
compatible data type.

If any ioctl command handled by fops->unlocked_ioctl passes a plain
integer instead of a pointer, or any of the passed data types is
incompatible between 32-bit and 64-bit architectures, a proper handler
is required instead of compat_ptr_ioctl.

Change-Id: Ic216898976f9369d6f8a316bf75eb9d8a00386fe
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-17 13:03:44 -03:00
Eric W. Biederman
ba1344d216 fs: Rename __close_fd_get_file close_fd_get_file
The function close_fd_get_file is explicitly a variant of
__close_fd[1].  Now that __close_fd has been renamed close_fd, rename
close_fd_get_file to be consistent with close_fd.

When __alloc_fd, __close_fd and __fd_install were introduced the
double underscore indicated that the function took a struct
files_struct parameter.  The function __close_fd_get_file never has so
the naming has always been inconsistent.  This just cleans things up
so there are not any lingering mentions or references __close_fd left
in the code.

[1] 80cd795630d6 ("binder: fix use-after-free due to ksys_close() during fdget()")
Link: https://lkml.kernel.org/r/20201120231441.29911-23-ebiederm@xmission.com
Change-Id: I191f5fa6c99112d22e90566727433a9314d2bb00
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-17 13:03:39 -03:00
Andrzej Perczak
2dda8cabbc fs: Add __close_fd_get_file() for binder
Change-Id: I9fe7c84d1b81fd8e2ef0ad89361c615c62693593
Signed-off-by: Andrzej Perczak <linux@andrzejperczak.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-17 13:03:36 -03:00
Richard Raya
21cf7c1d6a Revert "sched/fair: Process new forks before processing their parent"
This reverts commit 0831006b9b90d3bf775cd785e5d94e0682217d45.

Change-Id: Id8203ad7313490cd440602346a1d48e811f60484
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-07 22:14:13 -03:00
Adithya R
77c41a8819 subsystem_restart: Do not panic kernel in any case
* recent fw updates are causing adsp to crash randomly,
   such as during calls with live caption enabled

 * in this specific case per my testing, instead of panicking
   kernel and rebooting device, subsystem restart works just
   fine with only a temporary loss of call audio for 1-2s

 * __subsystem_restart_dev() panics the kernel anyway if ssr
   fails so it would never enter an infinite loop

Change-Id: Ic508b9b61d25d0163bd1c9c5fef645eca26679ee
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-06 13:08:38 -03:00
Richard Raya
b21388f3a1 Revert "subsystem_restart: Update crash status as subsystem start"
This reverts commit 20f762702f50d7410d59fe88b7187275d09cbb20.

Change-Id: I14453fc22f4c67fc5a918868fc3c87181af4f4fc
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-06 13:08:37 -03:00
Richard Raya
4febc4a781 Revert "subsystem_restart: Add delay before SSR power-up failure panics"
This reverts commit 7835e1ac9fe9bc3a1d58644f3d289d187ba881c6.

Change-Id: Ideb0f921d30572bcf69a16d7565ba6b3621832f4
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-06 13:08:36 -03:00
Richard Raya
85d7ba20e9 defconfig: Enable process reclaim
Change-Id: I30c73cf1c53214445d6bc28205cae1d4ce14ebb1
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-04 21:00:02 -03:00
Danny Lin
46c8c57dc0 mm: reclaim: Bump maximum pages per reclaim attempt
4 MiB isn't a meaningful amount to reclaim. Bump the limit to 32 MiB
instead.

Change-Id: I92fc9b35d121e6b39bced13d549e59d9e8e668e8
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-04 20:59:55 -03:00
Vinayak Menon
bbfdce557a mm: reclaim: Consider compound pages
Avoid passing tail pages to isolate_lru_page. In the case
process reclaim, since only lru pages are considered, this
is just to avoid a warning from isolate_lru_page.

Change-Id: I1f54dcec15f8c2d5ba16738657e79d2793d36c77
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-04 20:59:50 -03:00
fangqinwu
1106a5ab06 mm: reclaim: Optimize process reclaim
BSPSYS-10620

This change includes:
 - fix reclaim count calculation issue
 - only reclaim un-shared pages
 - avoid burning CPU when nr_to_reclaim pages
 - export reclaim_pte_range() API for rtmm

Change-Id: I04e77a2811f5ac4cae6d261c3eaaf88e26eee2ce
Signed-off-by: fangqinwu <fangqinwu@xiaomi.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-04 20:59:45 -03:00
laoyi
b0375d3527 procfs: Update perms of process reclaim node
Other userspace apps like AppCOmpaction would like to use this node,
so update permission.

Change-Id: Ied22bd6ad489bef4028cde943ac185d1354ab971
Signed-off-by: <laoyi@codeaurora.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-04 20:59:39 -03:00
Richard Raya
51fa5b462c Revert "ARM64/dts: sdmmagpie: Disable expedited RCU grace periods"
This reverts commit c4da2896278405a71e10a3abe9639aff9b121d78.

Change-Id: I2df812002f8b1c234f173f014417d7cc7ef6829d
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-04 20:34:41 -03:00
Richard Raya
524555dc94 defconfig: Enable QTI Thermal LMH DCVS
Change-Id: Iab47884e2dea3d0ca9e59a27db13aea2574001ef
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-03 18:45:56 -03:00
Richard Raya
6c8d4d7265 Revert "adreno_tz: Remove ceiling and adjust busy time calculation"
This reverts commit 3736be6732067d480b95402c4e07239ed5145518.

Change-Id: I45d63b2a84f26da5a346c10670ed6adf46e635d1
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-03 18:44:12 -03:00
Richard Raya
20adaba910 defconfig: Disable PStore
Change-Id: Iaf776d1d4cc91e7e95d1f554a49c5bdcc6a46c7d
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-03 18:44:08 -03:00
Richard Raya
5651461fdf Revert "ARM64/dts: sdmmagpie: Configure ramoops parameters"
This reverts commit 094480a0881f1ad67e38bf7a92173fe0d88951f0.

Change-Id: I5d022039dd506a1b6bae6bb60bffc19f545c9bcb
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-03 18:44:05 -03:00
Richard Raya
875ee0e504 kernel_headers: Add uvc-new
Change-Id: I4efb6ad27234db80215bc98ff6de601df3a9133f
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-02 21:17:39 -03:00
Richard Raya
094480a088 ARM64/dts: sdmmagpie: Configure ramoops parameters
Change-Id: I1f289cfe2272a30e9255fe276b7154348f5b9ea4
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-02 20:13:40 -03:00
Richard Raya
e2ba49f64b ARM64/dts: sdmmagpie: Configure 50Hz refresh rate nodes
Change-Id: I53225d02dfbdddab098c4ebdf0c499c9a6d7252e
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-02 20:12:02 -03:00
Danny Lin
c4da289627 ARM64/dts: sdmmagpie: Disable expedited RCU grace periods
Similar to what I've done on other devices, revert to normal grace
periods to reduce power usage. Expedited RCU hammers CPUs with IPIs to
reduce grace period durations and thus RCU latency, but that disrupts
busy CPUs and causes unnecessary wakeups while providing little to no
improvement in real-world performance.

Change-Id: I230dc7283da50108171937876c60c8f13e4ace4e
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-02 20:11:41 -03:00
Richard Raya
ff20ee02f1 Revert "rcu: Force rcu_expedited for Android"
This reverts commit e17aedc1fa5020b943f8f557f4795668737e8362.

Change-Id: I880ad0558e2bdd26ffb86ac36380dfd5f132e0bc
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-02 20:11:24 -03:00
str143
794a9d670f cfq: Disable group idle
OEMs disable it to improve throughput.

Change-Id: I9116c008cffc78c08e812adca6794d07794171ef
Signed-off-by: minaripenguin <minaripenguin@users.noreply.github.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-02 02:51:22 -03:00
Arjan van de Ven
b8123c7edf jbd2: Increase the ext4 default commit age
Both the VM and EXT4 have a "commit to disk after X seconds" time.
Currently the EXT4 time is shorter than our VM time, which is a bit
suboptional,
it's better for performance to let the VM do the writeouts in bulk
rather than something deep in the journalling layer.

Change-Id: I0de7bcfa9487421954cb9ae7f2cab3159c663878
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-02 02:51:22 -03:00
stic-server-open
2ce372bb72 nt36xxx: Import sched parameters from pipa-t-oss
Change-Id: Ib848afb316d395f4542d0b87c38695e19b76563f
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-02 02:51:17 -03:00
Wei Wang
24ff5a6d6e sched/fair: Balance for big cluster
Android will unset SD_LOAD_BALANCE for big cluster domain and
for some product it is true to have a big cluster and the MC
domain thus lacks the SD_LOAD_BALANCE flag. This will cause
select_task_rq_fair logic break and the task will spin forever
in that cluster.

Bug: 141334320
Fixes: 00bbe7d605a9 "ANDROID: sched: EAS & 'single cpu per cluster'/cpu hotplug interoperability"
Test: boot and see task on core7 scheduled correctly
Change-Id: I7c2845b1f7bc1d4051eb3ad6a5f9838fb0b1ba04
Signed-off-by: Wei Wang <wvw@google.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-02 02:49:54 -03:00
Qais Yousef
23cff86f77 sched/fair: Don't update misfit status if the task is pinned
If the task is pinned to a cpu, setting the misfit status means that
we'll unnecessarily continuously attempt to migrate the task but fail.

This continuous failure will cause the balance_interval to increase to
a high value, and eventually cause unnecessary significant delays in
balancing the system when real imbalance happens.

Caught while testing uclamp where rt-app calibration loop was pinned to
cpu 0, shortly after which we spawn another task with high util_clamp
value. The task was failing to migrate after over 40ms of runtime due to
balance_interval unnecessary expanded to a very high value from the
calibration loop.

Not done here, but it could be useful to extend the check for pinning to
verify that the affinity of the task has a cpu that fits. We could end
up in a similar situation otherwise.

Fixes: 3b1baa6496e6 ("sched/fair: Add 'group_misfit_task' load-balance type")
Change-Id: I18be95658c3c06faec02ff2fce77c89540e83ebc
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-02 02:28:10 -03:00
huangzq2
872461aee4 mm: Abort reclaim once process goes to foreground
App compaction can not be aborted due to current design,
it causes app get stuck for a while when it resume to foreground
if app is compacting by kernel. So now we add check in kernel
while loop to abort the compaction if adj is zero.

Change-Id: I16f36a08d1a5efcb36827e84f5058abfa0a7dae0
Signed-off-by: huangzq2 <huangzq2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2014822
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-02 02:27:25 -03:00
Patrick Daly
6c1efde3d9 mm/oom-kill: Adjust oom_badness per Android expectations
Allow selecting only tasks with oom_score_adj >= 0.

Change-Id: Iebbb487c711da98b8fcb367ba838b5fe0b260d4f
Signed-off-by: Patrick Daly <pdaly@codeaurora.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-02 02:27:24 -03:00
Sebastian Andrzej Siewior
297959f09c mm/compaction: Really limit compact_unevictable_allowed to 0 and 1
The proc file `compact_unevictable_allowed' should allow 0 and 1 only, the
`extra*' attribues have been set properly but without
proc_dointvec_minmax() as the `proc_handler' the limit will not be
enforced.

Use proc_dointvec_minmax() as the `proc_handler' to enfoce the valid
specified range.

Link: http://lkml.kernel.org/r/20200303202054.gsosv7fsx2ma3cic@linutronix.de
Change-Id: I7ba356dac5d11ef0c1bbf4509fa61459f35a0a8f
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Iurii Zaikin <yzaikin@google.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-02 02:26:27 -03:00
Richard Raya
ac5d61e88f Revert "dsi: dsi_phy: enable phy poweroff"
This reverts commit dcd2f048585afbaf334fab83607d28cee2c1f1ed.

Change-Id: Ia6991c9093b516ae5b5915c06f468b3b47a6b8a7
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-02 02:04:01 -03:00
Kees Cook
fc8726b63d printk: Collapse shutdown types into a single dump reason
To turn the KMSG_DUMP_* reasons into a more ordered list, collapse
the redundant KMSG_DUMP_(RESTART|HALT|POWEROFF) reasons into
KMSG_DUMP_SHUTDOWN. The current users already don't meaningfully
distinguish between them, so there's no need to, as discussed here:
https://lore.kernel.org/lkml/CA+CK2bAPv5u1ih5y9t5FUnTyximtFCtDYXJCpuyjOyHNOkRdqw@mail.gmail.com/

Link: https://lore.kernel.org/lkml/20200515184434.8470-2-keescook@chromium.org/
Change-Id: I23f5d8ed4b16c2b506b1727abfe2b40bb9dc6db0
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Reviewed-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-01 22:39:10 -03:00
Kees Cook
112fd2c855 pstore: Introduce max_reason and convert dump_oops
Now that pstore_register() can correctly pass max_reason to the kmesg
dump facility, introduce a new "max_reason" module parameter and
"max-reason" Device Tree field.

The "dump_oops" module parameter and "dump-oops" Device
Tree field are now considered deprecated, but are now automatically
converted to their corresponding max_reason values when present, though
the new max_reason setting has precedence.

For struct ramoops_platform_data, the "dump_oops" member is entirely
replaced by a new "max_reason" member, with the only existing user
updated in place.

Additionally remove the "reason" filter logic from ramoops_pstore_write(),
as that is not specifically needed anymore, though technically
this is a change in behavior for any ramoops users also setting the
printk.always_kmsg_dump boot param, which will cause ramoops to behave as
if max_reason was set to KMSG_DUMP_MAX.

Link: https://lore.kernel.org/lkml/20200515184434.8470-6-keescook@chromium.org/
Change-Id: I563849afcc4975f36b616c2976202df92cfe4d14
Co-developed-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-01 22:39:10 -03:00
Pavel Tatashin
2cc05debe6 pstore: Pass max_reason to kmesg dump
Add a new member to struct pstore_info for passing information about
kmesg dump maximum reason. This allows a finer control of what kmesg
dumps are sent to pstore storage backends.

Those backends that do not explicitly set this field (keeping it equal to
0), get the default behavior: store only Oopses and Panics, or everything
if the printk.always_kmsg_dump boot param is set.

Link: https://lore.kernel.org/lkml/20200515184434.8470-5-keescook@chromium.org/
Change-Id: Iedf5f428a0bdb38f1fe5effa6226292b7144bd95
Co-developed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Pavel Tatashin <pasha.tatashin@soleen.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
2024-11-01 22:39:10 -03:00