[Sony Xperia M2] kaiiori:
Requirements

Phone: Xperia M2 D2306

Android: 4.4.4

Compilation: 18.3.1.C.0.21

with this information you can develop your own optimization taking into account the following parameters xperia m2.

everything should go inside the sysctl.conf file in the path /system/etc/sysctl.d

to create optimizations should be this way

create a file called sysctl.conf (path /system/etc/sysctl.d)

with the following structure and order

command to use

sysctl-arm -w

### BEGIN INIT INFO
# Provides: sysctl.conf
# Required-Start: $local_fs
# Phone: xperia M2 D2306
# Android: 4.4.4
# Compilation: 18.3.1.C.0.21
# Author: kaiiori xda developers
# Description: settings fs
### END INIT INFO

dev.scsi.logging_level=0
#sysctl fs
sysctl-arm -w fs.aio-max-nr=65536
fs.aio-max-nr=65536
#sysctl kernel
sysctl-arm -w kernel.sysrq=1
kernel.sysrq=1
#sysctl vm
sysctl-arm -w vm.swappiness=16384
vm.swappiness=16384

and add the optimizations you want to apply in this order

sysctl.conf

dev.scsi.logging_level=0

sysctl_fs.conf

fs.aio-max-nr=65536
fs.aio-nr=0
fs.dentry-state=19084 7384 45 0 0 0
fs.dir-notify-enable=1
fs.epoll.max_user_watches=278262
fs.file-max=66895
fs.file-nr=3872 0 66895
fs.inode-nr=19041 882
fs.inode-state=19041 882 0 0 0 0
fs.inotify.max_queued_events=16384
fs.inotify.max_user_instances=128
fs.inotify.max_user_watches=8192
fs.lease-break-time=45
fs.leases-enable=1
fs.nr_open=1048576
fs.overflowgid=65543
fs.overflowuid=65543
fs.pipe-max-size=1048576
fs.suid_dumpable=0

sysctl_kernel.conf

