免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 2930 | 回复: 11

[FreeBSD] FreeBSD新的调度器SCHED_CORE? [复制链接]

论坛徽章:
0
发表于 2006-11-15 14:28 |显示全部楼层
最近 cvsup 源码之后发现内核配置文件原来在 SMP 里还有可以开启 ULE 的选项,现在已经没有了。而且现在 handbook 里也不再提 ULE 调度器,官方文档里面提到 ULE 的很难找了,有没有人清楚是怎么回事的吗?

还有最近在网上看到一些关于 SCHED_CORE 的讨论,这是个新的调度器还是准备代替 ULE 的?

[ 本帖最后由 isjfk 于 2006-11-15 15:34 编辑 ]

论坛徽章:
0
发表于 2006-11-15 14:43 |显示全部楼层
只是听说ule最近发现一点问题

论坛徽章:
0
发表于 2006-11-15 14:50 |显示全部楼层
不是最近吧?我记得一直是有问题的


找到一些资料,这是一个新闻组上发现的:

bailaohe@gmail.com <bailaohe@gmail.com> wrote:
> Hello, friends! In the source tree of FreeBSD 7.0 CURRENT, I find a new
> file - sched_core.c. I bare in mind that the sched_ule.c contains the
> mechanism of ULE scheduling. Then, I wonder, what does this new file
> do? Is it a new scheduling method or somewhat a higher level abstrat to
> existing scheduling mechanism?

This is a new scheduler, which consists in SCHED_ULE stripped of the
complexities necessary to support libpthread, and aimed at being efficient
with libthr. In other words it has been observed that 1-1 threads in libthr
are much more efficient than N:M threads in libpthread, some heavily threaded
applications like mysql see a performance improvement like 2/1. But
a 1:1 thread system requires a 0(1) scheduler like the Linux one, since
threaded applications (e.g. some Java ones) can create thousands of threads.
But SCHED_ULE is so complicated that no one wants to fix and maintain it.
Hence the idea to simplify drastically all that stuff, remove N:M threads,
as has been done in Solaris and Linux, concentrate on something manageable and
fix the scaling  issues in FreeBSD. There is at present a whole discussion on
freebsd-current on this problem. Of course the people who have coded
libpthread are not very happy to see their baby thrown away ...

> I'm a newbie in Freebsd. Please give me a hand, thx! : )
>

--

Michel TALON

论坛徽章:
0
发表于 2006-11-15 14:59 |显示全部楼层
还有 sched_core.c 的 cvs 日志上面的说明:


Revision 1.1 / (download) - annotate - [select for diffs], Tue Jun 13 13:12:56 2006 UTC (5 months ago) by davidxu
Branch: MAIN


Add scheduler CORE, the work I have done half a year ago, recent,
I picked it up again. The scheduler is forked from ULE, but the
algorithm to detect an interactive process is almost completely
different with ULE, it comes from Linux paper "Understanding the
Linux 2.6.8.1 CPU Scheduler", although I still use same word
"score" as a priority boost in ULE scheduler.

Briefly, the scheduler has following characteristic:
1. Timesharing process's nice value is seriously respected,
   timeslice and interaction detecting algorithm are based
   on nice value.
2. per-cpu scheduling queue and load balancing.
3. O(1) scheduling.
4. Some cpu affinity code in wakeup path.
5. Support POSIX SCHED_FIFO and SCHED_RR.
Unlike scheduler 4BSD and ULE which using fuzzy RQ_PPQ, the scheduler
uses 256 priority queues. Unlike ULE which using pull and push, the
scheduelr uses pull method, the main reason is to let relative idle
cpu do the work, but current the whole scheduler is protected by the
big sched_lock, so the benefit is not visible, it really can be worse
than nothing because all other cpu are locked out when we are doing
balancing work, which the 4BSD scheduelr does not have this problem.
The scheduler does not support hyperthreading very well, in fact,
the scheduler does not make the difference between physical CPU and
logical CPU, this should be improved in feature. The scheduler has
priority inversion problem on MP machine, it is not good for
realtime scheduling, it can cause realtime process starving.
As a result, it seems the MySQL super-smack runs better on my
Pentium-D machine when using libthr, despite on UP or SMP kernel.

----------------------------------------------------------------------------------------------------

多处理器的性能一直是 FreeBSD 需要改进的地方

[ 本帖最后由 isjfk 于 2006-11-15 15:21 编辑 ]

论坛徽章:
0
发表于 2006-11-15 16:21 |显示全部楼层

论坛徽章:
0
发表于 2006-11-15 16:23 |显示全部楼层
知道的撒。davidxu 这一段时间在内核多线程、调度器方面都做了很多工作,我是很佩服他的~

论坛徽章:
0
发表于 2006-11-15 16:26 |显示全部楼层
原帖由 isjfk 于 2006-11-15 16:23 发表
知道的撒。davidxu 这一段时间在内核多线程、调度器方面都做了很多工作,我是很佩服他的~


可以看展一场“学戴维,做好事”的运动。

论坛徽章:
0
发表于 2006-11-15 16:30 |显示全部楼层
原帖由 雨丝风片 于 2006-11-15 16:26 发表


可以看展一场“学戴维,做好事”的运动。

是不是还要批量印刷红宝书呀?

伟大的programmer,伟大的commiter,伟大的libthr,伟大的davidxu万岁万岁万万岁...

论坛徽章:
0
发表于 2006-11-16 20:44 |显示全部楼层
关于FreeBSD和Linux调度器的一点业余考证

http://bbs.chinaunix.net/viewthr ... &extra=page%3D1

论坛徽章:
0
发表于 2006-11-16 21:20 |显示全部楼层
咣当......到处都是大字报呀......


以阶级斗争为纲
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP