delphij's Chaos

PRS_NEW: Check it or not?

Kernel

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.

阅读全文… ( 本文约 97 字,阅读大致需要 1 分钟 )

三类人

Life

别人总结的。

一类可以做朋友,这类人绝对不能有(在我看来是)人品问题的问题;
一类可以做生意,这类人也许有一些在我看来是人品问题的问题,但是他们有底限;
还有一类既不能做朋友,也不能做生意,因为这些人连底限都没有。

参与评论

DNS中的SRV记录

Networking

最近看代码时了解到的,顺手查了一下,在此留个记录:

SRV记录的作用是指明某域名下提供的服务。

例子:

_http._tcp.example.com. SRV 10 5 80. www.example.com

SRV后面项目的含义:

10 - 优先级,类似MX记录
5 - 权重
80 - 端口
www.example.com - 实际提供服务的主机名。

阅读全文… ( 本文约 124 字,阅读大致需要 1 分钟 )

在tcpm上看到一篇论文

Networking

今天有人在IETF的tcpm上有人提到一篇《Misbehaving TCP Receivers Can Cause Internet-Wide Congestion Collapse》的论文。看起来是一个很有意思的问题,即,乐观ACK(opt-ack)在作者看来是一个潜在的DoS攻击工具,而且粗略地扫了一眼,这个问题很可能是真实存在的(但是这篇2005年11月的文章,目前似乎只有Sun做了回应……),等周末有时间研究一下。

参与评论

说一个笑话,大家一乐

Life

起初,他们只是不支持FreeBSD/Linux,我有Windows远程桌面,我没投诉;
到后来,他们不允许Windows远程桌面,我可以本地访问一台64位的Windows 2003 Server,勉强投诉两句,暂时也忍了;
再后来,他们又写了不支持64位Windows 2003 Server的所谓「安全」驱动,我拼命投诉,可是他们不理我了,更有人说,我是「小众系统」,正如一开始人们说FreeBSD/Linux两种系统一样。

阅读全文… ( 本文约 285 字,阅读大致需要 1 分钟 )

ULE 2.0 hits -HEAD

Kernel

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 O(1) 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_sched after initialization in sched_fork_thread() caused by recent ksegrp removal.
  • 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.

阅读全文… ( 本文约 506 字,阅读大致需要 3 分钟 )

Conclusion, 2006

Life

一直想找个时间总结一下。虽然本命年还没有结束,但是今天是2006年的最后一天,所以,确实是时候总结了。

阅读全文… ( 本文约 542 字,阅读大致需要 2 分钟 )