Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
cfae0b0
drivers: Add KSU config path
neobuddy89 Feb 6, 2025
0a94469
drivers: Import KernelSU-Next legacy-susfs-v2
neobuddy89 Jul 9, 2026
6bea26a
drivers: Rename make files for kernelsu inline build
neobuddy89 May 3, 2026
6c330ec
drivers: Set proper version for KernelSU-Next
neobuddy89 May 3, 2026
692961f
drivers: Add kernelsu hooks
neobuddy89 Mar 31, 2026
523e3ae
BACKPORT: seccomp: add filter_count field for KernelSU
selfmusing Aug 24, 2025
35a848f
BACKPORT: cred: add get_cred_rcu()
Dec 3, 2018
89d6948
BACKPORT: fs: path_umount for KernelSu
Mar 8, 2024
4ecde2e
proc: add seq_put_decimal_ull_width to speed up /proc/pid/smaps
avagin Apr 10, 2018
eb798d1
procfs: add seq_put_hex_ll to speed up /proc/pid/maps
avagin Apr 10, 2018
883dfb0
mm: /proc/pid/*maps remove is_pid and related wrappers
tehcaster Aug 22, 2018
c84ffb2
mm: /proc/pid/smaps: factor out mem stats gathering
tehcaster Aug 22, 2018
43b491e
mm: /proc/pid/smaps: factor out common stats printing
tehcaster Aug 22, 2018
6273741
mm: /proc/pid/smaps_rollup: convert to single value seq_file
tehcaster Aug 22, 2018
b0d1300
mm/pkeys, powerpc, x86: Provide an empty vma_pkey() in linux/pkeys.h
mpe Apr 11, 2018
b8485db
mm/pkeys: Add an empty arch_pkeys_enabled()
mpe Apr 13, 2018
9ffb8a3
fs/task_mmu: add pkeys header
sidex15 Oct 20, 2025
f702bc7
mm: smaps: split PSS into components
Jul 12, 2019
b9a38fa
proc: less memory for /proc/*/map_files readdir
Feb 6, 2018
e17b366
ida: Lock the IDA in ida_destroy
Jun 21, 2018
092c095
fs: Convert unnamed_dev_ida to new API
Jun 11, 2018
2e89f2e
fs: Convert namespace IDAs to new API
Jun 11, 2018
04ca6b2
fs: implement susfs v2.0.0
sidex15 Dec 14, 2025
02c21d9
fs: susfs: increase DEFAULT_KSU_MNT_ID and DEFAULT_KSU_MNT_GROUP_ID t…
sidex15 Dec 28, 2025
21efe14
fs: susfs: rename susfs_hide_sus_mnts_for_all_procs to susfs_hide_sus…
sidex15 Jan 24, 2026
2b2c36b
fs: susfs: change inode->i_mapping->flags to inode->i_state for stori…
sidex15 Jan 27, 2026
c23db17
fs: susfs: Replaced susfs_is_boot_completed_triggered with susfs_is_s…
sidex15 Jan 30, 2026
0d9e9d8
fs: susfs: Use fsnotify to monitor /sdcard/Android instead of the ker…
sidex15 Feb 4, 2026
38124b4
fs: susfs: Keep checking for ksu domain and assigning sus mnt_group_i…
sidex15 Feb 12, 2026
7c06761
fs: susfs: defer fsnotify cleanup to avoid SRCU self-deadlock
sidex15 Feb 12, 2026
44c3c78
mm/vmscan: add sysctl knobs for protecting the working set
sidex15 Feb 20, 2026
e25ed2d
fs: susfs: Fix potential race issue for SUS_MAP
sidex15 Feb 24, 2026
b5ffce8
fs: susfs: Optimize SUS_MOUNT and other optimizations
sidex15 Mar 3, 2026
3ead1f1
fs: susfs: update sus_path and sus_path_loop to latest susfs 5.10 ups…
sidex15 Mar 11, 2026
8a0afd3
fs: susfs: Better logging for SUS_PATH; Update ksu_susfs
sidex15 Mar 19, 2026
9f99b64
fs: susfs: Refine SUS_KSTAT !!! This commit requires the updated ksu_…
sidex15 Mar 20, 2026
e01d7d3
fs: susfs: More bug fixes and improvements for SUS_MOUNT - Back to us…
sidex15 Mar 20, 2026
eb20cb1
fs: susfs: Fix for another potential race issue for SUS_MOUNT
sidex15 Mar 20, 2026
44b6d11
fs: susfs: sync version v2.1.0 de-inlined
sidex15 Mar 23, 2026
6d9c2c1
fs: susfs: changes and bug fixes for OPEN_REDIRECT, SUS_MAP, and memo…
sidex15 Mar 24, 2026
e5a640b
Fix compiler error related to 'struct kstat'
gavdoc38 Apr 15, 2026
db445cf
Fix missed declarations that should have been renamed/refined
gavdoc38 Apr 15, 2026
3933bc6
fs: susfs: Fix potential race issue and bugs for SUS_KSTAT & OPEN_RED…
sidex15 May 3, 2026
882252a
fs: susfs: Replace all spinlocks with mutexes
sidex15 May 3, 2026
edfe6b1
fs: susfs: Remove redundant entry->target_ino check in hash_for_each_…
sidex15 May 3, 2026
378d05a
fs: susfs: Fix possible kernel panic
sidex15 May 3, 2026
f50f7e1
fs: susfs: Fix fuse path leaking from getdents/readdir syscall variants
sidex15 May 3, 2026
88b9bae
fs: susfs: Re-use mnt_id_ida and mnt_group_ida
sidex15 May 3, 2026
8452186
fs: susfs: defer susfs_run_sus_path_loop() to workqueue
sidex15 May 3, 2026
a13c10f
fs: susfs: Change su domain from 'su' to 'ksu'
gavdoc38 Apr 19, 2026
d588105
kernel: More code improvement and bug fixes for SUS_MAP
sidex15 Jun 21, 2026
a6d9d9c
kernel: SUS_PATH: fix errno leaks for sub paths
sidex15 Jun 21, 2026
68a62bd
fs: susfs: Bump Version to v2.2.0
sidex15 Jun 21, 2026
a5cec02
mm: susfs: implement sus_memfd
sidex15 Jul 3, 2026
59d7a30
drivers: Enable sus_memfd
neobuddy89 Jul 9, 2026
0a793b9
BACKPORT: locking: Introduce __cleanup() based infrastructure
Jul 3, 2026
9c0357e
BACKPORT: rtmutex: Use waiter::task instead of current in remove_wait…
Niebelungen-D Apr 8, 2026
ba655be
BACKPORT: futex/requeue: Prevent NULL pointer dereference in remove_w…
AlexNova-ops Jul 4, 2026
7b88a52
BACKPORT: locking/rtmutex: Skip remove_waiter() when waiter is not en…
Jul 4, 2026
a2cdf38
HACK: mm/bootmem: undef __free
backslashxx Jul 6, 2026
4e1c0a4
HACK: qca-wifi-host-cmn: undef __free
backslashxx Jul 6, 2026
267acf8
Revert "cred: switch to using atomic_long_t"
sidex15 Aug 7, 2024
e6273ad
cred: Add fix for APatch
Jbub5 Mar 1, 2025
0256de7
sys_ptrace: reset ptrace_message on ptrace_check_attach
backslashxx May 29, 2025
ebae0c1
configs: phoenix: Apply performance and responsiveness optimizations
San9588 Jul 24, 2026
37b6beb
dts: phoenix: Optimize fast charging and relax thermal mitigation
San9588 Jul 24, 2026
4467746
build: Enable Polly optimizations and LTO Thin
San9588 Jul 24, 2026
7f48afe
Revert "dts: phoenix: Optimize fast charging and relax thermal mitiga…
San4255 Jul 29, 2026
dbbee01
Makefile: enable Polly loop optimizations for clang builds
San4255 Jul 29, 2026
ba4e083
nt36xxx_mp_ctrlram: replace PAGE_SIZE with sizeof for snprintf buffers
San4255 Jul 29, 2026
960a3bc
KernelSU-Next: refine hook detection in Makefile
San4255 Jul 29, 2026
aa468c7
build: add build.sh script for kernel compilation
San4255 Jul 29, 2026
b106543
defconfig: enable CONFIG_PID_NS
San4255 Jul 29, 2026
ddd6158
power: smb5: Fix aggressive thermal throttling blocking fast charging
San4255 Jul 29, 2026
3fc5901
mm: Comprehensive RAM, storage and CPU optimization for SD730G
San4255 Jul 30, 2026
7377505
mm: Fix vendor init override with delayed workqueue re-apply
San4255 Jul 30, 2026
7bd3dc4
mm: Extract optimization code to mm/opt.c for clean cherry-picks
San4255 Jul 30, 2026
001f06d
mm: Use direct kernel API for optimization (bypass sysfs/SELinux)
San4255 Jul 30, 2026
baf4ba1
Add manual ARM64 build workflow with Telegram notifications
San4255 Jul 31, 2026
cbd4737
Fix ccache step order in build workflow
San4255 Jul 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 164 additions & 0 deletions .github/workflows/build-kernel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
name: Build SM6150 Kernel (ARM64, Manual)

# ------------------------------------------------------------------
# MANUAL TRIGGER ONLY. No push/pull_request/schedule triggers exist,
# so this workflow will never run automatically. Trigger it from:
# Repo -> Actions tab -> "Build SM6150 Kernel (ARM64, Manual)" -> "Run workflow"
# ------------------------------------------------------------------
on:
workflow_dispatch:
inputs:
clean_build:
description: "Run a clean build (sh build.sh clean)"
required: true
type: boolean
default: true

jobs:
build:
# Native ARM64 hosted runner (no QEMU emulation).
runs-on: ubuntu-24.04-arm

steps:
- name: Checkout kernel source
uses: actions/checkout@v4
with:
ref: arena/019f954b-android-kernel-xiaomi-sm6150
fetch-depth: 1 # shallow clone, we don't need full git history

- name: Free up disk space on runner
run: |
echo "Disk usage before cleanup:"
df -h /
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
/opt/hostedtoolcache/CodeQL /usr/local/.ghcup \
/usr/local/share/boost "$AGENT_TOOLSDIRECTORY" 2>/dev/null || true
sudo docker image prune --all --force 2>/dev/null || true
echo "Disk usage after cleanup:"
df -h /

- name: Restore ccache
uses: actions/cache@v4
with:
path: ~/.ccache
# Exact key almost never hits (tied to this commit), so it falls back
# to the newest restore-key below and reuses the last successful cache.
# A fresh cache entry is saved under the exact key at the end of the job.
key: ccache-${{ runner.os }}-arm64-${{ github.sha }}
restore-keys: |
ccache-${{ runner.os }}-arm64-

- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential bc bison flex libssl-dev libelf-dev \
python3 zip unzip git curl kmod cpio rsync ccache \
device-tree-compiler gcc-aarch64-linux-gnu gcc-arm-linux-gnueabi

- name: Configure ccache
run: |
ccache --max-size=3G
ccache --zero-stats
echo "CCACHE_DIR=$HOME/.ccache" >> "$GITHUB_ENV"

- name: Patch build.sh (nproc for JOBS, wrap compiler calls with ccache)
run: |
# JOBS=1 is hardcoded in the script -> single-threaded build. Use all cores instead.
sed -i 's/^JOBS=1$/JOBS=$(nproc --all)/' build.sh

# Route CC / HOSTCC through ccache so repeated builds reuse cached objects.
sed -i 's|CC=\${CLANG_PATH}/clang \\|CC="ccache ${CLANG_PATH}/clang" \\|g' build.sh
sed -i 's|HOSTCC=\${CLANG_PATH}/clang \\|HOSTCC="ccache ${CLANG_PATH}/clang" \\|g' build.sh

echo "----- JOBS line -----"
grep -n '^JOBS=' build.sh
echo "----- CC / HOSTCC lines -----"
grep -n 'CC=' build.sh
echo "Runner has $(nproc --all) cores available"
chmod +x build.sh

- name: Run kernel build
id: build
run: |
set -o pipefail
if [ "${{ github.event.inputs.clean_build }}" = "true" ]; then
./build.sh clean 2>&1 | tee build.log
else
./build.sh 2>&1 | tee build.log
fi

- name: Show ccache stats
if: always()
run: ccache --show-stats

- name: Show output directory contents
if: always()
run: |
echo "----- out/ directory -----"
find out -maxdepth 2 -type f -name "*.zip" 2>/dev/null || echo "No zip found"
ls -la out/ 2>/dev/null || echo "out/ directory not found"

- name: Notify Telegram
if: always()
env:
BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
run: |
set +e

if [ "${{ steps.build.outcome }}" = "success" ]; then
STATUS_EMOJI="✅"
STATUS_TEXT="BUILD PASSED"
else
STATUS_EMOJI="❌"
STATUS_TEXT="BUILD FAILED"
fi

RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

MESSAGE="$(printf '%s\n%s\n%s\n%s\n%s' \
"${STATUS_EMOJI} ${STATUS_TEXT}" \
"Repo: ${{ github.repository }}" \
"Branch: ${{ github.ref_name }}" \
"Triggered by: ${{ github.actor }}" \
"Run: ${RUN_URL}")"

# 1) Status message
curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
-d chat_id="${CHAT_ID}" \
--data-urlencode text="${MESSAGE}"

# 2) Build log (always, if it exists)
if [ -f build.log ]; then
curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendDocument" \
-F chat_id="${CHAT_ID}" \
-F document=@build.log \
-F caption="Build log — ${STATUS_TEXT}"
fi

# 3) Kernel zip (only when the build actually succeeded and the file exists)
if [ "${{ steps.build.outcome }}" = "success" ] && [ -f out/Mahashunya-Kernel-Phoenix.zip ]; then
curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendDocument" \
-F chat_id="${CHAT_ID}" \
-F document=@out/Mahashunya-Kernel-Phoenix.zip \
-F caption="Mahashunya-Kernel-Phoenix.zip"
fi

- name: Upload build log (always, even on failure)
if: always()
uses: actions/upload-artifact@v4
with:
name: build-log
path: build.log
if-no-files-found: warn
retention-days: 14

- name: Upload final kernel zip
if: success()
uses: actions/upload-artifact@v4
with:
name: Mahashunya-Kernel-Phoenix
path: out/Mahashunya-Kernel-Phoenix.zip
if-no-files-found: error
retention-days: 30
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,6 @@ kernel/configs/android-*.cfg
#Ignoring Android.bp link file
#
Android.bp
!.github/
!.github/workflows/
!.github/workflows/*
14 changes: 12 additions & 2 deletions Documentation/ABI/testing/procfs-smaps_rollup
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,28 @@ Date: August 2017
Contact: Daniel Colascione <dancol@google.com>
Description:
This file provides pre-summed memory information for a
process. The format is identical to /proc/pid/smaps,
process. The format is almost identical to /proc/pid/smaps,
except instead of an entry for each VMA in a process,
smaps_rollup has a single entry (tagged "[rollup]")
for which each field is the sum of the corresponding
fields from all the maps in /proc/pid/smaps.
For more details, see the procfs man page.
Additionally, the fields Pss_Anon, Pss_File and Pss_Shmem
are not present in /proc/pid/smaps. These fields represent
the sum of the Pss field of each type (anon, file, shmem).
For more details, see Documentation/filesystems/proc.txt
and the procfs man page.

Typical output looks like this:

00100000-ff709000 ---p 00000000 00:00 0 [rollup]
Size: 1192 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Rss: 884 kB
Pss: 385 kB
Pss_Anon: 301 kB
Pss_File: 80 kB
Pss_Shmem: 4 kB
Shared_Clean: 696 kB
Shared_Dirty: 0 kB
Private_Clean: 120 kB
Expand Down
41 changes: 31 additions & 10 deletions Documentation/filesystems/proc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ Table 1-1: Process specific entries in /proc
symbol the task is blocked in - or "0" if not blocked.
pagemap Page table
stack Report full stack trace, enable via CONFIG_STACKTRACE
smaps an extension based on maps, showing the memory consumption of
smaps An extension based on maps, showing the memory consumption of
each mapping and flags associated with it
numa_maps an extension based on maps, showing the memory locality and
smaps_rollup Accumulated smaps stats for all mappings of the process. This
can be derived from smaps, but is faster and more convenient
numa_maps An extension based on maps, showing the memory locality and
binding policy as well as mem usage (in pages) of each mapping.
..............................................................................

Expand Down Expand Up @@ -349,7 +351,7 @@ Table 1-4: Contents of the stat files (as of 2.6.30-rc7)
exit_code the thread's exit_code in the form reported by the waitpid system call
..............................................................................

The /proc/PID/maps file containing the currently mapped memory regions and
The /proc/PID/maps file contains the currently mapped memory regions and
their access permissions.

The format is:
Expand Down Expand Up @@ -402,11 +404,14 @@ is not associated with a file:
or if empty, the mapping is anonymous.

The /proc/PID/smaps is an extension based on maps, showing the memory
consumption for each of the process's mappings. For each of mappings there
is a series of lines such as the following:
consumption for each of the process's mappings. For each mapping (aka Virtual
Memory Area, or VMA) there is a series of lines such as the following:

08048000-080bc000 r-xp 00000000 03:02 13130 /bin/bash

Size: 1084 kB
KernelPageSize: 4 kB
MMUPageSize: 4 kB
Rss: 892 kB
Pss: 374 kB
Shared_Clean: 892 kB
Expand All @@ -428,11 +433,14 @@ Locked: 0 kB
VmFlags: rd ex mr mw me dw
Name: name from userspace

the first of these lines shows the same information as is displayed for the
mapping in /proc/PID/maps. The remaining lines show the size of the mapping
(size), the amount of the mapping that is currently resident in RAM (RSS), the
process' proportional share of this mapping (PSS), the number of clean and
dirty private pages in the mapping.
The first of these lines shows the same information as is displayed for the
mapping in /proc/PID/maps. Following lines show the size of the mapping
(size); the size of each page allocated when backing a VMA (KernelPageSize),
which is usually the same as the size in the page table entries; the page size
used by the MMU when backing a VMA (in most cases, the same as KernelPageSize);
the amount of the mapping that is currently resident in RAM (RSS); the
process' proportional share of this mapping (PSS); and the number of clean and
dirty shared and private pages in the mapping.

The "proportional set size" (PSS) of a process is the count of pages it has
in memory, where each page is divided by the number of processes sharing it.
Expand Down Expand Up @@ -518,6 +526,19 @@ guarantees:
2) If there is something at a given vaddr during the entirety of the
life of the smaps/maps walk, there will be some output for it.

The /proc/PID/smaps_rollup file includes the same fields as /proc/PID/smaps,
but their values are the sums of the corresponding values for all mappings of
the process. Additionally, it contains these fields:

Pss_Anon
Pss_File
Pss_Shmem

They represent the proportional shares of anonymous, file, and shmem pages, as
described for smaps above. These fields are omitted in smaps since each
mapping identifies the type (anon, file, or shmem) of all pages it contains.
Thus all information in smaps_rollup can be derived from smaps, but at a
significantly higher cost.

The /proc/PID/clear_refs is used to reset the PG_Referenced and ACCESSED/YOUNG
bits on both physical and virtual pages associated with a process, and the
Expand Down
66 changes: 66 additions & 0 deletions Documentation/sysctl/vm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ files can be found in mm/swap.c.
Currently, these files are in /proc/sys/vm:

- admin_reserve_kbytes
- anon_min_kbytes
- block_dump
- clean_low_kbytes
- clean_min_kbytes
- compact_memory
- compact_unevictable_allowed
- dirty_background_bytes
Expand Down Expand Up @@ -98,13 +101,68 @@ Changing this takes effect whenever an application requests memory.

==============================================================

anon_min_kbytes

This knob provides *hard* protection of anonymous pages. The anonymous pages
on the current node won't be reclaimed under any conditions when their amount
is below vm.anon_min_kbytes.

This knob may be used to prevent excessive swap thrashing when anonymous
memory is low (for example, when memory is going to be overfilled by
compressed data of zram module).

Setting this value too high (close to MemTotal) can result in inability to
swap and can lead to early OOM under memory pressure.

The default value is defined by CONFIG_ANON_MIN_KBYTES.

==============================================================

block_dump

block_dump enables block I/O debugging when set to a nonzero value. More
information on block I/O debugging is in Documentation/laptops/laptop-mode.txt.

==============================================================

clean_low_kbytes

This knob provides *best-effort* protection of clean file pages. The file pages
on the current node won't be reclaimed under memory pressure when the amount of
clean file pages is below vm.clean_low_kbytes *unless* we threaten to OOM.

Protection of clean file pages using this knob may be used when swapping is
still possible to
- prevent disk I/O thrashing under memory pressure;
- improve performance in disk cache-bound tasks under memory pressure.

Setting it to a high value may result in a early eviction of anonymous pages
into the swap space by attempting to hold the protected amount of clean file
pages in memory.

The default value is defined by CONFIG_CLEAN_LOW_KBYTES.

==============================================================

clean_min_kbytes

This knob provides *hard* protection of clean file pages. The file pages on the
current node won't be reclaimed under memory pressure when the amount of clean
file pages is below vm.clean_min_kbytes.

Hard protection of clean file pages using this knob may be used to
- prevent disk I/O thrashing under memory pressure even with no free swap space;
- improve performance in disk cache-bound tasks under memory pressure;
- avoid high latency and prevent livelock in near-OOM conditions.

Setting it to a high value may result in a early out-of-memory condition due to
the inability to reclaim the protected amount of clean file pages when other
types of pages cannot be reclaimed.

The default value is defined by CONFIG_CLEAN_MIN_KBYTES.

==============================================================

compact_memory

Available only when CONFIG_COMPACTION is set. When 1 is written to the file,
Expand Down Expand Up @@ -818,6 +876,14 @@ decrease the amount of swap. A value of 0 instructs the kernel not to
initiate swap until the amount of free and file-backed pages is less
than the high water mark in a zone.

This knob has no effect if the amount of clean file pages on the current
node is below vm.clean_low_kbytes or vm.clean_min_kbytes. In this case,
only anonymous pages can be reclaimed.

If the number of anonymous pages on the current node is below
vm.anon_min_kbytes, then only file pages can be reclaimed with
any vm.swappiness value.

The default value is 60.

==============================================================
Expand Down
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,20 @@ KBUILD_CFLAGS += $(call cc-option, -Wno-sometimes-uninitialized)
KBUILD_CFLAGS += $(call cc-option, -Wno-pointer-to-int-cast)
KBUILD_CFLAGS += $(call cc-option, -Wno-void-pointer-to-int-cast)

# Polly Loop Optimizations
ifeq ($(cc-name),clang)
POLLY_FLAGS := -mllvm -polly \
-mllvm -polly-vectorizer=stripmine \
-mllvm -polly-parallel \
-mllvm -polly-tiling \
-mllvm -polly-invariant-load-hoisting \
-mllvm -polly-run-dce \
-mllvm -polly-matmul-opt \
-mllvm -polly-tc-opt

KBUILD_CFLAGS += $(POLLY_FLAGS)
endif

# Quiet clang warning: comparison of unsigned expression < 0 is always false

KBUILD_CFLAGS += $(call cc-disable-warning, tautological-compare)
Expand Down
Loading