This reverts commit ed3425bab089e971abd263fca7377e8450ea5e66.
Change-Id: Ie35c37b4feab62b00e03d81f4a79f783bcf6cd6f
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit a42bd2ac50d8e617fb513e0632c759a91285526a.
Change-Id: Icc2feebfdbe53a98c8d6ec150a7f52b32c523846
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit 5caa8628e501315ffaaad003594ccca490145661.
Reason for revert: We do not use C2 for video, this is useful for OMX.
Change-Id: I2bdd191313300e86a108087a1854252dc457f54c
Signed-off-by: Omkar Chandorkar <gotenksIN@aospa.co>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
It's useful for me because I have to use standard chargers frequently.
Change-Id: I5aef00ce13f2b89e78c9b6349603be8855ca0917
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Change-Id: I6dbc2144869f6ef06e33d83b9af7814a19534ba6
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit 1593bd8183dd337c81c5b4eb9ac629c3d90d4a4e.
Change-Id: I4604276fa8a9ea6341017f4c27d8d02328a31ff2
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit be3df9c273a934b44a089a498e83718a46e55304.
Change-Id: Ief4f4aea6e2840aa2bd09d613d2abeb5610728ef
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit 05bab47794fa05c106068c7f594fb50bb825a377.
Change-Id: Ie12e180bfb50657d8de8a6aa1e8c00e457613f41
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit c3058fc912b3ecd2f3ce2ebabf4358dba8289633.
Change-Id: I3e0333af0e8917ab9706470eb4ddce23155a93f2
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit 112243ebc3bbd5fe01d77cdba303be7e02940e0e.
Change-Id: I4542c494340ee6014540e7b29a222e8aa8101ab7
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit f30864ac4b769ae63c2308d84e040ac64a7951c5.
Change-Id: I57de115b27e276106de769dd83506d33991e132e
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit b0127a3d65c026ed584c0c427f97b3563ce04952.
Change-Id: Ied7e769dbce1f6c5ab2055dc63b9de3b0b5d083c
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
[ Upstream commit 44b73962cb25f1c8170ea695c4564b05a75e1fd4 ]
When a process dies, failed reply is sent to the sender of any transaction
queued on a dead thread's todo list. The sender asserts that the
received failed reply corresponds to the head of the transaction stack.
This assert can fail if the dead thread is allowed to send outgoing
transactions when there is already a transaction on its todo list,
because this new transaction can end up on the transaction stack of the
original sender. The following steps illustrate how this assertion can
fail.
1. Thread1 sends txn19 to Thread2
(T1->transaction_stack=txn19, T2->todo+=txn19)
2. Without processing todo list, Thread2 sends txn20 to Thread1
(T1->todo+=txn20, T2->transaction_stack=txn20)
3. T1 processes txn20 on its todo list
(T1->transaction_stack=txn20->txn19, T1->todo=<empty>)
4. T2 dies, T2->todo cleanup attempts to send failed reply for txn19, but
T1->transaction_stack points to txn20 -- assertion failes
Step 2. is the incorrect behavior. When there is a transaction on a
thread's todo list, this thread should not be able to send any outgoing
synchronous transactions. Only the head of the todo list needs to be
checked because only threads that are waiting for proc work can directly
receive work from another thread, and no work is allowed to be queued
on such a thread without waking up the thread. This patch also enforces
that a thread is not waiting for proc work when a work is directly
enqueued to its todo list.
Acked-by: Arve Hjønnevåg <arve@android.com>
Reviewed-by: Martijn Coenen <maco@android.com>
Signed-off-by: Sherry Yang <sherryy@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Change-Id: Ief18e5c6e478ae7347b4e7c4a955edb8841cf17f
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Most of binder's memory allocations are tiny, and they're allocated
and freed extremely frequently. The latency from going through the page
allocator all the time for such small allocations ends up being quite
high, especially when the system is low on memory. Binder is
performance-critical, so this is suboptimal.
Instead of using kzalloc to allocate a struct every time, reserve caches
specifically for allocating each struct quickly.
Change-Id: I535d8eb25730babf404c1f9c5d917afcebd63f6e
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Sending synchronous IPIs to other CPUs involves spinning with preemption
disabled in order to wait for each IPI to finish. Keeping preemption off
for long periods of time like this is bad for system jitter, not to mention
the watchdog's IPIs are sent and flushed one at a time for each CPU rather
than all at once for all the CPUs to be pinged.
Since the existing IPI ping machinery is quite lacking, rewrite it entirely
to address all of its performance shortcomings. This not only replaces the
synchronous IPIs with asynchronous ones, but also allows the IPIs to run in
parallel. The IPI ping and wait mechanisms are now much more efficient via
the use of generic_exec_single() (since smp_call_function_single_async()
disables preemption when all it really needs is migration disabled), and
by sleeping rather than spinning while waiting for the IPIs to finish.
This also does away with the ping_start and ping_end arrays as they don't
make sense with the parallel, asynchronous execution of the IPIs anymore.
They are instead replaced by a mask indicating which CPUs were pinged so
that a watchdog bark can still print out which CPU(s) stopped responding.
[Ken: Replace migrate_{disable|enable} with preempt_{disable|enable}]
Change-Id: Icf34a7b7e7f390b4db38c31207f7e667eb634eba
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: KenHV <yo@kenharris.xyz>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
generic_exec_single() is quite handy for sending asynchronous IPIs without
the baggage that comes with smp_call_function_single_async(). Make it
public so that it can be (carefully) utilized.
Change-Id: I4fc994e8449895b00c5cd455b01c1bcce5c0aac5
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit 919eece679cd1097f13cbb9208e3f1f7668fac6a.
Change-Id: Id71d1a079d09a1aeff9c292f49d2486b28713ea9
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit 5f250a3f69b949eefec8a1062b3d64a32088047a.
Change-Id: I7cc97556c79dc85f0152092c6cdb175a2d48daa6
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit f1786dc2072e9343706e84c5935d156766114c23.
Change-Id: I2c90d025a74f260848e0edc6d31035a282e146e2
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This fixes the -Wfortify-source warning detected on Clang 18.0.0.
../drivers/media/platform/msm/camera/cam_utils/cam_io_util.c:270:4: warning: 'snprintf' will always be truncated; specified size is 12, but format string expands to at least 13 [-Wfortify-source]
270 | snprintf(p_str, 12, "0x%08x: ",
| ^
../drivers/media/platform/msm/camera/cam_utils/cam_io_util.c:275:3: warning: 'snprintf' will always be truncated; specified size is 10, but format string expands to at least 11 [-Wfortify-source]
275 | snprintf(p_str, 10, "%08x ", data);
| ^
../drivers/media/platform/msm/camera/cam_sensor_module/cam_csiphy/cam_csiphy_soc.c:46:4: warning: 'snprintf' will always be truncated; specified size is 12, but format string expands to at least 13 [-Wfortify-source]
46 | snprintf(p_str, 12, "0x%08x: ",
| ^
../drivers/media/platform/msm/camera/cam_sensor_module/cam_csiphy/cam_csiphy_soc.c:51:3: warning: 'snprintf' will always be truncated; specified size is 9, but format string expands to at least 10 [-Wfortify-source]
51 | snprintf(p_str, 9, "%08x ", data);
| ^
Change-Id: Ie444da3af1456d5ca5dc8230768bf172a3ac6ed3
Signed-off-by: Fiqri Ardyansyah <fiqri0927936@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Small output size increase and build time increase due to additional vectorization and unrolling
Change-Id: I9b7ad449f7067342fae674a1d8b8efce51d3786c
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
KBUILD_LDFLAGS and LDFLAGS are the same Makefile variables.
And LDFLAGS was renamed to KBUILD_LDFLAGS in upstream.
Therefore, both of them do the same work, means they both
pass the flags exactly the same to the linker. Therefore,
drop the deprecated variable's usage and the flags that were
passed using it.
Change-Id: I94bfce9681e62b186682c4726cf96854b8c445bb
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
[Tashar02: Add the flags in a CONFIG_LTO_CLANG and don't use cc-name, use just -O3 if not using clang LTO]
Change-Id: I012ddb58dc56881160f8fc7488400b3f4a1dbe52
Co-authored-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
If any code doesn't work with this optimisation, then it's the
code that should be fixed. One such example is commit 6bf676723ab2a6ade05feb2cd0b5073930f72d7e
("Staging: agnx: Move a dereference below a NULL test").
Change-Id: Idc132837d7173a00dd041af08c4f5ae624d3aae9
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This flag is specific to clang, where it is only used by the 32-bit and
64-bit ARM backends. In certain situations, the presence of this flag
will cause a warning, as shown by commit 6580c5c18fb3 ("um: clang: Strip
out -mno-global-merge from USER_CFLAGS").
Since commit 61163efae020 ("kbuild: LLVMLinux: Add Kbuild support for
building kernel with Clang") that added this flag back in 2014, there
have been quite a few changes to the GlobalMerge pass in LLVM. Building
several different ARCH=arm and ARCH=arm64 configurations with LLVM 11
(minimum) and 15 (current main version) with this flag removed (i.e.,
with the default of '-mglobal-merge') reveals no modpost warnings, so it
is likely that the issue noted in the comment is no longer relevant due
to changes in LLVM or modpost, meaning this flag can be removed.
If any new warnings show up that are a result of the removal of this
flag, it can be added back under arch/arm{,64}/Makefile to avoid
warnings on other architectures.
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: David Gow <davidgow@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Change-Id: Ice39a960619319828b83c8091798fe383395a2b0
Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This change limits function inlining across translation unit boundaries
in order to reduce the binary size with LTO. The -import-instr-limit
flag defines a size limit, as the number of LLVM IR instructions, for
importing functions from other TUs, defaulting to 100.
Based on testing with arm64 defconfig, we found that a limit of 5 is a
reasonable compromise between performance and binary size, reducing the
size of a stripped vmlinux by 11%.
Suggested-by: George Burgess IV <gbiv@google.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20201211184633.3213045-5-samitolvanen@google.com
Change-Id: I1e4694636d2b39a2f9d541a0c7cfd0e5e3de4d3a
Signed-off-by: Divyanshu-Modi <divyan.m05@gmail.com>
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This reverts commit 3dc59ee906e2b005ff5a547ede72a9a7095046c0.
Change-Id: Ic95d637254af23ffaa4157d5f11716f465a3d09b
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Without this change throttling would get stuck in enabled state forever.
This leads to a regression in Geekbench 5 single-core score
from 760 to 620 on 2-3 run, forever.
Change-Id: I3aadc768d84f1be61f10e5ba53069d115a267ff7
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
Change-Id: I802cd25298f98e4731b667b2db87895e1091de21
Signed-off-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>