libthr修成正果
Daniel刚刚commit的symver变动中包含了一项最新的改动──将libthr「扶正」为libpthread。这样,FreeBSD从7.0-RELEASE开始,将正式默认采用1:1线程,而不是原先的libkse(M:N线程)作为线程库,类似Solaris。
共216篇文章。
Daniel刚刚commit的symver变动中包含了一项最新的改动──将libthr「扶正」为libpthread。这样,FreeBSD从7.0-RELEASE开始,将正式默认采用1:1线程,而不是原先的libkse(M:N线程)作为线程库,类似Solaris。
这是SMPng Project的最后一步。
Log: Final stage of SMP pushdown: rename the Giant lock to the Midget lock.
It seems that I have caught a race condition which can be triggered by renice(1), and we need to take PRS_NEW into account when we need to
access several attributes of a process object.
Robert has pointed out that we may want to just initialize the attribute
early to avoid the race condition. After reading some old 4.4BSD code it
seems that the process object is linked into allproc list before
everything is initialized.
📜 历史文件已不具备现实意义
本文记录了2007年1月FreeBSD
-CURRENT合入ULE 2.0调度器时的情形,文中对 SCHED_ULE及sched_core的讨论仅反映当时的历史背景。
Today, Jeff Roberson has committed his version 2.0 ULE scheduler. This new version has addressed several design issues as well as several bugs.
The new scheduler has adopted a circular queue, instead of the double-queue structure which is also found in the Linux scheduler. The latter has lead to difficulty implementing nice correctly.
For uniprocessor case, ULE is now faster.
MP algorithm has been simplified a bit.
A lot of bugfixes, etc.
To quote the original commit message:
ULE 2.0:
- Remove the double queue mechanism for timeshare threads. It was slow due to excess cache lines in play, caused suboptimal scheduling behavior with niced and other non-interactive processes, complicated priority lending, etc.
- Use a circular queue with a floating starting index for timeshare threads. Enforces fairness by moving the insertion point closer to threads with worse priorities over time.
- Give interactive timeshare threads real-time user-space priorities and place them on the realtime/ithd queue.
- Select non-interactive timeshare thread priorities based on their cpu utilization over the last 10 seconds combined with the nice value. This gives us more sane priorities and behavior in a loaded system as compared to the old method of using the interactivity score. The interactive score quickly hit a ceiling if threads were non-interactive and penalized new hog threads.
- Use one slice size for all threads. The slice is not currently dynamically set to adjust scheduling behavior of different threads.
- Add some new sysctls for scheduling parameters.
Bug fixes/Clean up:
- Fix zeroing of
td_schedafter initialization inschedcaused by recent ksegrp removal._fork _thread() - Fix KSE interactivity issues related to frequent forking and exiting of kse threads. We simply disable the penalty for thread creation and exit for kse threads.
- Cleanup the cpu estimator by using tickincr here as well. Keep ticks and ltick/ftick in the same frequency. Previously ticks were stathz and others were hz.
- Lots of new and updated comments.
- Many many others.
Tested on: up x86/amd64, 8way amd64.
附加了一系列自己的patch,reboot。
[delphij@tarsier] ~> uname -a
FreeBSD tarsier.delphij.net 6.2-RC2 FreeBSD 6.2-RC2 #0: Sat Dec 30
01:18:20 CST 2006 delphij@tarsier.delphij.net:/usr/obj/usr/src/sys/TARSIER i386
🚨 警告
本文介绍的方法假定读者对UFS文件系统以及FreeBSD的日常操作相当熟悉;请勿轻易执行本文介绍的操作,这些操作可能导
致 fsck_ffs(8)无法修正的严重问题。由于在此本人已明确告知读者这一风险,据此,对于由于执行这些操作导致的任何数据损失,本人明示不承担任何责任。
\SystemRoot\SysWow64\Drivers\KBWatch.SYS has been blocked from loading due to incompatibility with this system. Please contact your software vendor for a compatible version of the driver.
真是无话可说了。
在Pawel Jakub Dawidek的不懈努力之下,目前ZFS在FreeBSD -CURRENT上已经处于主体功能可运行状态了。尽管目前其性能还不如UFS,并且在高负载情况下会出现panic,但patch已经处于可用状态。
对于MP内核来说,这是一项用于寻找内核中存在的性能弱点的重要工具。早先kris做的性能评估看来可以继续、常规化地做下去了。
今天尝试了一下触发zonelim的方法,不过zonelim没搞出来,却发现了另一个问题——如果并发执行ifconfig配置同一块网卡,似乎有由于欠锁导致的断言失败。打算找时间研究一下。