Init
This commit is contained in:
commit
8e66a6e0bd
|
@ -0,0 +1,30 @@
|
|||
# CachyOS-Settings
|
||||
Configuration files that tweak sysctl values, add udev rules to automatically set schedulers, and provide additional optimizations.
|
||||
|
||||
[CachyOS-Settings](https://github.com/CachyOS/CachyOS-Settings)
|
||||
|
||||
## udev rules
|
||||
- Audio latency
|
||||
- SATA Active Link Power Management for HDD to prioritize max performance
|
||||
- IO schedulers, automatic selection schedulers depends on your HW - SATA SSD, NVME and HDD.
|
||||
- NVIDIA, load, unload modules and set-up power management.
|
||||
|
||||
## sysctl
|
||||
- Tweaks focused to memory and network.
|
||||
|
||||
## modprobe
|
||||
- NVIDIA and enable direct rendering
|
||||
- Force using of the amdgpu driver for Southern Islands (GCN 1.0+) and Sea Islands (GCN 2.0+).
|
||||
|
||||
## systemd
|
||||
- PCI latency
|
||||
- Journal Size reduced to 50MB
|
||||
- KSM inheritated via system
|
||||
- Timesync config for time.google.com
|
||||
- Zram Generator config
|
||||
|
||||
## Scripts
|
||||
- Easily switch between amdpstate-epp and amdpstate-guided
|
||||
- Upload logs with paste-cachyos, for example: sudo dmesg | paste-cachyos
|
||||
- View up to 10 process memory/swap usage (topmem)
|
||||
- Run OpenGL programs with the Zink Gallium driver using the zink-run wrapper
|
|
@ -0,0 +1 @@
|
|||
https://debuginfod.cachyos.org
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
git add . && git commit -m "Update" && git push
|
||||
|
||||
echo "Ready"
|
|
@ -0,0 +1,119 @@
|
|||
#!/usr/bin/env bash
|
||||
# CachyOS bug reporting shell script. This shell
|
||||
# script will generate a log file named "cachyos-bug-report.log".
|
||||
|
||||
LOG_FILENAME="${LOG_FILENAME:-"cachyos-bugreport.log"}"
|
||||
OLD_LOG_FILENAME=cachyos-bugreport.log.old
|
||||
|
||||
ask_yes_no(){
|
||||
local question="${1}"
|
||||
while ! printf '%s' "${answer}" | grep -q '^\([Yy]\(es\)\?\|[Nn]\(o\)\?\)$'; do
|
||||
printf '%s' "${question} [Y]es/[N]o: "
|
||||
read -r answer
|
||||
done
|
||||
|
||||
if printf '%s' "${answer}" | grep -q '^[Nn]\(o\)\?$'; then
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_root(){
|
||||
# Check that we are root, required for dmesg
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "ERROR: Please run $(basename "$0") as root." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# move any old log file
|
||||
check_oldlog() {
|
||||
if [ -f "$LOG_FILENAME" ]; then
|
||||
mv "$LOG_FILENAME" "$OLD_LOG_FILENAME"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
check_wpermission() {
|
||||
if ! touch "$LOG_FILENAME" 2>/dev/null; then
|
||||
cat << EOF >&2
|
||||
|
||||
ERROR: Working directory is not writable; please cd to a directory
|
||||
where you have write permission so that the $LOG_FILENAME
|
||||
file can be written.
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
get_installed_packages() {
|
||||
if [ -e /var/lib/pacman/sync/cachyos-v4.db ]; then
|
||||
pacman -Ss | grep --color=never "^cachyos-v4/.*\[installed\]"
|
||||
elif [ -e /var/lib/pacman/sync/cachyos-v3.db ]; then
|
||||
pacman -Ss | grep --color=never "^cachyos-v3/.*\[installed\]"
|
||||
elif [ -e /var/lib/pacman/sync/cachyos-znver4.db ]; then
|
||||
pacman -Ss | grep --color=never "^cachyos-znver4/.*\[installed\]"
|
||||
else
|
||||
echo "znver4, v4 or v3 repositories are not used"
|
||||
fi
|
||||
}
|
||||
|
||||
bugreport() {
|
||||
echo "Starting with bugreport"
|
||||
|
||||
cat << EOF >"$LOG_FILENAME"
|
||||
____________________________________________
|
||||
|
||||
Start of CachyOS bug report log file. Please send this report,
|
||||
along with a description of your bug, to CachyOS.
|
||||
|
||||
Date: $(date)
|
||||
uname: $(uname -a)
|
||||
|
||||
____________________________________________
|
||||
Getting Hardware Information
|
||||
|
||||
$(inxi -F)
|
||||
____________________________________________
|
||||
Getting Scheduler information
|
||||
|
||||
sched-ext:
|
||||
$(grep -R "" /sys/kernel/sched_ext/)
|
||||
|
||||
$(journalctl --output cat -k | grep -i scheduler)
|
||||
|
||||
____________________________________________
|
||||
|
||||
dmesg
|
||||
|
||||
$(dmesg)
|
||||
|
||||
____________________________________________
|
||||
journalctl of current boot
|
||||
|
||||
$(journalctl -b -p 4..1)
|
||||
____________________________________________
|
||||
|
||||
Installed packages
|
||||
|
||||
$(get_installed_packages)
|
||||
--------------------------------------------
|
||||
EOF
|
||||
}
|
||||
|
||||
upload() {
|
||||
if ask_yes_no 'Do you want to upload this log to https://paste.cachyos.org?'; then
|
||||
echo "Uploading Log"
|
||||
paste-cachyos "$LOG_FILENAME"
|
||||
else
|
||||
echo "Not uploading Log"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
check_root
|
||||
check_oldlog
|
||||
check_wpermission
|
||||
bugreport
|
||||
upload
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
# This forces Nvidia DLSS to use the latest preset for SR, RR and framegen + updates the dlss dlls via ngx
|
||||
|
||||
export PROTON_ENABLE_NGX_UPDATER=1
|
||||
export DXVK_NVAPI_DRS_NGX_DLSS_RR_OVERRIDE=on
|
||||
export DXVK_NVAPI_DRS_NGX_DLSS_SR_OVERRIDE=on
|
||||
export DXVK_NVAPI_DRS_NGX_DLSS_FG_OVERRIDE=on
|
||||
export DXVK_NVAPI_DRS_NGX_DLSS_RR_OVERRIDE_RENDER_PRESET_SELECTION=render_preset_latest
|
||||
export DXVK_NVAPI_DRS_NGX_DLSS_SR_OVERRIDE_RENDER_PRESET_SELECTION=render_preset_latest
|
||||
|
||||
# applied variables, now execute the rest of the command
|
||||
exec "$@"
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
# This forces Nvidia DLSS to use the latest preset for SR, RR and framegen + skips ngx updater
|
||||
|
||||
export DXVK_NVAPI_DRS_NGX_DLSS_RR_OVERRIDE=on
|
||||
export DXVK_NVAPI_DRS_NGX_DLSS_SR_OVERRIDE=on
|
||||
export DXVK_NVAPI_DRS_NGX_DLSS_FG_OVERRIDE=on
|
||||
export DXVK_NVAPI_DRS_NGX_DLSS_RR_OVERRIDE_RENDER_PRESET_SELECTION=render_preset_latest
|
||||
export DXVK_NVAPI_DRS_NGX_DLSS_SR_OVERRIDE_RENDER_PRESET_SELECTION=render_preset_latest
|
||||
|
||||
# applied variables, now execute the rest of the command
|
||||
exec "$@"
|
|
@ -0,0 +1,20 @@
|
|||
#!/usr/bin/env bash
|
||||
# Helper script to enable the performance gov with proton or others
|
||||
if ! command -v powerprofilesctl &>/dev/null; then
|
||||
echo "Error: powerprofilesctl not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Don't fail if the CPU driver doesn't support performance power profile
|
||||
if ! powerprofilesctl list | grep -q 'performance:'; then
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Set performance governors, as long the game is launched
|
||||
if [ -n "$GAME_PERFORMANCE_SCREENSAVER_ON" ]; then
|
||||
exec powerprofilesctl launch -p performance \
|
||||
-r "Launched with CachyOS game-performance utility" -- "$@"
|
||||
else
|
||||
exec systemd-inhibit --why "CachyOS game-performance is running" powerprofilesctl launch \
|
||||
-p performance -r "Launched with CachyOS game-performance utility" -- "$@"
|
||||
fi
|
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
cat << EOF
|
||||
Check kernel version:
|
||||
|
||||
$(cat /proc/version && uname -a)
|
||||
|
||||
|
||||
Check x86_64 support:
|
||||
|
||||
$(/lib64/ld-linux-x86-64.so.2 --help | grep "(supported, searched)")
|
||||
|
||||
|
||||
Check CPU config:
|
||||
|
||||
$(zgrep -iE 'CONFIG_(GENERIC_CPU(=| is)|X86_64_VERSION|MZEN|MBULLDOZER|MPILEDRIVER|MSTREAMROLLER|MEXCAVATOR|MBOBCAT|MJAGUAR|MK10|MK8SSE3|MATOM|MGOLDMONTPLUS|MSKYLAKE2|MIVYBRIDGE|MICELAKE|MNATIVE_INTEL|MNATIVE_AMD|X86_NATIVE_CPU)' /proc/config.gz)
|
||||
|
||||
|
||||
Current disk schedulers:
|
||||
|
||||
$(for disk in /sys/block/*/
|
||||
do [ -f "$disk/queue/scheduler" ] \
|
||||
&& echo "$(basename "$disk"): $(cat "$disk/queue/scheduler")"
|
||||
done)
|
||||
|
||||
Check available schedulers:
|
||||
|
||||
$(journalctl --output cat -k | grep -i scheduler)
|
||||
EOF
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Change the url accordingly
|
||||
URL="https://paste.cachyos.org"
|
||||
|
||||
FILEPATH="$1"
|
||||
FILENAME="$(basename -- "$FILEPATH")"
|
||||
EXTENSION="${FILENAME##*.}"
|
||||
|
||||
RESPONSE="$(curl --data-binary @"${FILEPATH:-/dev/stdin}" --url $URL)"
|
||||
PASTELINK="${URL}${RESPONSE}"
|
||||
|
||||
[ -z "$EXTENSION" ] && \
|
||||
echo "$PASTELINK" || \
|
||||
echo "${PASTELINK}.${EXTENSION}"
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env sh
|
||||
# This script is designed to improve the performance and reduce audio latency
|
||||
# for sound cards by setting the PCI latency timer to an optimal value of 80
|
||||
# cycles. It also resets the default value of the latency timer for other PCI
|
||||
# devices, which can help prevent devices with high default latency timers from
|
||||
# causing gaps in sound.
|
||||
|
||||
# Check if the script is run with root privileges
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Error: This script must be run with root privileges." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Reset the latency timer for all PCI devices
|
||||
setpci -v -s '*:*' latency_timer=20
|
||||
setpci -v -s '0:0' latency_timer=0
|
||||
|
||||
# Set latency timer for all sound cards
|
||||
setpci -v -d "*:*:04xx" latency_timer=80
|
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# sbctl-batch-sign is a helper script designed to make it easier for users to sign files needed for secure boot support.
|
||||
# The obvious case in which this script helps a lot is when dual booting Windows as there are a lot of files by Windows that
|
||||
# needs to be signed in EFI.
|
||||
set -e
|
||||
|
||||
if [ -f /boot/limine.conf ]; then
|
||||
echo "Limine detected, please do not use this script."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "Error: This script must be run with root privileges."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export ESP_PATH=/boot
|
||||
sbctl verify 2>/dev/null | awk '/✗/ {print $2}' | while IFS= read -r entry; do
|
||||
# We expect users who use this script to enroll their
|
||||
# own keys alongside Microsoft's.
|
||||
# With that in mind, there's no need to sign MS ESP
|
||||
# files with our own keys.
|
||||
if [[ "$entry" =~ ^.*/EFI/(Microsoft|Windows) || "$entry" == *.mui || "$entry" == *.dll
|
||||
|| "$entry" =~ ^/boot/grub ]]; then
|
||||
continue
|
||||
fi
|
||||
sbctl sign -s "$entry"
|
||||
done
|
|
@ -0,0 +1,219 @@
|
|||
#!/usr/bin/env lua
|
||||
local f, concat, sort = string.format, table.concat, table.sort
|
||||
local found, uv = pcall(require, 'luv')
|
||||
|
||||
local function die(err, ...)
|
||||
print(err:format(...))
|
||||
os.exit(1)
|
||||
end
|
||||
|
||||
if not found then
|
||||
die("lua-luv dependency is missing, please install it from repositories")
|
||||
end
|
||||
|
||||
local function printf(pattern, ...)
|
||||
print(pattern:format(...))
|
||||
end
|
||||
|
||||
-- Patterns
|
||||
local pid_pattern = "[0-9]+"
|
||||
local ksm_profit_pattern = "ksm_process_profit%s*([0-9]+)"
|
||||
local vm_rss_pattern = "VmRSS:%s*([0-9]+)"
|
||||
local vm_swap_pattern = "VmSwap:%s*([0-9]+)"
|
||||
|
||||
local function get_process_values(pid)
|
||||
local path = concat({ "/proc", pid, "status" }, "/")
|
||||
local file = io.open(path)
|
||||
|
||||
if not file then
|
||||
return nil
|
||||
end
|
||||
|
||||
local rss, swap
|
||||
local line = file:read()
|
||||
while line do
|
||||
if rss == nil then
|
||||
rss = line:match(vm_rss_pattern)
|
||||
elseif swap == nil then
|
||||
swap = line:match(vm_swap_pattern)
|
||||
else
|
||||
break
|
||||
end
|
||||
line = file:read()
|
||||
end
|
||||
file:close()
|
||||
return tonumber(rss), tonumber(swap)
|
||||
end
|
||||
|
||||
local function get_process_ksm_profit(pid)
|
||||
local file = io.open(concat({ "/proc", pid, "ksm_stat" }, "/"))
|
||||
|
||||
if not file then
|
||||
return 0
|
||||
end
|
||||
|
||||
local stat = file:read("*a")
|
||||
local profit = stat:match(ksm_profit_pattern)
|
||||
|
||||
file:close()
|
||||
|
||||
if not profit then
|
||||
return 0
|
||||
end
|
||||
|
||||
return tonumber(profit)
|
||||
end
|
||||
|
||||
local function get_process_first_arg(pid)
|
||||
local file = io.open(concat({ "/proc", pid, "cmdline" }, "/"))
|
||||
|
||||
if not file then
|
||||
return nil
|
||||
end
|
||||
|
||||
local cmdline = file:read("*all")
|
||||
file:close()
|
||||
|
||||
return cmdline:match("([^%z]+)")
|
||||
end
|
||||
|
||||
local function convert_hashmap_table(map)
|
||||
local new_hashmap = {}
|
||||
for key, value in pairs(map) do
|
||||
new_hashmap[#new_hashmap + 1] = { value[1], value[2], value[3], key }
|
||||
end
|
||||
|
||||
return new_hashmap
|
||||
end
|
||||
|
||||
local function get_process_map(sort_by)
|
||||
local map = {}
|
||||
local processes = uv.fs_scandir("/proc")
|
||||
local pid, ftype = uv.fs_scandir_next(processes)
|
||||
|
||||
while pid do
|
||||
if pid:match(pid_pattern) then
|
||||
if ftype == "directory" then
|
||||
local rss, swap = get_process_values(pid)
|
||||
local name = get_process_first_arg(pid)
|
||||
local ksm_profit = get_process_ksm_profit(pid)
|
||||
if name and rss then
|
||||
if map[name] then
|
||||
map[name][1] = map[name][1] + rss
|
||||
map[name][2] = map[name][2] + swap
|
||||
map[name][3] = map[name][3] + ksm_profit
|
||||
else
|
||||
map[name] = { rss, swap, ksm_profit }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
pid, ftype = uv.fs_scandir_next(processes)
|
||||
end
|
||||
map = convert_hashmap_table(map)
|
||||
sort(map, function(a, b) return (a[sort_by] > b[sort_by]) end)
|
||||
return map
|
||||
end
|
||||
|
||||
local function truncate(str)
|
||||
if #str > 25 then
|
||||
return str:sub(1, 25) .. "..."
|
||||
else
|
||||
return str
|
||||
end
|
||||
end
|
||||
|
||||
local function get_filename(path)
|
||||
local lastSlash = path:find("/[^/]*$")
|
||||
if lastSlash then
|
||||
return path:sub(lastSlash + 1)
|
||||
else
|
||||
return path
|
||||
end
|
||||
end
|
||||
|
||||
local function print_top(size, sort_by)
|
||||
local map = get_process_map(sort_by)
|
||||
printf("%-9s %35s %-9s %-s", "MEMORY", "Top " .. size .. " processes ", "SWAP", "KSM")
|
||||
for i = 1, size do
|
||||
local entry = map[i]
|
||||
if entry then
|
||||
printf(
|
||||
"%-9s %-35s %-9s %-s",
|
||||
f("%.0f", entry[1] / 1024) .. "M",
|
||||
truncate(get_filename(entry[4])),
|
||||
f("%.0f", entry[2] / 1024) .. "M",
|
||||
f("%.0f", entry[3] / 1024 / 1024) .. "M"
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function print_help()
|
||||
print([[
|
||||
Shows names of the top 10 (or N) processes by memory consumption
|
||||
|
||||
Usage: topmem [OPTIONS] [N]
|
||||
|
||||
Arguments:
|
||||
[N] [default: 10]
|
||||
|
||||
Options:
|
||||
-s, --sort <TYPE> Column to sort by [possible values: rss (default), swap, ksm]
|
||||
-h, --help Show this message]]
|
||||
)
|
||||
os.exit(0)
|
||||
end
|
||||
|
||||
local function main()
|
||||
local sort_types = {
|
||||
["rss"] = 1,
|
||||
["swap"] = 2,
|
||||
["ksm"] = 3
|
||||
}
|
||||
local sort_by = sort_types["rss"]
|
||||
local size
|
||||
local i = 1
|
||||
while i < #arg + 1 do
|
||||
if arg[i] == "--sort" or arg[i] == "-s" or arg[i]:match("--sort=*") then
|
||||
local criteria
|
||||
local shift = true
|
||||
|
||||
for value in string.gmatch(arg[i], "([^=]+)") do
|
||||
if value ~= "--sort" and value ~= "-s" then
|
||||
criteria = value
|
||||
shift = false
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
criteria = criteria or arg[i + 1]
|
||||
if not criteria then
|
||||
die("Column to sort by is not specified")
|
||||
end
|
||||
|
||||
if not sort_types[criteria] then
|
||||
die("Wrong sorting criterion. Only available: rss, swap, ksm.")
|
||||
else
|
||||
sort_by = sort_types[criteria]
|
||||
if shift then
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
elseif arg[i] == "--help" or arg[i] == "-h" then
|
||||
print_help()
|
||||
else
|
||||
local status, value = pcall(tonumber, arg[i])
|
||||
if not status then
|
||||
die("The argument must be a number")
|
||||
else
|
||||
size = value
|
||||
end
|
||||
end
|
||||
i = i + 1
|
||||
end
|
||||
|
||||
print_top(size or 10, sort_by)
|
||||
end
|
||||
|
||||
main()
|
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
export MESA_LOADER_DRIVER_OVERRIDE=zink
|
||||
export GALLIUM_DRIVER=zink
|
||||
export __GLX_VENDOR_LIBRARY_NAME=mesa
|
||||
export __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json
|
||||
exec "$@"
|
|
@ -0,0 +1,5 @@
|
|||
# Disables power saving capabilities for snd-hda-intel when device is not
|
||||
# running on battery power. This is needed because it prevents audio cracks on
|
||||
# some hardware. If device starts working on battery power, same named udev rule
|
||||
# re-enables power saving.
|
||||
options snd_hda_intel power_save=0
|
|
@ -0,0 +1,4 @@
|
|||
# Force using of the amdgpu driver for Southern Islands (GCN 1.0+) and Sea
|
||||
# Islands (GCN 2.x) generations.
|
||||
options amdgpu si_support=1 cik_support=1
|
||||
options radeon si_support=0 cik_support=0
|
|
@ -0,0 +1,5 @@
|
|||
# Blacklist the Intel TCO Watchdog/Timer module
|
||||
blacklist iTCO_wdt
|
||||
|
||||
# Blacklist the AMD SP5100 TCO Watchdog/Timer module (Required for Ryzen cpus)
|
||||
blacklist sp5100_tco
|
|
@ -0,0 +1,36 @@
|
|||
#
|
||||
# NVreg_UsePageAttributeTable=1 (Default 0) - Activating the better memory
|
||||
# management method (PAT). The PAT method creates a partition type table at a
|
||||
# specific address mapped inside the register and utilizes the memory
|
||||
# architecture and instruction set more efficiently and faster. If your system
|
||||
# can support this feature, it should improve CPU performance.
|
||||
#
|
||||
# NVreg_InitializeSystemMemoryAllocations=0 (Default 1) - Disables clearing
|
||||
# system memory allocation before using it for the GPU. Potentially improves
|
||||
# performance, but at the cost of increased security risks. Write "options
|
||||
# nvidia NVreg_InitializeSystemMemoryAllocations=1" in
|
||||
# /etc/modprobe.d/nvidia.conf, if you want to return the default value. Note:
|
||||
# It is possible to use more memory (?)
|
||||
#
|
||||
# NVreg_DynamicPowerManagement=0x02 - Enables the use of dynamic power
|
||||
# management for Turing generation mobile cards, allowing the dGPU to be
|
||||
# powered down during idle time.
|
||||
#
|
||||
# NVreg_RegistryDwords=RMIntrLockingMode=1 (default 0) - enables experimental
|
||||
# switch for better frame-pacing this mainly improves it for high refresh rate
|
||||
# monitors with VRR or VR headsets.
|
||||
#
|
||||
# Note: This only works for PRIME configurations if your dGPU is controlling an
|
||||
# external monitor.
|
||||
#
|
||||
# For example: At 240Hz each frame is expected every 4ms. But if a 1ms
|
||||
# task—say, in the kernel or on the GSP — runs when a frame is about to be
|
||||
# displayed, it can delay the rendering. Instead of a neat sequence at T+4ms,
|
||||
# T+8ms, T+12ms, the frames might appear at T+4ms, T+9ms, T+12ms, etc. This
|
||||
# shows how even small delays can shift frame timing, potentially impacting
|
||||
# smooth display output.
|
||||
#
|
||||
options nvidia NVreg_UsePageAttributeTable=1 \
|
||||
NVreg_InitializeSystemMemoryAllocations=0 \
|
||||
NVreg_DynamicPowerManagement=0x02 \
|
||||
NVreg_RegistryDwords=RMIntrLockingMode=1
|
|
@ -0,0 +1 @@
|
|||
ntsync
|
|
@ -0,0 +1,26 @@
|
|||
### Use only if you want to change the default values!
|
||||
### For more information look here: https://github.com/firelzrd/bore-scheduler#readme
|
||||
|
||||
### Additional settings for BORE Scheduler (Work only if the BORE scheduler is enabled!)
|
||||
### So make sure that kernel.sched_bore has a value of 1
|
||||
|
||||
# sched_burst_cache_lifetime (range: 0 - 4294967295, default: 60000000)
|
||||
#kernel.sched_burst_cache_lifetime = 60000000
|
||||
|
||||
# sched_burst_fork_atavistic (range: 0 - 3, default: 2)
|
||||
#kernel.sched_burst_fork_atavistic = 2
|
||||
|
||||
# sched_burst_penalty_offset (range: 0 - 64, default: 22)
|
||||
#kernel.sched_burst_penalty_offset = 22
|
||||
|
||||
# sched_burst_penalty_scale (range: 0 - 4095, default: 1280)
|
||||
#kernel.sched_burst_penalty_scale = 1280
|
||||
|
||||
# sched_burst_smoothness_long (range: 0 - 1, default: 1)
|
||||
#kernel.sched_burst_smoothness_long = 1
|
||||
|
||||
# sched_burst_smoothness_short (range: 0 - 1, default: 0)
|
||||
#kernel.sched_burst_smoothness_short = 0
|
||||
|
||||
# sched_burst_exclude_kthreads (range: 0 - 1, default: 1)
|
||||
#kernel.sched_burst_exclude_kthreads = 1
|
|
@ -0,0 +1,49 @@
|
|||
# The sysctl swappiness parameter determines the kernel's preference for pushing anonymous pages or page cache to disk in memory-starved situations.
|
||||
# A low value causes the kernel to prefer freeing up open files (page cache), a high value causes the kernel to try to use swap space,
|
||||
# and a value of 100 means IO cost is assumed to be equal.
|
||||
vm.swappiness = 100
|
||||
|
||||
# The value controls the tendency of the kernel to reclaim the memory which is used for caching of directory and inode objects (VFS cache).
|
||||
# Lowering it from the default value of 100 makes the kernel less inclined to reclaim VFS cache (do not set it to 0, this may produce out-of-memory conditions)
|
||||
vm.vfs_cache_pressure = 50
|
||||
|
||||
# Contains, as bytes, the number of pages at which a process which is
|
||||
# generating disk writes will itself start writing out dirty data.
|
||||
vm.dirty_bytes = 268435456
|
||||
|
||||
# page-cluster controls the number of pages up to which consecutive pages are read in from swap in a single attempt.
|
||||
# This is the swap counterpart to page cache readahead. The mentioned consecutivity is not in terms of virtual/physical addresses,
|
||||
# but consecutive on swap space - that means they were swapped out together. (Default is 3)
|
||||
# increase this value to 1 or 2 if you are using physical swap (1 if ssd, 2 if hdd)
|
||||
vm.page-cluster = 0
|
||||
|
||||
# Contains, as bytes, the number of pages at which the background kernel
|
||||
# flusher threads will start writing out dirty data.
|
||||
vm.dirty_background_bytes = 67108864
|
||||
|
||||
# The kernel flusher threads will periodically wake up and write old data out to disk. This
|
||||
# tunable expresses the interval between those wakeups, in 100'ths of a second (Default is 500).
|
||||
vm.dirty_writeback_centisecs = 1500
|
||||
|
||||
# This action will speed up your boot and shutdown, because one less module is loaded. Additionally disabling watchdog timers increases performance and lowers power consumption
|
||||
# Disable NMI watchdog
|
||||
kernel.nmi_watchdog = 0
|
||||
|
||||
# Enable the sysctl setting kernel.unprivileged_userns_clone to allow normal users to run unprivileged containers.
|
||||
kernel.unprivileged_userns_clone = 1
|
||||
|
||||
# To hide any kernel messages from the console
|
||||
kernel.printk = 3 3 3 3
|
||||
|
||||
# Restricting access to kernel pointers in the proc filesystem
|
||||
kernel.kptr_restrict = 2
|
||||
|
||||
# Disable Kexec, which allows replacing the current running kernel.
|
||||
kernel.kexec_load_disabled = 1
|
||||
|
||||
# Increase netdev receive queue
|
||||
# May help prevent losing packets
|
||||
net.core.netdev_max_backlog = 4096
|
||||
|
||||
# Set size of file handles and inode cache
|
||||
fs.file-max = 2097152
|
|
@ -0,0 +1,2 @@
|
|||
[Journal]
|
||||
SystemMaxUse=50M
|
|
@ -0,0 +1,3 @@
|
|||
[Manager]
|
||||
DefaultTimeoutStartSec=15s
|
||||
DefaultTimeoutStopSec=10s
|
|
@ -0,0 +1,2 @@
|
|||
[Manager]
|
||||
DefaultLimitNOFILE=2048:2097152
|
|
@ -0,0 +1,9 @@
|
|||
[Unit]
|
||||
Description=Adjust latency timers for PCI peripherals
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/pci-latency
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -0,0 +1,2 @@
|
|||
[Service]
|
||||
LogLevelMax=info
|
|
@ -0,0 +1,2 @@
|
|||
[Service]
|
||||
Delegate=cpu cpuset io memory pids
|
|
@ -0,0 +1,8 @@
|
|||
[Time]
|
||||
NTP=time.cloudflare.com
|
||||
FallbackNTP=time.google.com 0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org
|
||||
#RootDistanceMaxSec=5
|
||||
#PollIntervalMinSec=32
|
||||
#PollIntervalMaxSec=2048
|
||||
#ConnectionRetrySec=30
|
||||
#SaveIntervalSec=60
|
|
@ -0,0 +1,2 @@
|
|||
[Manager]
|
||||
DefaultLimitNOFILE=1024:1048576
|
|
@ -0,0 +1,5 @@
|
|||
[zram0]
|
||||
compression-algorithm = zstd lz4 (type=huge)
|
||||
zram-size = ram
|
||||
swap-priority = 100
|
||||
fs-type = swap
|
|
@ -0,0 +1,2 @@
|
|||
# Clear all coredumps that were created more than 3 days ago
|
||||
d /var/lib/systemd/coredump 0755 root root 3d
|
|
@ -0,0 +1,6 @@
|
|||
# THP Shrinker has been added in the 6.12 Kernel
|
||||
# Default Value is 511
|
||||
# THP=always policy vastly overprovisions THPs in sparsely accessed memory areas, resulting in excessive memory pressure and premature OOM killing
|
||||
# 409 means that any THP that has more than 409 out of 512 (80%) zero filled filled pages will be split.
|
||||
# This reduces the memory usage, when THP=always used and the memory usage goes down to around the same usage as when madvise is used, while still providing an equal performance improvement
|
||||
w! /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_none - - - - 409
|
|
@ -0,0 +1,3 @@
|
|||
# Improve performance for applications that use tcmalloc
|
||||
# https://github.com/google/tcmalloc/blob/master/docs/tuning.md#system-level-optimizations
|
||||
w! /sys/kernel/mm/transparent_hugepage/defrag - - - - defer+madvise
|
|
@ -0,0 +1,11 @@
|
|||
# Disables power saving capabilities for snd-hda-intel when device is not
|
||||
# running on battery power. This is needed because it prevents audio cracks on
|
||||
# some hardware.
|
||||
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="0", TEST=="/sys/module/snd_hda_intel", \
|
||||
RUN+="/bin/sh -c 'echo $$(cat /run/udev/snd-hda-intel-powersave 2>/dev/null || \
|
||||
echo 10) > /sys/module/snd_hda_intel/parameters/power_save'"
|
||||
|
||||
SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", TEST=="/sys/module/snd_hda_intel", \
|
||||
RUN+="/bin/sh -c '[[ $$(cat /sys/module/snd_hda_intel/parameters/power_save) != 0 ]] && \
|
||||
echo $$(cat /sys/module/snd_hda_intel/parameters/power_save) > /run/udev/snd-hda-intel-powersave; \
|
||||
echo 0 > /sys/module/snd_hda_intel/parameters/power_save'"
|
|
@ -0,0 +1,14 @@
|
|||
# When used with ZRAM, it is better to prefer page out only anonymous pages,
|
||||
# because it ensures that they do not go out of memory, but will be just
|
||||
# compressed. If we do frequent flushing of file pages, that increases the
|
||||
# percentage of page cache misses, which in the long term gives additional
|
||||
# cycles to re-read the same data from disk that was previously in page cache.
|
||||
# This is the reason why it is recommended to use high values from 100 to keep
|
||||
# the page cache as hermetic as possible, because otherwise it is "expensive"
|
||||
# to read data from disk again. At the same time, uncompressing pages from ZRAM
|
||||
# is not as expensive and is usually very fast on modern CPUs.
|
||||
#
|
||||
# Also it's better to disable Zswap, as this may prevent ZRAM from working
|
||||
# properly or keeping a proper count of compressed pages via zramctl.
|
||||
ACTION=="change", KERNEL=="zram0", ATTR{initstate}=="1", SYSCTL{vm.swappiness}="150", \
|
||||
RUN+="/bin/sh -c 'echo N > /sys/module/zswap/parameters/enabled'"
|
|
@ -0,0 +1,2 @@
|
|||
KERNEL=="rtc0", GROUP="audio"
|
||||
KERNEL=="hpet", GROUP="audio"
|
|
@ -0,0 +1,4 @@
|
|||
# SATA Active Link Power Management
|
||||
ACTION=="add", SUBSYSTEM=="scsi_host", KERNEL=="host*", \
|
||||
ATTR{link_power_management_policy}=="*", \
|
||||
ATTR{link_power_management_policy}="max_performance"
|
|
@ -0,0 +1,11 @@
|
|||
# HDD
|
||||
ACTION=="add|change", KERNEL=="sd[a-z]*", ATTR{queue/rotational}=="1", \
|
||||
ATTR{queue/scheduler}="bfq"
|
||||
|
||||
# SSD
|
||||
ACTION=="add|change", KERNEL=="sd[a-z]*|mmcblk[0-9]*", ATTR{queue/rotational}=="0", \
|
||||
ATTR{queue/scheduler}="mq-deadline"
|
||||
|
||||
# NVMe SSD
|
||||
ACTION=="add|change", KERNEL=="nvme[0-9]*", ATTR{queue/rotational}=="0", \
|
||||
ATTR{queue/scheduler}="none"
|
|
@ -0,0 +1,2 @@
|
|||
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", \
|
||||
RUN+="/usr/bin/hdparm -B 254 -S 0 /dev/%k"
|
|
@ -0,0 +1,9 @@
|
|||
# Enable runtime PM for NVIDIA VGA/3D controller devices on driver bind
|
||||
ACTION=="add|bind", SUBSYSTEM=="pci", DRIVERS=="nvidia", \
|
||||
ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", \
|
||||
TEST=="power/control", ATTR{power/control}="auto"
|
||||
|
||||
# Disable runtime PM for NVIDIA VGA/3D controller devices on driver unbind
|
||||
ACTION=="remove|unbind", SUBSYSTEM=="pci", DRIVERS=="nvidia", \
|
||||
ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", \
|
||||
TEST=="power/control", ATTR{power/control}="on"
|
|
@ -0,0 +1 @@
|
|||
DEVPATH=="/devices/virtual/misc/cpu_dma_latency", OWNER="root", GROUP="audio", MODE="0660"
|
|
@ -0,0 +1,7 @@
|
|||
Section "InputClass"
|
||||
Identifier "libinput touchpad catchall"
|
||||
MatchIsTouchpad "on"
|
||||
MatchDevicePath "/dev/input/event*"
|
||||
Driver "libinput"
|
||||
Option "Tapping" "True"
|
||||
EndSection
|
|
@ -0,0 +1,2 @@
|
|||
[org.gnome.login-screen]
|
||||
logo='/usr/share/pixmaps/melawy-linux.svg'
|
Loading…
Reference in New Issue