kernel.auto_msgmni=1
kernel.blk_iopoll=1
kernel.boot_reason=0
kernel.cap_last_cap=35
kernel.cold_boot=0
kernel.core_pattern=core
kernel.core_pipe_limit=0
kernel.core_uses_pid=0
kernel.ctrl-alt-del=1
kernel.dmesg_restrict=1
kernel.domainname=localdomain
kernel.ftrace_dump_on_oops=0
kernel.hostname=localhost
kernel.hotplug=
kernel.keys.gc_delay=300
kernel.keys.maxbytes=20000
kernel.keys.maxkeys=200
kernel.keys.root_maxbytes=20000
kernel.keys.root_maxkeys=200
kernel.kptr_restrict=2
kernel.max_lock_depth=1024
kernel.modprobe=/sbin/modprobe
kernel.modules_disabled=0
kernel.msgmax=8192
kernel.msgmnb=1437
kernel.ngroups_max=65536
kernel.osrelease=3.4.0-geafc7cd-dirty
kernel.ostype=Linux
kernel.overflowgid=65543
kernel.overflowuid=65543
kernel.panic=5
kernel.panic_on_oops=1
kernel.perf_event_max_sample_rate=100000
kernel.perf_event_mlock_kb=516
kernel.perf_event_paranoid=1
kernel.pid_max=32768
kernel.poweroff_cmd=/sbin/poweroff
kernel.print-fatal-signals=0
kernel.printk=6 6 1 7
kernel.printk_delay=0
kernel.printk_ratelimit=5
kernel.printk_ratelimit_burst=10
kernel.pty.max=4096
kernel.pty.nr=0
kernel.pty.reserve=1024
kernel.random.boot_id=a47c3446-2cf9-48a1-78f3-ff21c7f5331e
kernel.random.entropy_avail=168
kernel.random.poolsize=4096
kernel.random.read_wakeup_threshold=64
kernel.random.uuid=ahgcolm6-jcf9-hba1-xvf3-cf21c7f5431d
kernel.random.write_wakeup_threshold=128
kernel.randomsize_va_space=2
kernel.real-root-dev=0
kernel.sched_child_runs_firts=0
kernel.sched_domain_cpu0.domain0.busy_factor=1
kernel.sched_domain_cpu0.domain0.busy_idx=2
kernel.sched_domain_cpu0.domain0.cache_nice_tries=1
kernel.sched_domain_cpu0.domain0.flags=4655
kernel.sched_domain_cpu0.domain0.forkexec_idx=0
kernel.sched_domain_cpu0.domain0.idle_idx=0
kernel.sched_domain_cpu0.domain0.imbalance_pct=125
kernel.sched_domain_cpu0.domain0.max_interval=4
kernel.sched_domain_cpu0.domain0.min_interval=1
kernel.sched_domain_cpu0.domain0.name=MC
kernel.sched_domain_cpu0.domain0.newidle_idx=0
kernel.sched_domain_cpu0.domain0.wake_idx=0
kernel.sched_domain_cpu1.domain0.busy_factor=1
kernel.sched_domain_cpu1.domain0.busy_idx=2
kernel.sched_domain_cpu1.domain0.cache_nice_tries=1
kernel.sched_domain_cpu1.domain0.flags=4655
kernel.sched_domain_cpu1.domain0.forkexec_idx=0
kernel.sched_domain_cpu1.domain0.idle_idx=0
kernel.sched_domain_cpu1.domain0.imbalance_pct=125
kernel.sched_domain_cpu1.domain0.max_interval=4
kernel.sched_domain_cpu1.domain0.min_interval=1
kernel.sched_domain_cpu1.domain0.name=MC
kernel.sched_domain_cpu1.domain0.newidle_idx=0
kernel.sched_domain_cpu1.domain0.wake_idx=0
kernel.sched_domain_cpu2.domain0.busy_factor=1
kernel.sched_domain_cpu2.domain0.busy_idx=2
kernel.sched_domain_cpu2.domain0.cache_nice_tries=1
kernel.sched_domain_cpu2.domain0.flags=4655
kernel.sched_domain_cpu2.domain0.forkexec_idx=0
kernel.sched_domain_cpu2.domain0.idle_idx=0
kernel.sched_domain_cpu2.domain0.imbalance_pct=125
kernel.sched_domain_cpu2.domain0.max_interval=4
kernel.sched_domain_cpu2.domain0.min_interval=1
kernel.sched_domain_cpu2.domain0.name=MC
kernel.sched_domain_cpu2.domain0.newidle_idx=0
kernel.sched_domain_cpu2.domain0.wake_idx=0
kernel.sched_domain_cpu3.domain0.busy_factor=1
kernel.sched_domain_cpu3.domain0.busy_idx=2
kernel.sched_domain_cpu3.domain0.cache_nice_tries=1
kernel.sched_domain_cpu3.domain0.flags=4655
kernel.sched_domain_cpu3.domain0.forkexec_idx=0
kernel.sched_domain_cpu3.domain0.idle_idx=0
kernel.sched_domain_cpu3.domain0.imbalance_pct=125
kernel.sched_domain_cpu3.domain0.max_interval=4
kernel.sched_domain_cpu3.domain0.min_interval=1
kernel.sched_domain_cpu3.domain0.name=MC
kernel.sched_domain_cpu3.domain0.newidle_idx=0
kernel.sched_domain_cpu3.domain0.wake_idx=0
kernel.sched_latency_ns=10000000
kernel.sched_migration_cost=500000
kernel.sched_min_granularity_ns=2250000
kernel.sched_nr_migrate=32
kernel.sched_rt_period_us=1000000
kernel.sched_rt_runtime_us=950000
kernel.sched_shares_window=10000000
kernel.sched_time_avg=1000
kernel.sched_tunable_scaling=1
kernel.sched_wake_to_idle=0
kernel.sched_wakeup_granularity_ns=2000000
kernel.sem=250 32000 32 128
kernel.sg-big-buff=32768
kernel.shm_rmid_forced=0
kernel.shmall=2097152
kernel.shmmax=33554432
kernel.shmmni=4096
kernel.sysrq=1
kernel.tainted=4608
kernel.threads-max=10457
kernel.timer_migration=1
kernel.version= name kernel default firm settings/about/version nucleo

sysctl_vm.conf

vm.block_dump=0
vm.dirty_background_bytes=0
vm.dirty_background_ratio=5
vm.dirty_bytes=0
vm.dirty_expire_centisecs=200
vm.dirty_ratio=20
vm.dirty_writeback_centisecs=500
vm.drop_caches=1
vm.extfrag_threshold=500
vm.extra_free_kbytes=6075
vm.highmem_is_dirtyable=0
vm.laptop_mode=0
vm.legacy_va_layout=0
vm.lowmem_reserve_ratio=32 32
vm.max_map_count=65530
vm.min_free_kbytes=3512
vm.min_free_order_shift=4
vm.mmap_min_addr=32768
vm.nr_pdflush_threads=0
vm.oom_dump_tasks=1
vm.oom_kill_allocating_task=0
vm.overcommit_memory=1
vm.overcommit_ratio=50
vm.page_cluster=3
vm.panic_on_oom=0
vm.percpu_pagelist_fraction=0
vm.scan_unevactable_pages=0
vm.stat_interval=1
vm.swappiness=60
vm.vfs_cache_pressure=100

screenshot