Linux Scheduler(排程) 的修改達到增強效能

I. 介紹 :

這個東西主要是增進系統在讀寫時候的I/O效能

在Linux上的Scheduler :

1. Noop I/O scheduler: 簡單排程器, 就先到先執行.
2. Anticipatory I/O scheduler: 預測排程器, 會預測下一個IO而調整順序, 據說也不錯, 但演算法複雜, 大量IO時就不是那麼好了.
3. Deadline I/O scheduler: 會紀錄程式的Deadline, 是2.6版核心才引進的, 效果非常不錯.
4. CFQ I/O scheduler: 預設, 儘可能公平的排程器, 適用於桌面程式應用 , 有些許bug(亂吃記憶體) 詳細內容請google


from : 資料來源


II. 說明 :

在Linux上面預設是CFQ Scheduler 包含Android手機也是

這個排程對於手機上 會損失不少效能 這比較適合用於傳統硬碟

在Flash memory上面 比較適合用Deadline Scheduler

這個可以增強不少系統在處理I/O要求上的效能 也不會讓系統亂吃記憶體



III. 修改 :

那如何修改Scheduler呢?

有兩個方法:

1. 使用Market上的OCLF裡面有個可以修改Scheduler的選項

2. <小心使用> 使用 Voltage Control - control OC/UV 不過這方法比較適合OC kernel的人



XI. 額外補充 :

目前這陣子還有一個新出的BFQ Scheduler 在現在的Kernel都有引用

Super kernel系列

Speed MOD kernel 系列

所以在部份人刷Speed MOD kernel之後 也因為這個Scheduler的關係之一

所以達到可以和OC差不多的效能


X. 結論 :

大部分人都是使用了其他家 kernel 所以都有了BFQ

那我這篇主要是給一些不想刷kernel的人 但是你可以透過Schduler修改達到效能提昇





2010-11-12 22:30 發佈



我改成deadline 時io分數反而是比較低的,比原本 Anticipatory 還低一點。差一百多分吧,我是指Quadrant Advanced的總分,改成noop時,分數卻多了二、三百分。但我知道分數不能代表全部。先聽樓主的建議,跑個deadline個幾天看看。

其實Quadrant Advanced測出來分數一直差異很大

你可以沒事固定一個版本去跑個10~20次 去紀錄每個分數

你會發現常常有分數突然爆高個幾百分 又突然落個幾百分...

我最高測出過I/O是7000多分 也測過才6000出頭...甚至更低 囧

我也不知道為啥會這樣 不過真的很詭異就是了OTZ

所以通常我要貼出來的Quadrant Advanced分數 我都是跑到最好分數才貼出來

常常要我跑個20多次= ="



對排程有興趣的人可以去修資工的real time operating system課程
裡面有非常多的排程演算法可以學
一般的OS課程不會介紹太多詳細的schedule方法
但對RTOS來說,排程幾乎就是一切



Scheduler之前在碰Linux的時候 聽過一些

不過後來都忘記了XD 沒真正在玩 久久就忘了..

想到阿狗 就想到恐怖的數學家OTZ...

阿狗大概是資工學系最討厭的東西吧...但是也是最受用的東西

僅次於軟工吧

唉 大學都沒學好 OTZ
我不知道在手機上patch這個東西能帶來多大的效果?
但在DT上,這個卻已經是一個過時的patch
事實證明BFS比這個patch要強大多了
很多Linux發行版都不用了改採BFS
話是這麼說沒錯...

不過手機上的BFQ和linux上的BFS有一樣嗎@@?

BFQ 簡介

BFQ是針對I/O的 BFS是針對CPU的

這點我不太懂...需要指教一下OTZ

不過BFQ這是這一陣子XDA才寫到Android手機上的 Desire沒記錯也有ROM是用這個

所以之前跑Deadline也不見怪阿XD 別太在意..
除了lagfix, 其實speedmod 還有提供一些優化選項的

# Remount all partitions with noatime
atime is a setting where the filesystem updates the access time of a file. This creates a write-after-every-read which slows things down. By default all partitions are mounted with relatime, which is an optimized version of atime. noatime is the fastest, and afaik we don't need atime.

# Tweak cfq io scheduler
Tweaked settings of the disk io scheduler more for flash memory. Defaults are optimized for spinning harddisks. Lowered the idle wait, re-enable the low latency mode of cfq, removed the penalty for back-seeks and explicitly tell the kernel the storage is not a spinning disk.

# Tweak kernel VM management
Set tendency of kernel to swap to minimum, since we don't use swap anyway.
Lower the amount of unwritten write cache to reduce lags when a huge write is required.
Increase tendency of kernel to keep block-cache to help with slower RFS filesystem.
Increase minimum free memory, in theory this should make the kernel less likely to suddenly run out of memory.

# Tweak kernel scheduler
Make the task scheduler more 'fair' when multiple tasks are running. This has a huge effect on UI and App responsiveness. These values (less aggressive settings) are 20% of the Linux defaults, and about half of the Android defaults.

# Miscellaneous tweaks
Manually set the starting dalvik heap size.

(MISC TWEAK IS CHANGED IN THE LATEST VERSIONS OF HARDCORE'S KERNEL. CHECK HIS THREAD FOR CHANGELOG.)


要使用某一個優化只需要進入recovery , advanced CMW options

不過這些都是更進階的優化,使用前要清楚每種優化是做什麼
沒有不好的手機,只有你是否適應它.
內文搜尋
X
評分
評分
複製連結
Mobile01提醒您
您目前瀏覽的是行動版網頁
是否切換到電腦版網頁呢?