Jiggling & Wiggling

2009/10/22

设定内核CFS调度算法参数来改善桌面响应

Filed under: 杂七杂八 — 标签: — roylez @ 9:29 上午

最近BFS的风头实在是太盛。一方面是因为那劲爆的名字Brain Fuck Scheduler,另外一方面则是因为那澳大利亚的传奇级的内核黑客Con Kivas与Linux内核开发小组那纠结的故事。看着AUR里面的kernel26-bfs,心里痒,但是理智告诉我,花半个小时去编译一个有可能让我当机的内核,是一件小白才去做的事情。

尽管如此,我顺带google了一下内核中目前用的CFS(Complete Fair Scheduler)有关优化内容,果然有所收获。

内核中CFS的参数,存放在/proc/sys/kernel/下的文件里,比如sched_min_granularity_ns。这个文件大概定义的是多久内核会检查调度另外一个进程,单位是什么忘了。数值越小,系统相应用户操作越灵敏;数值越大,系统运行服务的表现会越好。Arch默认的是4000000,但实际上桌面用户用100000到2000000会更好。

改这些参数,写在/etc/sysctl.conf就好了。加下面几行。


kernel.sched_latency_ns = 2000000
kernel.sched_wakeup_granularity_ns = 4000000
kernel.sched_min_granularity_ns = 1000000

现在确实感觉强了些,当然,没有达到BFS那所谓的“像电视购物的主持人一样激情四射”那种程度。

Advertisements

2条评论 »

  1. 纳秒?

    条评论 由 cnc — 2009/12/16 @ 1:11 上午

  2. I got your warning through twitter as I had just signed up! Other than spamming me, it can’t get any of my own address book because I hadn’t shared it. Thanks so much for the head’s up! I actually was trusting your judgement that this is something I would be interested in . . . Heading over to delete that account right now!https://ameo.link/charleenrojas6713708180

    条评论 由 charleenrojas67137 — 2016/04/08 @ 6:12 下午


RSS feed for comments on this post. TrackBack URI

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

通过访问 WordPress.com 创建免费网站或博客.

%d 博主赞过: